background image

DC Motor

What it Does:

No. of Leads:

Spins when a current is passed through it.

2

Identifying:

Things to watch out for:

This one is easy, it looks like a motor. Usually 

  - Using a transistor or relay that is rated for 

a cylinder with a shaft coming out of one 

the size of motor you're using.

end

More Details on Wikipedia:

  http://tinyurl.com/d826yh

Hobby Servo

What it Does:

No. of Leads:

Takes a timed pulse and converts it into an 

3

angular position of the output shaft.

Things to watch out for:

Identifying:

  - The plug is not polarized so make sure it 

A plastic box with 3 wires coming out one 

is plugged in the right way.

side and a shaft with a plastic horn out the 

More Details:

top.

  http://tinyurl.com/4zo4he

07

06

04 ELEC

electronics 

primer

.: A Small Electronics Primer:.

04 ELEC

electronics

primer

Electronics in Brief

No previous electronic experience is required to have fun with this kit. Here are a few details 

about each component to make identifying, and perhaps understanding them, a bit easier. If at 

any point you are worried about how a component is used or why its not working the internet 

offers a treasure trove of advice, or we can be contacted at 

[email protected]

Component Details

LED 

(Light Emitting Diode)

What it Does:

No. of Leads:

Emits light when a small current is passed 

(one longer this one connects to positive)

through it. 

(only in one direction)

Things to watch out for:

Identifying:

  - Will only work in one direction

Looks like a mini light bulb.

  - Requires a current limiting resistor

More Details on Wikipedia:

  http://tinyurl.com/zhpyv

Piezo Element

What it Does:

No. of Leads:

A pulse of current will cause it to click a 

2

stream of pulses will cause it to emit a tone.

Things to watch out for:

Identifying:

  - Difficult to misuse. 

In this kit it comes in a little black barrel, but 

More Details:

sometimes they are just a gold disc.

  http://tinyurl.com/38crmu

Potentiometer

What it Does:

No. of Leads:

Produces a variable resistance dependant on 

3

the angular position of the shaft. 

Things to watch out for:

Identifying:

  - Accidentally buying logarithmic scale.

They can be packaged in many different 

More Details:

form factors, look for a dial to identify.

  http://tinyurl.com/28pbhd

IC (Integrated Circuit)

What it Does:

No. of Leads:

Packages any range of complicated 

2 - 100s 

(in this kit there is one with 3 (TMP36) and 

one with 16 (74HC595)

electronics inside, an easy to use form factor 

Things to watch out for:

Identifying:

  - Proper orientation.

(look for marks showing pin 1)

The part ID is written on the outside of the 

More Details:

package. (this sometimes requires a lot of 

  http://tinyurl.com/87k4d

light or a magnifying glass to read)

Photo Resistor

What it Does:

No. of Leads:

Produces a variable resistance dependant on 

2

the amount of incident light.

Things to watch out for:

Identifying:

  - Remember it needs to be in a voltage 

Usually  a little disk with a clear top and a 

divider before it provides a useful input.

curvy line underneath.

More Details:

  http://tinyurl.com/c2wdkw

Component Details (cont.)

Pushbutton

What it Does:

No. of Leads:

Completes a circuit when it is pressed

4

Identifying:

Things to watch out for:

A little square with leads out the bottom and 

  - these are almost square so can be 

a button on the top.

inserted 90 degrees off angle. 

More Details:

  http://tinyurl.com/cmts7d

0 - Black

5 - Green

20% - none

1 - Brown

6 - Blue

10% - silver

2 - Red

7 - Purple

5% - gold

3 - Orange

8 - Grey

4 - Yellow

9 - White

first digit
second digit

# of zeros

tolerance

Examples:
:

green-blue-brown - 560 ohms
red-red-red - 2 200 ohms (2.2k)

Resistor Color Code

Lead Clipping

Some components in this kit come with very long wire 
leads. To make them more compatible with a breadboard 
a couple of changes are required.

LEDs:

Clip the leads so the long lead is ~7mm long and the 
short one is ~5mm 

Resistors:

Bend the leads down so they are 90 degrees to the 
cylinder. Then snip them so they are ~6mm long.

Other Components:

Other components may need clipping 
use your discretion when doing so.

Resistors

What it Does:

No. of Leads:

Restricts the amount of current that can flow 

  2 

through a circuit.

Things to watch out for:

Identifying:

  - Easy to grab the wrong value 

(double check 

the colors before using)  

Cylinder with wires extending from either 

More Details on Wikipedia:

end. The resistance value is displayed using 

  http://tinyurl.com/cmeqw5

a color coding system (for details see next 
page)

Transistor

What it Does:

No. of Leads:

Uses a small current to switch or amplify a 

3 (Base, Collector, Emitter)

much larger current.

Things to watch out for:

Identifying:

  - Plugging in the right way round.

(also a 

current limiting resistor is often needed on the base pin)  

Comes in many different packages but you 

More Details on Wikipedia:

can read the part number off the package. 

  http://tinyurl.com/eazkn

(P2N2222AG in this kit and find a datasheet online)

Diode

What it Does:

No. of Leads:

The electronic equivalent of a one way 

valve. Allowing current to flow in one 

Things to watch out for:

direction but not the other.

  - Will only work in one direction 

(current will 

flow if end with the line is connected to ground)

Identifying:

More Details on Wikipedia:

Usually a cylinder with wires extending from 

  http://tinyurl.com/ysz57b

either end. 

(and an off center line indicating polarity)

Summary of Contents for ARDX

Page 1: ...Arduino Experimenter s Guide ARDX ARDX arduino experimentation kit ...

Page 2: ...der a Creative Commons By Share Alike license This means you must credit oomlout in your design and share your developments in a similar manner Why We grew up learning and playing with open source software and the experience was good fun we think it would be lovely if a similar experience was possible with physical things more details on the Creative Commons CC By Share Alike License can be found ...

Page 3: ...ircuits CIRC01 Getting Started Blinking LED 08 CIRC02 8 LED Fun Multiple LEDs 10 CIRC03 Spin Motor Spin Transistor and Motor 12 CIRC04 A Single Servo Servos 14 CIRC05 8 More LEDs 74HC595 Shift Register 16 CIRC06 Music Piezo Elements 18 CIRC07 Button Pressing Pushbuttons 20 CIRC08 Twisting Potentiometers 22 CIRC09 Light Photo Resistors 24 CIRC10 Temperature TMP36 Temperature Sensor 26 CIRC11 Larger...

Page 4: ...M assembling the pieces Breadboard x1 Arduino x1 3mm x 10mm bolt x2 3mm nut x4 Arduino Holder x1 c A usin c c p Putting It Together Thi It For an introduction to what an Arduino is visit http tinyurl com 9txjmh ...

Page 5: ...e plug your Arduino board into a free USB port Wait for a box to pop up Step 5 Add new Hardware Skip searching the internet click the next box when prompted to do so Install from a Specific destination click Install from a list or specific location Advanced Choose the Location c program files arduino 00rr drivers FTDI USB Drivers Finished Step 2 Open The dmg Open mount arduino 00 mac dmg rr rr ver...

Page 6: ...etup has finished After it has run once it will be run again and again until power is removed Syntax semicolon Each line of code must be ended with a semicolon a missing semicolon is often the reason for a programme refusing to compile One of the slightly frustrating elements of C is its formating requirements this also makes it very powerful If you remember the following you should be alright mul...

Page 7: ...Used when you would like to repeat a chunk of code a number of times can count up i or down i or use any variable Digital digitalWrite pin value Once a pin is set as an OUTPUT it can be set either HIGH pulled to 5 volts or LOW pulled to ground pinMode pin mode Used to set a pins mode pin is the pin number you would like to address 0 19 analog 0 5 are 14 19 the mode can either be INPUT or OUTPUT in...

Page 8: ...gh it only in one direction Things to watch out for Identifying Will only work in one direction Looks like a mini light bulb Requires a current limiting resistor More Details on Wikipedia http tinyurl com zhpyv P P I P C P Exam gree red R Resistors What it Does No of Leads Restricts the amount of current that can flow 2 through a circuit Things to watch out for Identifying Easy to grab the wrong v...

Page 9: ... read Photo Resistor What it Does No of Leads Produces a variable resistance dependant on 2 the amount of incident light Things to watch out for Identifying Remember it needs to be in a voltage Usually a little disk with a clear top and a divider before it provides a useful input curvy line underneath More Details http tinyurl com c2wdkw Component Details cont Pushbutton What it Does No of Leads C...

Page 10: ...his plug the Arduino board into your USB port Then select the proper port in Tools Serial Port the comm port of your Arduino Next upload the program by going to File Upload to I O Board ctrl U Finally bask in the glory and possibility that controlling lights offers If you are having trouble uploading a full trouble shooting guide can be found here http tinyurl com 89s2po The Circuit Wire 10mm LED ...

Page 11: ...is connected to pin 13 but we can use any of Along with digital on off control the Arduino can control the Arduino s pins To change it take the wire plugged some pins in an analog brightness fashion more details on into pin 13 and move it to a pin of your choice from 0 this in later circuits To play around with it 13 you can also use analog 0 5 analog 0 is 14 Change the LED to pin 9 also change th...

Page 12: ...rduino works Along with controlling the LEDs we start looking into a few simple programming methods to keep your programs small for loops used when you want to run a piece of code several times arrays used to make managing variables easier its a group of variables The Circuit 5mm Green LED x8 560 Ohm Resistor Green Blue Brown x8 2 Pin Header x4 CIRC 02 Breadboard sheet x1 Parts download breadboard...

Page 13: ...herNoLoop Will light one then delay for delayTime then light the next LED it Not Working 3 things to try More More More More details where to buy more parts where to ask more questions http tinyurl com d2hrud Making it Better Some LEDs Fail to Light It is easy to insert an LED backwards Check the LEDs that aren t working and ensure they the right way around Switching to Loops in the loop function ...

Page 14: ...2222AG a rather common general purpose transistor The important factors in our case are that its maximum voltage 40 v and its maximum current 600 milliamp are both high enough for our toy motor full details can be found on its datasheet http tinyurl com o2cm93 note the transistor we use has a in order Base Collector Emitter pinout differing from some other popular transistors The 1N4001 diode is a...

Page 15: ... 50 because our eyes are not quick enough to would like to change the speed of acceleration change the see it flashing on and off The same feature works with variable delayTime larger means a longer acceleration time transistors Don t believe me Try it out Still Not Working Sometimes the Arduino board will disconnect from the computer Try un plugging and then re plugging it into your USB port int ...

Page 16: ...tioning is controlled through a timed pulse between 1 25 milliseconds 0 degrees and 1 75 milliseconds 180 degrees 1 5 milliseconds for 90 degrees Timing varies between manufacturer If the pulse is sent every 25 50 milliseconds the servo will run smoothly One of the great features of the Arduino is it has a software library that allows you to control two servos connected to pin 9 or 10 using a sing...

Page 17: ...rduino s included our favorites library sometimes it is fun to figure out how to program something yourself Try it We re controlling the pulse directly Xmas Hit Counter so you could use this method to control servos on any of the http tinyurl com 37djhq Arduino s 20 available pins you need to highly optimize this code before doing that Open Source Robotic Arm uses a servo controller as well as the...

Page 18: ...Ds and the like using only three arduino pins They can also be linked together to give you a nearly unlimited number of outputs using the same four pins To use it you clock in the data and then latch lock it in latch it To do this you set the data pin to either HIGH or LOW pulse the clock then set the data pin again and pulse the clock repeating until you have shifted out 8 bits of data Then you p...

Page 19: ...r details on how this works try http tinyurl com 6vz53 An Now things get more interesting If you look back to the code from CIRC02 Arduino is very good at manipulating bits and there are an entire set 8 LED Fun you see we change the LEDs using digitalWrite led state this of operators that help us out Details on bitwise maths is the same format as the routine we wrote changeLED led state You can ht...

Page 20: ...element makes a clicking sound each time it is pulsed with current If we pulse it at the right frequency for example 440 times a second to make the note middle A these clicks will run together to produce notes Lets get to experimenting with it and get your Arduino playing Twinkle Twinkle Little Star C N M M P T a t c C o T I t c t a u i M T a g T m w n c d e f g a b C h int int char int int void f...

Page 21: ...eir values in the tones array up or down 1 1 2 4 Happy Birthday first line until they sound right each note is matched by its name int length 13 char notes ccdcfeccdcgf in the names array ie c 1915 int beats 1 1 1 1 1 2 1 1 1 1 1 2 4 Tired of Twinkle Twinkle Little Star The code is written so you can easily add your own songs check out the code below to get started Melody cleft 2005 D Cuartielles ...

Page 22: ... LOW The button is set up to pull the Arduino s pin LOW when it is pressed however when the button is unpressed the voltage of the pin will float causing occasional errors To get the Arduino to reliably read the pin as HIGH when the button is unpressed we add the pull up resistor note the first example program uses only one of the two buttons The Circuit Wire Pushbutton x2 560 Ohm Resistor Green B...

Page 23: ...sy to put it in the wrong way Give it a 90 degree twist and see if it starts working On button off button Fading up and down The initial example may be a little underwhelming ie I Lets use the buttons to control an analog signal To do this you don t really need an Arduino to do this lets make it a will need to change the wire connecting the LED from pin 13 to little more complicated One button wil...

Page 24: ...hen it is connected with 5 volts across its outer pins the middle pin will read some value between 0 and 5 volts dependent on the angle to which it is turned ie 2 5 volts in the middle We can then use the returned values as a variable in our program The Circuit Wire Potentiometer 10k ohm x1 560 Ohm Resistor Green Blue Brown x1 2 Pin Header x4 CIRC 08 Breadboard sheet x1 Parts Green LED x1 Schemati...

Page 25: ...nge the loop code to Sometimes you will want to switch an output when a void loop int value analogRead potPin 4 value exceeds a certain threshold To do this with a analogWrite ledPin value potentiometer change the loop code to Upload the code and watch as your LED fades in relation to void loop int threshold 512 your potentiometer spinning Note the reason we divide the if analogRead potPin thresho...

Page 26: ...tp tinyurl com 2sunta The exact voltage at the sensing pin is calculable but for our purposes just sensing relative light we can experiment with the values and see what works for us A low value will occur when the sensor is well lit while a high value will occur when it is in darkness The Circuit Wire Photo Resistor x1 560 Ohm Resistor Green Blue Brown x1 2 Pin Header x4 CIRC 09 Breadboard sheet x...

Page 27: ...ied Using the full range of your servo response to light lets instead turn it on or off based on a You ll notice that the servo will only operate over a limited threshold value Change the loop code with void loop portion of its range This is because with the voltage dividing int threshold 300 circuit we use the voltage on analog pin 0 will not range from if analogRead lightPin threshold digitalWri...

Page 28: ...we will use some of the Arduino s maths abilities Then to display it we ll use one of the IDE s rather powerful features the debug window We ll output the value over a serial connection to display on the screen Let s get to it One extra note this circuit uses the Arduino IDE s serial monitor To open this first upload the program then click the button which looks like a square with an antennae The ...

Page 29: ... before Serial println temperature Upload the sketch turn on the serial monitor then change the More informative output speed from 9600 baud to 115200 baud in the pull down menu Lets add a message to the serial output to make what is You are now transmitting data 12 times faster appearing in the Serial Monitor more informative To do Temperature Value is Unchanging Try pinching the sensor with your...

Page 30: ...point is fun sometimes you just want to wire up a hundred switches to control something magnificent Relays give you the ability to dream it up then control it with your Arduino Now to using todays technology to control the past The 1N4001 diode is acting as a flyback diode for details on why its there visit http tinyurl com b559mx The Circuit 2 Pin Header x4 CIRC 11 Breadboard sheet x1 Schematic 2...

Page 31: ...Working The included relays are designed to be soldered rather than used in a breadboard As such you may need to press it in to ensure it works and it may pop out occasionally Controlling a Motor In CIRC 03 we controlled a motor using a transistor However if you want to control a larger motor a relay is a good option To do this simply remove the red LED and connect the motor in its place remember ...

Page 32: ... the Creative Commons Attribution Share Alike 3 0 Unported License To view a copy of this licence visit http creativecommons org licenses by sa 3 0 or send a letter to Creative Commons 171 Second Street Suite 300 San Francisco California 94105 USA www oomlout com ...

Reviews: