Wednesday, 22 August 2012

Transistors and motors

To turn electric motors on and off with the Arduino you really need a transistor, none of which came in the starter pack I bought.

I found some TIP122 transistors in the loft at home (left over for a previous unsuccessful foray into electronics many years ago), and when I Googled 'TIP122 and Ardunio', it came up with a very simple motor control circuit using a TIP122 - here

For some motors I dismantled an old robot toy (sorry kids!). It has a small 3v motor in each of its feet.
I build the circuit on a separate breadboard (the one in the kit is really too small!) and wrote a very simple motor control sketch, just to try it out. This is the circuit I built:

 This is the sketch I wrote to turn the motor on and off:
To make it work, you open a serial monitor window. Type 'g' and the motor will start running, type 's' and it stops. Simple! Next, I will put the two robot feet together and create a 4 wheel vehicle which I can steer left and right.

No comments:

Post a Comment