Attiny85 as 12V LED-strip pwm driver, feedback request. - Page 1
Forum section: electronics / projects

author: Sprutbærsj
author_rank: Contributor
timestamp: February 27, 2015, 01:23:34 pm
content: HelloI have no real background in electronics engineering, so everything I know is self-though. Therefore, I would appreciate feedback and constructive criticism.This is the circuit I came up with for a flexible and (hopefully) reliable driver for an LED-strip for kitchen lighting. Most of the parts are from eBay, so if anything is too shitty to use, please let me know.I plan on using a veroboard for the final project and close it up in a watertight box. I have the code on a USB-stick somewhere, but it's not complete so I'll wait with posting it. The PWM-signal looks good, only a tiny amount of overshoot. I'm a little worried about the power brick and I don't know if it's safe to turn off and on under prolonged use. The on/off switch along with the potentiometer will be separated from the circuit and mounted in an external box.The circuit is tested and works on protoboard, but I don't want to solder it to a veroboard just yet in case I have missed something or something is unstable, unsafe or could have been done better.Circuit parameters:Low/No current-draw when offSoft power switch on/offLinear adjustmentSmooth on/off rampingLow heat productionMaterial list:LED-strip, 5m 5050,http://www.ebay.com/Power brick, 12V 2A,http://www.ebay.com/Attiny85, datasheet;http://www.atmel.com/NE555P, datasheet;http://www.ti.com/IRF9540, P-Channel MOSFET, datasheet;http://www.vishay.com/L7805CV, 5v regulator, datasheet;http://datasheet.octopart.com/2N3904, NPN transistor, datasheet;http://www.ece.rice.edu/Pot.meter, 10K misc, ish;https://blog.adafruit.com/Resistors; 1x100?, 4x10k?, 1x100k?Capacitors; 1x0.µF (ceramic), 2x10µF (electrolytic)Intended enclosure for the potentiometer and switch; ELKO dimmer case,http://img.gfx.no/1196/1196506/original.jpgI found the soft switching circuit on this forum;http://www.eevblog.com/Quote from: Electroalek on December 15, 2012, 09:32:54 pmSorry for potato-quality phonos.

author: madires
author_rank: Super Contributor
timestamp: February 27, 2015, 02:16:03 pm
content: Since you got some unused I/O pins you could let the ATtiny do the power control too. Have you looked at using a low side switch for the LED strip (logic level n-channel MOSFET)? And what about replacing the 7805 with something more suitable for a low current draw? Why haven't you placed the 'on' LED at the 7805's output?

author: georges80
author_rank: Frequent Contributor
timestamp: February 27, 2015, 03:47:35 pm
content: The tiny85 and a low quiescent current regulator and you don't need the 555 junk.You can sleep the uC when the momentary switch turns it 'off'. Have it wake up from sleep with the momentary switch on the INT pin. With a reasonable regulator you could easily get <50uA during sleep. Program unused i/o pins on the uC to pullup to ensure no 'floating' pins.cheers,george.

author: Sprutbærsj
author_rank: Contributor
timestamp: February 28, 2015, 02:44:45 pm
content: Sorry for late response.Quote from: madires on February 27, 2015, 02:16:03 pmI have not looked too much into having the Attiny as the power control. Mainly because it requires the 7805 to stay on all the time as well as the Attiny.I have worked with the IRFZ44 on this project, but found it easier to use an P-channel.I had a DC-DC buck in there, but I thought it was a bit overkill.. What do you recommend to replace the 7805?The status-LED will most likely be removed in the final circuit. Its mainly there for troubleshooting and to see how big the delay is from power-on to start-up.Quote from: georges80 on February 27, 2015, 03:47:35 pmDo you think I would have to replace the 7805 for the off-state-current to get that low?The other i/o's are not programmed or tied to ground, I think I'll do that. Thanks.

author: georges80
author_rank: Frequent Contributor
timestamp: February 28, 2015, 05:22:26 pm
content: Quote from: Sprutbærsj on February 28, 2015, 02:44:45 pmThe 7805 has high quiescent current draw (ground pin current) - just read the specs...There are MUCH better modern regulators, the old 7805 was a dodo in the previous century and I can't imagine why you would choose it in this one.My "go to" regulator family these days is the Micrel MIC5235 since it has reverse polarity protection, low ground pin current, spike handling capability, ceramic capacitor stable and available in a reasonably small SOT23 package.cheers,george.

author: madires
author_rank: Super Contributor
timestamp: February 28, 2015, 07:01:59 pm
content: Quote from: Sprutbærsj on February 28, 2015, 02:44:45 pmNo, you can re-design the power control to power off the voltage regulator and ATtiny completely. The trick is to use the power push button to switch the transistor for the voltage regulator. But it has to be done in a decoupled way, because the push buttion will be also used as input for the ATtiny (power-off). The MCU powers up, switches the power control transistor for permament power and controls the light. When powering off, triggered by the push button, the ATtiny turns off the LED strip (smooth off ramping) and switches off the power control transistor. To replace the 7805 please check you prefered semiconductor vendor. Most got some LDOs for 100-250mA output current while having a quite low quiescent current. I often use the MCP1702 for example. Using a buck converter for 10-20mA doesn't make much sense. The power loss for a linear voltage regulator would be just about 0.14W @ 20mA.