NodeMCU w/Relay

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

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.

fmeroney:
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.

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.