When I set D2 to HIGH, the 3.3V signal from the board is stepped up to 5V and sent to the relay, which switches off (low level relay).
When I set D2 to LOW, the relay switches on, but the integrated LED on the HW-553 is still on (albeit dimmer). This is because when I measure between 5V and GND on the HW-553, I get 3.07V (if I measure between IN+ and IN- I get 0V).
So, I guess that means that the relay is for some reason backfeeding 3.07V between the "IN" port and GND on the relay when it's switched on.
Is this expected or have I messed up somewhere?
btw. the board can switch the relay on and off without any problems, so it isn't really a problem for me, but I still wanted to know if this is normal
btw btw. the psu doesn't have an AC ground connection, but i guess that's not an issue...
Both
It's expected and you have messed up. Doing it that way, you will eventually burn out your D1 mini or at least the D2 output.
Are you using a relay module?
If yes, which one?
You may not need any aditional hardware depending on the module?
As @jim-p says remove the HW-553 and connect D2 directly to Din on the relay ( all gnd tied together ).
If you have that relay (with only 1 transistor, and no optocouplers ) you don't need anything else
Hi, thanks, it looks like it works. One more question -- when the HW-553 was connected, what was the problem? High current draw from GPIO that would eventually burn out the board?
Yes, and/or stability problems with the DCDC converter failing to start up in the first place due to its input being severely current limited. During startup a converter like this looks nearly like a dead short to GND from the perspective of the power input (in your case a GPIO).
I just found out that your suggested fix only works when the relay is also powered by the board's 3.3V pin. When I power the relay with 5V from the PSU, I can't control it with 3.3V on the IN terminal. Grounds are connected together.
Is it a problem? It's a 5V only relay (but it works on 3.3V too for some reason).
Don't power the relay from the D1 mini 3.3V, it may damage the D1 mini.
Then something is wrong. Are you sure ALL the grounds are connected, 5V power supply, D1 mini and relay.
Both the D1 and the relay are connected to the same PSU ground, continuity tested. If I connect the IN pin directly to GPIO and relay 5V and GND to PSU, it doesn't work.
I checked, and there is 3.3V coming from the GPIO. The relay is on all the time, which means it's not detecting a signal.