Go Down

Topic: NodeMCU w/Relay (Read 244 times) previous topic - next topic

fmeroney

Mar 09, 2019, 04:14 pm Last Edit: Mar 09, 2019, 04:33 pm by fmeroney
Hey All,
So I'm trying to control a 12v solenoid from my NodeMCU. However I want to approach it the best way. Currently I have it like this.

12v Wall Wart powers the NodeMCU and Valve when Switched. Node is 3.3v so I need to use a 3.3v relay to switch the Solenoid on/off.

Simple as that...

However a good 3.3v relay that doesn't draw a bunch of power is what im in search of.. i have a ton of 5v relays.. Any way to use the 3.3v outputs to power a 5v relay, I suppose a transistor would work or should I just get a 3.3 relay?

FYI Im trying to switch a 12VDC Solonoid, draws approx .5 amps

Thanks

CrossRoads

#1
Mar 09, 2019, 04:35 pm Last Edit: Mar 09, 2019, 04:36 pm by CrossRoads
Use a NPN transistor to sink current thru the relay's coil.
Ever notice the current requirements for coil driven things? The higher the voltage in the coil, the less current it needs.
3.3V will need more than 5, 5 needs more than 12, 12 needs more than 24.

With a separate transistor, you don't have to worry about the microcontrollers meager IO current capability trying to control a coil.

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.

wvmarle

12v Wall Wart powers the NodeMCU
Get a buck converter for that. 12V is too high - your regulator will overheat very easily. Especially if you try to use the WiFi ability.

Quote
However a good 3.3v relay that doesn't draw a bunch of power is what im in search of.. i have a ton of 5v relays.. Any way to use the 3.3v outputs to power a 5v relay, I suppose a transistor would work or should I just get a 3.3 relay?
Yes, transistor. BJT will do. MOSFET is better, but you have to get one that switches well at 3.3V (like the PMV16XN), but most of those are in SOT23 package. Recently one showed up that's in easier to handle TO220 (don't have the number at hand), I bought a bunch but haven't put them to the test yet.

The NodeMCU pin can deliver no more than 10 mA (absolute max rating 20 mA iirc). Try to stick to that 10 mA number. Or less, of course.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up