Electronics question - Pretty simple, I think

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

rkhanso

Well-Known Member
Joined
Jan 24, 2017
Messages
774
Reaction score
174
Location
Plymouth, MN - terrible tap water for brewing
Hello,
I'm working on some home automation-type things at home. I had the parts on had for this circuit, so that's why I'm using it.

I have what I think is a simple electronics question.
Following THIS schematic, I'm trying to get an ESP8266 D1 Mini controller to control a strip of 12v LED lights.
I could probably ask the question at the Stack Exchange website, but I don't have an account there and don't really want to.

I used a breadboard to build the circuit. The lights didn't go on/off.

1610405741306.png


When toggling the GPIO output on the D1 Mini, I saw it switch from about 3v3 to 0v.
I did get the voltage of the 10K ohm resistor on the collector to switch between 5v and 0v when toggling the GPIO pin on the D1 Mini. So I got it working that far. I also measured the voltage at the gate of the MOSFET. I could see it also switch from 5v to 0v when toggling the GPIO on the D1 Mini. The lights just stayed on all the time. They never turned off.

I'm pretty sure I had everything wired correctly EXCEPT for a question about the grounds. Do I need to tie them together to get it to work? I didn't because I have 2 different power supplies in play. One power source (Micro USB connector from my PC) going to the D1 Mini. I also have a 12v DC power supply going to the MOSFET and to power the LED strip. I didn't know if connecting the two separate grounds would fry something.

Thanks.
 
You definitely need to connect the ground nodes shown in your diagram back to the host element - in this case your D1 Mini. Otherwise the transistor and FET have no reference voltage, which is definitely necessary: floating nodes don't behave well.

Also, the pullup on the NPN collector/FET gate should be to 12VDC...

Cheers!
 
5V pullup is OK. I'd also tie it to 12V as tripper mentioned, but should work anyway. 5V Vgs on most fets is fine for a LOT of current.

The BJT transistor (2n222) could have been eliminated completely. Not sure why it's there, unless to invert the logic for some reason.
 
I believe the original circuit was for a D1 Mini GPIO 3.3V IO cell. Meanwhile the gate threshold spec ranges up to 4V for the IRFZ44N, so you have to beat that for the fet to be "guaranteed" to work...

Cheers!
 
I guess I threw it in as being similar to running a 40 amp SSR off a Raspberry GPIO pin. Sure, it will probably work. But switching it at 12v is better than 3.3.

The plan on this is to put it the LED strip on the bottom-side lip of the bathroom vanity sink/top so the wife has some ambient light to see her way to the bathroom. At 2am, the regular bright lights are a bit much. I can control the brightness with the Tasmota firmware on the D1 Mini. Set it to come on at after midnight and off at 6am, etc. Anything the Home Assistant software can make it do.
 
Back
Top