Intro to Arduino

Each Group Collect

  • Digital Multimeter
  • Variable Voltage Power Supply
  • Bana Plug Leads
  • Resistors
  • DC Motor

What is Electricity?

A general understanding of electricity and the rules that determine how it flows and how it can be controlled are crucial to quickly prototyping your designs. These resources cover the fundamentals of working with electricity.

Water analogy from Sparkfun

Voltage = Pressure in system

 

Current (Amperage) = Amount of Flow

 

 

Resistance = Resistance to Flow

V = I * R (voltage = current * resistance)

I = V / R (current = voltage / resistance)

Solve for LED / Resistor Combo

We know the ideal forward voltage (Vf) and current (I) of the LED.

Target Vf = 3.3v

Target I = 20mA (0.02A)

V = I * R

R = (Vs – Vf) / I

Exercise 1: Learn the Digital Multimeter (DMM)

Sparkfun: How to Use a Multimeter

  1. Set up a simple circuit on a breadboard with an LED, a resistor, and the variable voltage power supply:
    1. Anode (+) [because Node.js is positive/great]
    2. Cathode (-) [because cats are negative/terrible]
  2. Set the power supply to 5V
  3. Use the the DMM to measure voltage at different points of the circuit
  4. Notice the amount of current being used by the power supply
  5. Insert the DMM into the circuit and measure the amount of current (see if it matches what the power supply says)
  6. What happens if you change the resistor?
  7. Add a switch or button
  8. Draw the [circuit diagram](https://learn.sparkfun.com/tutorials/how-to-read-a-schematic) on the table

 

What is Arduino?

From: Instructables

A simple microcontroller and software combo developed to help designers, artists and non-engineers rapidly prototype with electronics.

Some things to remember:

  1. Analog Pins are for reading only (0v – 5v)
  2. analogRead(pinNumber) returns an integer value between 0 – 1023
  3. Digital Pins can be INPUT or OUTPUT
    1. digital pins can supply a low-current (100mA) 5v supply in output mode:  digitalWrite(pin, HIGH/LOW);
    2. digital pins can read the state of that pin, as either HIGH or LOW (5v or 0v): digitalRead(pin);
  4. You can run the arduino WITHOUT the USB cable attached (only a 5v-24v barrel jack)
    1. You can also power from the Vin and GND pins.

 

Exercise 2: Set up Arduino & Blink

  1. Download the Arduino IDE
  2. Follow the Getting Started guide for the Arduino UNO (word for word!)
  3. Run the Blink! example sketch
    1. Open Examples > Basics > Blink
    2. Plug your Arduino into the computer
    3. Choose your board: Tools>Board
    4. Choose the correct port: Tools>Port
    5. Click the check icon (verify)
    6. If no errors, upload to the arduino

Exercise 3: Reading Data & Graphing it

  1. Upload the Standard Firmata to your Arduino (check out File>Examples>Firmata>StandardFirmata)
  2. Make sure you have the Arduino(Firmata) library (you can download this from the Sketch>Import Library>Add Library… menu)
  3. In Processing and copy/paste this code:

  1. Find a sensor (Potentiometers are a good one)
  2. Attach it to the Analog pins of your Arduino (You may need to find a diagram/datasheet/instructions on the internet)
  3. Run the Processing sketch!

 

Leave a Reply