Instructables

Arduino controlled animatronic wooden head (reading lamp)

FeaturedContest Winner

Step 10: The electronic circuit

Picture of The electronic circuit
R0017873.JPG
VHS video - electonics parts recyclingArduino controlling a servoThe circuit for the Arduino was worked up from samples circuits from a Sparkfun kit which came with lots of easy-peasy test circuits.  

Although these covered the basics of servo control, LED brightness, signal conversion from analog inputs to digital inputs and so on, almost all of that is controlled by the code in the Arduino sketch.


The electronic circuitry for this is really absurdly simple. The inputs were simple variable resistors from old stereos, connected between earth and the 5V supply rails. The only thing that really required any electronic thinking was making sure there was sufficient current for the power LEDs. The servo circuits were really just a connection to earth, one to 5V and one to the control signal from the Arduino.

1. Using variable resistors to create variable voltages as inputs

The controls really are the simplest circuits ever. For each input needed, a variable resistor is linked between the earth and 5V, with the variable voltage output being used as the signal for an Arduino PIN. Simple!

2. Using a transistor to provide sufficient power to the lamp

The Arduino output is easy to programme, but the output rating of the Arduino Uno's digital PINs is limited to 40mA, which was not sufficient to output current or the power LEDS, which were each rated at 3W.


High power LED eyeballs being testedTransistor to power LEDsWith a supply voltage of 5V, the LED current required could be worked out using

current = power/voltage

= 3W/5V = 0.6 Amps

This meant the value of the pull down resistor that would make 0.6A of current flow from a 5V supply could be worked out using Ohm's law:

resistance = voltage/current

This worked out at = 5V/0.6A =  5/(3/5) = 5x5/3= 25/3 = 8.3 Ohms

This is obviously much higher than the 40 mA power output rating of the Arduino pins. 
Arduino LED power circuit
For this reason, instead of powering the LEDs directly from the pin (as one would in a simple "blink" circuit), the pin out put was used as a signal to a NPN transistor


Here is the detail of the rather rough circuit diagram showing the connection between the output pin (D3) to the transistor base, and the low value of the draw down resistor (10 Ohms) to allow sufficient current to flow between the 5v rails.

In theory this would give a maximum of 0.5A. This is actually running the LEDs at half power as there are two of them connected in parallel sharing the current.

The resistor used was a power resistor from a old video recorder.







3. Connecting the servos
This part of the circuit required nothing more than plugging in the servos to the earth, the 5V rail and an Arduino pin as the control signal.



 
Remove these adsRemove these ads by Signing Up
skrubol2 years ago
Couple mistakes on your units and math.
It doesn't look like you're using a switching step-down converter to power your LED, so the voltage across the LED should be around 3.3v rather than 5v in your power/current calculations.
you state resistance = voltage/power, should be resistance = voltage/current
then your units are wrong in the next line. Should be 5V/0.6A not 5V/0.6V.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!