0
\$\begingroup\$

I hooked up a Nodemcu module to my 8 channel relay.

enter image description here

The relay.

Excuse the horrible drawing, I didnt find the module in Fritzing. The jumper present in the image is of course not connected in my setup.

Edit and here is a link providing information why I am hesitant to connect the nodemcu GND to the relay: https://forum.arduino.cc/index.php?topic=440327.0

With the Channels switched on, the relay makes a sound, some kind of soft cracking maybe (continuously). I do not mean the clicking sound when the channels are switched on. If I connect my Arduino Uno clone or my Raspberry Pi in the same manner, the sound is not there.

The relay module is active low.

So, I'm new to electronics, I figured there has to be some distortion. I read about bypass capacitors.

I would put a 1 µF capacitor (or so, I would need to find out what a suitable value may be) where the blue C denotes it, between GND of the MCU and its VCC.

enter image description here

Could this be a correct approach? I'm kind of unsure because the noise would be on the GND rail, not the VCC.

Any other ideas what may cause this behaviour?

Edit

Here are the measurements suggested by Tony Stewart. EE since '75

+-----+--------+--------+---------+
| PIN |   DC   |   AC   | CURRENT |
+-----+--------+--------+---------+
| D1  | 1.1 mV | 0.01 V | -       |
| D5  | 1.1 mV | 0.01 V | 0.03 mA |
| VCC | 3.29 V | 0.04 V | 0.01 mA |
+-----+--------+--------+---------+

Measurements taken directly from the nodemcu, no relay connected, states set to ON, so the Pins should be low.

Measurement again, with Relay connected, noise was present.

+-----+-----------------+-----------+----------+
| Pin |       DC        |    AC     | Current  |
+-----+-----------------+-----------+----------+
| D1  | -3.4 to 0.09 mV | 8.8-9.3 V | -0.05 mA |
+-----+-----------------+-----------+----------+

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Your pictures are too small to figure out the circuit of the relay board. Do you have any other information on it (schematic, pinouts, specifications)? How is the Nodemcu module powered, and where does the 5V power come from? "I would put a 1 µF capacitor..." - why would you do that? \$\endgroup\$ – Bruce Abbott Feb 20 '18 at 1:17
  • \$\begingroup\$ A bypass capacitor shouldn't be needed for a relay module that's constantly on or off (but it won't hurt). Bypass capacitors are mainly used for fast-switching circuits. \$\endgroup\$ – immibis Feb 20 '18 at 2:32
  • 1
    \$\begingroup\$ make sure 0V Gnd are well connected between boards. Can you check logic and supply levels (DMM) when noisy. It is supposed to take 15~20mA on 3.3 to 5V logic. Check both DC and AC for noise. Then try grounding it just in case CM noise from loose wires is getting stray noise. Twist power and ground and keep wires short or twisted with 0V. \$\endgroup\$ – Sunnyskyguy EE75 Feb 20 '18 at 4:37
  • \$\begingroup\$ @Bruce Abbott I added the product link, there you find higher res pictures. The nodemcu was powered by USB port of computer and by a 4.5 V power supply (I think from a mobile phone). I just had the USB cable routed to where I work, didn't check where it came from (cable management under the table). It's the same I used for the rpi / Arduino. The 5V also come from a 5V 2.5A power supply (no idea what for, had to cut the cable). I first suspected the USB port wouldn't be beefy enough, that's why I went for the external supply. The capacitor was intended as a bypass capacitor. \$\endgroup\$ – idkfa Feb 20 '18 at 6:18
  • \$\begingroup\$ @TonyStewart.EEsince'75 "then try grounding it" What do you mean by that? Ground what? I'm using DuPont jumper cables for connection. Maybe 10-15cm long. Your second part of the comment means I just twist VCC and ground? GND of the nodemcu is unconnected. And I would assume that the 5V supply isn't at fault because it works for the rpi/Arduino without problems. But I can twist the cables of that supply. Will need to check with a DMM tonight. \$\endgroup\$ – idkfa Feb 20 '18 at 6:23
2
\$\begingroup\$

The problem with some sites and sellers is they dont give you the schematic to understand what's inside. you have many options to share opto power with transistor or separate but both MUST SHARE GND with uC. The input diode drop protects from -ve input V reversal errors but also reduces voltage drop on R1 from 5V to ~ 3.3V so that 3.3 or 5V logic or open cct will turn OFF and 0V input ( ~<1V) will turn Relay ON using any isolated or shared 5V and gnd. It is the current thru R1 that controls U1 and Q1 and hence K1.

Reason for confusion *supplier schematic error

There is 2 levels of isolation between logic input and relay contacts but I have joined pin2-3 to reduce isolation to 1. But you can power 5V from another isolated supply then the gnd symbol on the left (P1) is NOT THE SAME and the Q1 Gnd symbol and they would be isolated. NB!! But if done as I have shown, they must be joined.

But beware of shared grounds inducing ground shift noise and power loops radiating noise pulses turning off so use twisted pairs for power and relay contacts. enter image description here

\$\endgroup\$
  • \$\begingroup\$ Notably, the optocouplers are kind of overkill unless you plan to connect the coil ground to the secondary side of the relays, which isn't common practice. The freewheel diode combined with a sound PCB layout should otherwise be sufficient to prevent noise and EMF. \$\endgroup\$ – Lundin Feb 21 '18 at 16:16
  • \$\begingroup\$ Thanks for the answer! This kind of clears up the isolation issue. Would you mind explaining some of the abbreviations used? NB, uC etc. And I actually connected all GNDs to the external power supplies GND which didn't solve the problem. So I need to try again with twisted pairs? Either I'm not understanding what the answer is or the problem is not solveabale with the input so far. I'm really scratching my head here. \$\endgroup\$ – idkfa Feb 25 '18 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.