Namespaces

Variants
Actions

SimpleArduinoConnection-p2

From Cycling '74 Wiki
(Difference between revisions)
Jump to: navigation, search
Line 30: Line 30:
 
Now that we have our circuit ready, let's create an Arduino sketch that tests our board, and prepares it for communication with Max.
 
Now that we have our circuit ready, let's create an Arduino sketch that tests our board, and prepares it for communication with Max.
  
<Previous: Introduction> [[SimpleArduinoConnection-p3|<Next: The Arduino sketch>]]
+
[[SimpleArduinoConnection-p1|<Previous: Introduction>]] [[SimpleArduinoConnection-p3|<Next: The Arduino sketch>]]

Revision as of 20:09, 6 May 2013

Step 1: Create an Arduino-based Circuit

We will begin our Arduino connection by creating a simple circuit. This circuit will use a small potentiometer for input, and four LEDs for visual output. The parts necessary for this circuit include:

  • An Arduino board (we will be using an Arduino Uno)
  • A small breadboard
  • A variety of jumper wires
  • Four (4) LEDs of any color
  • Five (5) 330 ohm resistors
  • One breadboard-mounting potentiometer

Using these parts, create the following circuit layout:

SimpleArduinoConnection-0201.png

(You can download the Fritzing file here: Media:SimpleArduinoConnection-02fzz.zip)

A few notes about this circuit:

  • You will be plugging the Arduino into the computer for serial communication with the computer (and Max). Most Arduino boards have a USB port that provides power to the device. We tap into that power for the simple circuit we've created.
  • We use digital pins 2 - 5 for our LED display. You generally don't want to use pins 0 and 1, since they are used for serial communication.
  • In order to prevent overtaxing the power supply of the Arduino, use use the 330 ohm resistors as "current limiting resistors" - they reduce the amount of current drawn from the Arduino board, and prevent the LEDs from burning out.

Here's a picture of my circuit setup:

ArduinoCircuit.gif

Now that we have our circuit ready, let's create an Arduino sketch that tests our board, and prepares it for communication with Max.

<Previous: Introduction> <Next: The Arduino sketch>