- Fri Jan 19, 2018 4:55 am
#73282
Actually this question would be better suited on an electronics specific board. Having said that, I think you're pretty good underway, already you did some research, it just needs a bit of fine-tuning.
lingyueqing wrote:I decided on mosfets after having read rants against the commonly used TIP120s,
There is nothing wrong with TIP120's, I've been using them for years and years, driven from all sorts of microcontrollers. It's just that if you step up to higher power requirements (think > 1 A) they waste some energy and need to be cooled properly. You need to have quite a bit of (power) led strips to get there.
MOSFET's are suited for very high currents, but you need to pick the right one. For small currents/voltages it doesn't matter that much though, if you go higher on them, study the "safe operating area".
MOSFET's have the disadvantage they need to be driven properly. As in: make sure they switch between wide open and fully closed and make the transition fast. There are a few problems here:
- the transition between off and on can be made fast, but it always takes "some" time, so if you increase the (pwm) frequency, it will go through the "grey" area more often and so it will generate more heat. So keep that in mind when picking the PWM frequency (if applicable).
- as the gate of the MOSFET is very high impedance, it will get charged when voltage is applied. This charge won't disappear by itself. So unless you use a "totem pole" or push-pull output, the MOSFET will go on and "never" go off again.
- this also means the driving output will need to charge and discharge the gate, this can go quickly, but it needs to be taken care of (think of mostly nanosecond, but it may be as large as milliseconds in some cases).
- the quicker you're charging and decharging the gate, the more power you need to do so
but for my application do I need to worry about the difference between standard mosfets and logic level mosfets?
Yes you do. Most MOSFET are "wide only" only from 8V on the gate or even higher. If you want to connect MOSFETS directly to the ESP8266, you NEED to use logic level MOSFET's. And even then they won't be maximally efficient.
The ESP8266 does have push-pull outputs and actually they can sink/source a decent amount of current (30 mA) so they're able to drive a logic-level MOSFET directly.
Still I propose you take another route, which will take all "MOSFET worries" away and which wich always make the MOSFET work optimally, even if they're not logic-level (not even recommeded to use these then).
Have a look here:
https://www.infineon.com/cms/en/product ... ic/ir4427/It's called a gate driver. There are more variants of them, from different manufacturers, but this one is easily to come by and also nicely priced. What they do (in short) is to create an interface that's very easily driven (TTL input with Schmitt trigger, look like you're connecting a base from a bipolar transistor with a very high gain, no worries there) to the gate of the MOSFET, where it makes sure, with some built-in MOSFET's, that the gate is charged and discharged at maximum speed. You see it can sink and source about 3.5 A for that purpose, much much more that your average GPIO output. Connect the Vcc to your 12 V and your MOSFET's will get driven at 12 V, which is perfect for most of them.
My LED Strip needs 12v, and the breakout board has a voltage regulator on board that takes in 4-6v. This means that I either hook up the strip directly to a 12v supply and find a way to step it down to 5v for the chip, or power the strip directly from 5v and then find a way to step up to 12v for the strip. Which way would you recommend? I assume stepping down is easier.
My BoB's don't have voltage regulators so I do it this way:
- I have a laptop power supply (because it can deliver a lot of power at a decent efficiency) and connect "everything" to it, lots of ESP's, LED spots, etc.
- that means step down from 19 V.
- for the first part, from 19 V to 5 V, I am using a DC/DC buck converter, they're very efficient and can supply a lot of power (mostly 3A or even 5A). They can be bought from "china" for about $ 1.50 a piece.
- for the second part, from 5 V to 3.3 V I use a low-drop linear regulator, to smooth out any noise from the switching mechanism of the buck converter.
In your case you could leave out the last step and use the internal regulator.
And with the chip drawing up to 500mA and the strip up to 1A,
As I understood it, the LED strip is powered with 12 V so don't needs to be regulated? For 500 mA, over 5 V to 3.3V, a simple lineair regulator will do.
would a buck converter like the LM2596 work?
Yes it will, buy a BoB with one on them for ease, or with one of the cheaper alternatives from XL semi.
Only thing that's stopping me is I've heard that due to the switching nature of buck converters they introduce a lot of noise and input voltage ripples to devices sharing the power supply. Do I need to worry about this if they're both connected to a 12v power supply and in the same enclosure?
The LED strips won't care anyway. If you worried about noise in the output (towards the ESP8266), add a lineair regulator in the output (as explained). I can recommend LM3940, it's specifically designed for this purpose.
Are you going to use PWM? Many implementations are really bad, but you'll know shortly
The ESP8266 doesn't have a hardware PWM module.