Go Down

Topic: LM7805, Nano and PWM LED strip control (Read 146 times) previous topic - next topic

Mauryc

Hello,

I'm working on a controller for sequential stairs lighting. I'm sure You seen something like that, steps lighting up from first step to last then diming down and the same for going down the stairs.
I have the program part figured out and all elements (except LM7805) conected on breadboard but I need it to be more... durable.
So I'm using Arduino Nano; LM7805 to drop down the voltage from 12V to 5V to power the Arduino from LED power supply; TCL5940 to expand my PWM outputs, 16 of STP16NF06L to drive the LED strips (strip connected to +12V andit's GND to the conector driven by transistor) and some minor elements (potentiometers, motion sensores, and simple elements).

I created diagram in Eagle, but I still have some questions and would like to someone with experience to look it over.

So I have following questions:
-I want to power the Nano with LM7805, drop by 7V is big, but after brief search this seems like the simplest/cheapest option. About securing the circuit I can see there is something simillar in : https://forum.arduino.cc/index.php?topic=604879.0, so I'll keep my eye on it, but there is one thing. I'm going to use (on input and output) electrolytic capacitor 200uF and ceramic 100nF (saw it in some tutorial for powering Arduino). However Fesanand says he will use capacitors as the spreadsheet says, and my says 0.33uF on in and something more than 0.1 on out. Why then people are using something different? Is there a way (or rule) on choosing proper capacitance or just trials?
Doc:
https://www.sparkfun.com/datasheets/Components/LM7805.pdf bottom of the 3rd page.

-I'm going to power arduino through +5V pin. Some people say it's dangerous, because  there is no regulator on it, but with protection on previous step it should be fine. Right?

-LED strips are going to be connected to +12V and theirs "-" to transistor to GND. Can and do I need to protect the circuit if someone provides +12V here? Like shortening the wires on LED strip?

-As per moving it from breadboard, like I said I tried Eagle free, but board allowed there is way to small.  I can see on forum that there are alternatives to it, but still, Eagle said it's about 300 connections and I have no idea where to start on placing elements. As the current/signal flows? Big elements with most connections first? Although I suppose there is no easy answer for that.
I'm aiming at prototyping board and making connections myself, but if design would require printing, I can get around that too.

Any other tips appreciated.
Mauryc

DVDdoug

#1
Mar 20, 2019, 08:07 pm Last Edit: Mar 20, 2019, 08:08 pm by DVDdoug
Quote
-I want to power the Nano with LM7805, drop by 7V is big
That's fine since you are only powering the Nano and one other chip.   

Power (directly related to heat) is calculate as Voltage x Current so if you drop 7V at 1 Amp, that's 7 Watts.   Even thought the 7805 is rated for 1.5 Amps (in the TO-220 package) it's probably going to overheat at 7 Watts (especially if there is no heatsink).

Quote
I'm going to use (on input and output) electrolytic capacitor 200uF and ceramic 100nF (saw it in some tutorial for powering Arduino).
The manufacturer's datasheet is almost always the best source.

The capacitors should be mounted physically-close to the leads, and its generally OK to use a larger capacitor.  However, the type  of capacitor is important.   Electrolytic capacitors don't "act like" capacitors at high frequencies.   So to prevent high-frequency oscillations/noise/instability you should use ceramic capacitors, and it's OK to parallel the ceramic with an electrolytic.


Quote
-I'm going to power arduino through +5V pin. Some people say it's dangerous, because  there is no regulator on it, but with protection on previous step it should be fine. Right?
Yes.   Your 7805 should be fine.

Quote
-LED strips are going to be connected to +12V and theirs "-" to transistor to GND. Can and do I need to protect the circuit if someone provides +12V here? Like shortening the wires on LED strip?
You should be OK.  The 12V power won't "leak" backwards through the Gate.   And if the MOSFET blows & shorts out, a properly-designed MOSFET driver will have a resistor in series with the gate and the resistor will limit the current into the 5V circuits.

Quote
-As per moving it from breadboard, like I said I tried Eagle free
Someone else will have to help you with that.  I've only "played around" with Eagle and I haven't completed a board.   I tried KiCad and every step was frustrating.     (I was trying to modify an existing part to make a new part that wasn't in the library.)   It's not "easy" with Eagle either, but I concluded that Eagle is the better option.

Also I'll warn you - I've worked in electronics for a many-many years (not as a PCB designer) and only a couple of times have I seen a board come-out right the 1st time.    Sometimes it can be made to work with cuts & jumpers, but usually it takes one or more revisions to get it right.  So, be mentally (and financially) prepared to scrap the 1st board (or 1st batch of boards).

 

HellasT

The capacitors should be mounted physically-close to the leads, and its generally OK to use a larger capacitor.  However, the type  of capacitor is important.   Electrolytic capacitors don't "act like" capacitors at high frequencies.   So to prevent high-frequency oscillations/noise/instability you should use ceramic capacitors, and it's OK to parallel the ceramic with an electrolytic.

Yes.   Your 7805 should be fine.

I can not agree more !

i think best solution is to use a 10uf electrolytic cap between input and GND in parallel with a 1nf ceramic cap and a 100uf electrolytic cap between output and GND in parallel with a 1nf ceramic cap also.
Every new day we wake up, is a gift from god. Enjoy it, don't waste it and never forget to thank him for that.

Mauryc

Thanks for the quick answers!

For the heat sink on 7805 I thought it would be needed, I'll go through my stuff and propably do some empyrical test with thermometer and assumptions that it's colder on the outside.

As for the program, I think if I knew the restriction on the board dimentions and that I'll have to create TCL5940 in it (library was not working for some reason) I would try something different. Also I heard that Scetch exported from Eagle can be imported only in Eagle, yay. I have found a site to convert eagle's .sch to something different, but it's not working.

I'm hoping that first board will work but I'm not betting on it. Although with the breadboard...it's good tip to twist the pins on the transistors, so they wouldn't bend the prongs in the breadbord and cause another elements, like PWM led driver, to have loose connections and sometimes randomly dimming, switching on led strips.
Many, many hours of trouble shooting could be spared by doing this.

@HellasT, are the values of the capacitors coming from experience? I mean, for this configuration, this may be standard, but if that would be 7809, would the values be different? I suppose that other devices drawing power from that 12V will influence this.
I have an access to handheld osciloscope, so could I just probe the out of the regulator with eg. pc fan on input, swap the capacitors and look at what's going on with the 5V or the changes would be to small to notice?

HellasT

#4
Mar 25, 2019, 04:39 pm Last Edit: Mar 25, 2019, 04:41 pm by HellasT
@HellasT, are the values of the capacitors coming from experience?
Yes but also yu can find diagrams that use the exact same values.

@HellasT, this may be standard, but if that would be 7809, would the values be different? I suppose that other devices drawing power from that 12V will influence this.
For an 7809 it would be the same. Also i dont think that other devices powered by the 12V will affect the 7805.
Every new day we wake up, is a gift from god. Enjoy it, don't waste it and never forget to thank him for that.

herbschwarz

Hi All,
It looks like you have the 10K FET gate resistors connected
to +12V. That is very bad: they should be connected gate to
ground.
Herb

Mauryc

Hi herbschwarz,

I based that on some other project, and if I connect gate to ground, transistor will be always opened to full.
The way this works is +12V via resistor provides high, so there is no flow through transistor.
Then on TCL5940 I start cranking up PWM signal (open drain), so voltage on gate drops, and it starts letting voltage through (and so let strip is brightning up).

Maybe on diagram it's not cleat what kind of transistor it is, doc's here:
https://nettigo.pl/attachments/117
I put it together as a prototype and it works, the only MOSFET that died did so because of mishandling...

However I'm considering providing voltage to gate from 5V not 12v which may be better for them, but will put a little more strain on LM7805, I'll have to do some measurements.

Thanks for input though!

As for the Eagle, I come to conclusion I will just divide my project into parts: supply; nano-TCL5940; output; put that on separate boards to figure out connections there, and then put them together somewhere else.
And I have to say autoroute feature of Eagle is suprisingly good. Gave me some ideas how to connect it all together.

Go Up