Go Down

Topic: How can I get the 5v outputs to switch 12v outputs on this project ? (Read 1 time) previous topic - next topic

driz

I've finally finished the programming on my strobe LED project and got it working on an attiny85 and am just about ready to solder this up on some protoboard. But im going to want to replace these leds with led strips that run on 12v, but the attiny runs 5v and so are it's outputs.

I will power this off a 3s lipo which would give me the right power for the LED strips, and I guess I need to use a voltage regulator to power the tiny with 5v, but im confused as to how to send the output and power these led strips to blink. What would be the best solution here ? and how would you guys do this?

here is a photo (if that helps at all) http://i.imgur.com/jGm09mN.jpg

Thanks

JimboZA

Give the LEDs their power from the external source but below the LED, ie on the ground side, put an NPN transistor of some sort. Then your digital io from Arduino switches the transistor base (thru a resistor), which in turn switches the low side of the LED circuit.

Something like ..... this.... but with the right voltages and not necessarily that model of transistor.
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

CrossRoads

You can use 4 discrete transistors and base current limit resisitors, or a single chip, transistor array with built in limit resistors such as ULN2003 to replace all 8 of those components.
http://www.digikey.com/product-detail/en/ULN2003AN/296-1979-5-ND/277624
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

driz

thanks guys, so transistors are the way to go. Any idea what type / number transistor I should use?


JimboZA


Any idea what type / number transistor I should use?




Well I think CR was telling you that......
Arduino ethernet server here.... http://jimboza.gotdns.com:8085/

No PMs for help please

Constantin

#5
Apr 10, 2013, 04:40 pm Last Edit: Apr 10, 2013, 04:43 pm by Constantin Reason: 1
Yup, the ULN2003 is used in just about every appliance I have torn down for work to drive relays. It's a great little chip and the only additional advice I'd give is that there are current limits for Darlington-arrays like the 2003A.

So review the data sheet and your LED-driving current requirements carefully to ensure that you are not exceeding the current limits of the 2003A or switch to a beefier transistor or perhaps even a electromechanical relay. It all depends on what you are trying to do - for example, dimming via PWM will not play well with most/all electromechanical relays, while simple on/off may be perfect for a relay and not so perfect for the solid state relay (heating).

You will still need a chip like a 2003A to drive a electromechanical relay, however. And, unless the chip has a built-in snubber, add a snubber diode to limit inductive kickback from the relay from damaging the 2003A.

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

driz


Well I think CR was telling you that......


Understood thank you, but I wont be needing those resistors as the led strips power direct from 12v and have their own.

Also in my sketch I am using PWM to dim the LED's, is this still possible using single transistors ?

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Constantin

How'd relays come into this?


All a function of current, no? Isn't it typically cheaper to use a electromechanical relay for higher currents as long as you don't need to PWM quickly? Hence my recommendation to have a look at the datasheet vs. the expected power draw of the LED string. The ULN2003a is usually good for up to 500mA, which typically gets you about 25-50 small LEDs. However, larger LEDs can draw 1W-3W, which limits the number of such LEDs you can drive with a ULN2003 to less than 5.

Remember, the OP gave no indication re: the power of his LED string...

CrossRoads

PWM at any speed is not good with relays. The contacts are usually rated for so many closures, which PWM would quickly wear out, and the chattering would drive one mad as well.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

driz

Im just trying to get my head around the wiring for the transistors. I figure id need NPN type for the low-side switching.

How does this look? http://i.imgur.com/BE7jniN.gif

Base +5v (arduino pwm output)
Collector -12v (led strip negative)
Emitter -12v (led strip negative)

Sorry if this is elementary stuff, im a bit new to electronics

(edit: the led strips are http://j.mp/YmLEuX I will use about 30 low power leds (50cm) and should have a draw about 200ma )

CrossRoads

Use the example on pin D12. Emitter connects to Arduino Gnd and to power supply Gnd.
LED strip+ goes to 12V, LED strip- goes to the collector.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

driz


Use the example on pin D12. Emitter connects to Arduino Gnd and to power supply Gnd.
LED strip+ goes to 12V, LED strip- goes to the collector.


perfect thanks :)

Can I ask why the arduino and 12v grounds are tied together, I don't quite understand how that works

Go Up