I'm testing two 3.3V Relays (with optocoupler) on NodeMCU ESP8266. But it seems that if I connect any Relays to this 3.3v and GND (mark with yellow color on the picture) PIN, the Relays are unable to switch/click (marked with green LED and the sound).
Sometimes the green LED is on, but the switching/clicking sound does not appear. And I tried to connect a 12V CPU FAN to that Relay that is connected to that yellowed PIN. But the FAN is not turned on even though the green LED on Relays is on. I tried to use a 9V battery and adjustable power adapter at 8.5V that is connected to the FAN and Relay but the issue still persists.
The other Relay that is connected to another port on this image is working alright. Is it related to the hardware issue?
I also have a question regarding this second image. Relay that is connected to that PIN (marked with orange color on the wire) sometimes working alright, sometimes it is also having a similar issue. Green LED is turned on but the switching/clicking sound is not heard.
Are you serious powering 5 V relays with 3.3 V? This is not a good idea. In addition, the relays have a relatively high consumption. Once you control a 12 V fan, it is better to put a logic level MOSFET transistor like SI2302 for example.
You should be not powering them through the regulator of the nodeMCU. That has plenty to power with just the board already. If they really are 3.3v relays, you should power the coil from an external 3.3v source.
The image that you used in this Fritzing says 5vdc, but how about an actual picture of what is written on it.
Not sure what the significance of the optocoupler is as you have only three connections.
Clearly, 3.3 V relay modules are the wrong ones to use here since you are no doubt using a 5 V power supply. Correctly wired, 5 V relay modules work perfectly on 3.3 V logic.
Adding a suitable resistor in series with the positive line would make the 3.3 V relays work from your 5 V supply.
So far all I ever tried is powering this NodeMCU board using micro USB cable. Either using direct connection from my Laptop USB port, or using a 5v 1A iphone power adapter. What I thought so far is since this board is powered using micro USB port and VIN PIN which is both working at 5V, and the output PIN is 3.3V, this board will convert the 5V input to 3.3V output. So I can use 3.3V relay on this scenario.
My question:
If I use 5V power source like always from micro USB port, can I power 5V Relays using 3.3v regulator output PIN? and is it safe? since im trying to do it yesterday and I can power 1 3.3V relay using this scenario.
Or can I use this adjustable power adapter, set it to 3V and connect it to VIN PIN? and power 3.3V relay from that?
I always advise against that. With a variable supply, if you bump the dial, you no longer have 3.3 V. You have 5 V - or 6 - or whatever.
The point is that you always need a power supply fixed at the desired voltage so it cannot cause problems. And it needs to be rated for (50% greater than) the current you will need it to supply.
If you have 5 V relay modules, use those, connected to the 5 V supply. Put the 3.3 V ones away in a drawer for when you have a system that actually is powered by a 3.3 V supply and not 5 V. If "Vin" on your NodeMCU connects to the 5 V from the USB - as it appears to be via a Schottky - then you can use that to power the relays.
Still waiting on the picture of the relays though.
I have both 5v relays and 3.3v relays at the moment? you still need the picture?
Apparently the regulators on those kind of boards have almost no heatsink at all. That would make them a problem, not a solution.
you should power the coil from an external 3.3v source.
I thought this "breadboard power supply" is the one kind of external source. If it's not what is your recommendation?
What, the "useless board", AKA "breadboard power supply module"?
@Paul_B what makes this "breadboard power supply module" useless? I thought I can provide external power source to the relays with this. What is the best way to provide external source to the relays then? Im not quite familar with electrical module. Since I just trying this kind of things this month.
would be nice. We want to give the proper advice, and for that we can use any information you can give us.
Depending a little on what kind of relays you have exactly, probably it will be to use 5v relays powered from an external 5v PSU from which you can also power the nodeMCU. Or possibly even to power that all from USB, but for that the power consumption of the whole thing may exceed 500mA which is the maximum a USB port is guaranteed to provide.