logo elektroda
logo elektroda
X
logo elektroda

NodeMCU and relay: D5 and D7 do not light the diode, despite correct voltage

Surrenis 624 8
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19604263
    Surrenis
    Level 8  
    Please help me identify the cause of the diode not lighting up after reproducing the first schematic on the actual board.

    On the programming side, this is simply raising the state on the general purpose outputs (D5 and D7).

    I have not been able to find a better relay in the visualization software, so let's assume that column number 25 on the board is Normally Open (NO), 26 is COM, 30 is Normally Closed (NC) and 31 is the coil.

    With the second diagram (using COM and NC) the diode lights up, and this only indicates that current is flowing through the (off) relay.

    I measured the voltage between D5 and GND with a multimeter and it is, as would be expected, 3.3V. When measuring the current, the multimeter displays 0.75 (when LOW) and 1 (when HIGH).

    Excerpt from the relay specification. I don't know what is important, so I am inserting selected information:
    * Nominal coil voltage 3V DC.
    * Coil resistance 17Ω
    * Coil power consumption 530mW.
    * Coil current 176.5mA

    This is the LMR2-3D Recoy/RAYEX ELECTRONICS relay, such:
    https://www.tme.eu/pl/details/lmr2-3d/przekaz...ktromagn-miniaturowe/recoy-rayex-electronics/

    I'm wondering if the NodeMCU is too weak to turn on this relay, or maybe it's another simple beginner's error. The NodeMCU is powered via USB from the computer.

    NodeMCU and relay: D5 and D7 do not light the diode, despite correct voltage .
  • ADVERTISEMENT
  • Helpful post
    #2 19604289
    khoam
    Level 42  
    Surrenis wrote:
    Coil current 176.5mA
    .
    Definitely too high this current to control the relay directly from the ESP (12mA is allowed for the ESP8266).
    The relay should be controlled e.g. by a MOSFET transistor (illustrative diagram):

    NodeMCU and relay: D5 and D7 do not light the diode, despite correct voltage .
  • ADVERTISEMENT
  • Helpful post
    #3 19604293
    NIXIE_123
    Level 34  
    Surrenis wrote:
    NodeMCU is not too weak
    .
    You still need to give a transistor. The gpio port is only for small currents
  • ADVERTISEMENT
  • #5 19605124
    khoam
    Level 42  
    Surrenis wrote:
    Is such a transistor OK (when choosing I was only guided by the fact that the Gate Threshold Voltage should contain 3.3V; this one has <2V, 4V>) ?
    .
    And how will this copy have V GS(TH) > 3.3V? :) Besides, this is a power mosfet, a bit too "big" for such a circuit.
    A "popular" BS170 ( nota ) with max V would suffice. GS(th) = 3V and max current I D = 500mA.
  • #6 19605139
    Surrenis
    Level 8  
    Aaa, I thought that range meant that I could connect the gate to any voltage in that range. So that box there means that they'll send me a unit that will have one value from that range, that it might as well be 2V or 4V or something in between. And the circuit itself is fine, acceptable?
  • #7 19605141
    khoam
    Level 42  
    Surrenis wrote:
    So that box there means that they will send me a copy that will have one value in that range, that it might as well be 2V or 4V or something in between
    .
    Exactly. Technological spread.

    Surrenis wrote:
    And the circuit itself is fine, acceptable?
    .
    And where are the resistors and surge protection diode on the relay coil?
  • ADVERTISEMENT
  • #8 19605161
    krzysiek_krm
    Level 40  
    The Vgsth parameter is generally useless - see what is there in the measurement conditions and how it relates to the desired parameters.
    You need to look for a transistor that has Rdson specified for the voltage you want, for example 3.3 V, 2.5 V here, 1.8 V, etc, etc. Generally, such transistors are rather low-voltage, 30 V, for example.
  • #9 19605186
    khoam
    Level 42  
    @Surrenis Where do you get the voltage to power the relay coil from? It's not clear from the pictures shown.

Topic summary

The discussion revolves around troubleshooting a NodeMCU setup where the relay connected to GPIO pins D5 and D7 does not activate the diode despite correct voltage readings. Users suggest that the current required to control the relay exceeds the allowable output from the ESP8266, which can only handle 12mA. It is recommended to use a MOSFET transistor to control the relay instead. The conversation includes considerations for selecting an appropriate transistor, emphasizing the importance of the gate threshold voltage and the need for additional components like resistors and a surge protection diode for the relay coil. The specifications of the relay, including nominal coil voltage and current requirements, are also discussed.
Summary generated by the language model.
ADVERTISEMENT