So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By czaro05
#91990 NodeMCU. I would like to control two (identical) relays which activate after receiving 3.3V voltage. The relay's control coil has two terminals (let's say R1 and R2). I have some ideas, but also some doubts:

1) Connect R1 to 3V3 (on NodeMCU) and R2 to adjacent GND. The other relay analogically. But how do I control if NodeMCU gives 3.3V (to activate the relay) or 0V (to deactivate the relay)? Maybe I don't understand how NodeMCU's 3V3 pins work.

2) First relay: connect R1 to D1 (on NodeMCU) and R2 to ??. Second relay: connect R1 to D7 and R2 to ??. I have read that some GPIOs may be used to provide 3.3V voltage from NodeMCU to another device. But what about closing the circuit? There are some, already mentioned, grounds - GND but which would close mentioned D1 and which would close mentioned D7?

Could you tell me how should I connect NodeMCU and the relays to be able to control them? I would like to provide power to NodeMCU using USB.
User avatar
By flagtrax
#91993 Most development boards have a usb input for data transfer and power.
The 3.3v pin is simply an output from the on board regulator. So if you put ground on one side of the relay winding and 3.3v on the stays energized as long as you power the board. Control of relays and such is through the GPIO pins. Do be careful not to draw too much current from the GPIO pins. There are many tutorials out there to get you started.