logo elektroda
logo elektroda
X
logo elektroda

Detection of 12V relay status via GPIO - I am looking for a method without using the D1 mechanism

faber 1095 13
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19014759
    faber
    Level 24  
    With this arrangement (only the relay will be on 12V and not 5V):
    Detection of 12V relay status via GPIO - I am looking for a method without using the D1 mechanism .
    I am looking for the best way to detect if the relay is switched on. I don't want to do this through the D1 relay switching mechanism because the relay can also be switched on by another circuit (not ESP). How on another GPIO can I detect if the relay is switched on ?
  • ADVERTISEMENT
  • #2 19014772
    khoam
    Level 42  
    faber wrote:
    How on another GPIO can I detect if the relay is switched on ?
    .
    Any that can act as an input on the ESP8266 or ESP32.
    For ESP8266: Link .
    The question remains as to from which point you want to retrieve information about the fact that the relay is switched on.
  • ADVERTISEMENT
  • #3 19014779
    jozgo
    Level 42  
    faber wrote:
    I am looking for the best way to detect if the relay is switched on.
    .
    Its contacts are from signalling this state.
    I don't understand the question.
    In contactors there are auxiliary contacts for this, and here every contact not used for switching the circuit in question.
  • #4 19014785
    bumble
    Level 40  
    It has to be from the contacts to be sure it has switched on.
  • ADVERTISEMENT
  • #5 19014810
    faber
    Level 24  
    Hm... well, there is 230V on the contacts. And isn't there some way to e.g. detect the 12V flow of the relay coil ?
  • #6 19014816
    khoam
    Level 42  
    faber wrote:
    As there is no way to e.g. detect the 12V flow of the relay coil ?
    .
    This will 100% not mean that the contacts have switched on or off.
  • #7 19014824
    faber
    Level 24  
    jozgo wrote:
    faber wrote:
    I am looking for the best way to detect if the relay is switched on.
    .
    Its contacts are from signalling this state.
    I don't understand the question.
    In contactors there are auxiliary contacts for this, and here every contact is not used for switching a circuit.

    the point is that I plan to plug in another circuit where the relay has no other auxiliary contacts.
  • #8 19014825
    jozgo
    Level 42  
    faber wrote:
    Hm.... well there is 230V on the contacts
    .
    After all, not on all of them.
    A relay is an electromechanical apparatus.
    It is also a mechanism. The only certain information about its switching is the state of the contacts. It means that the jumper has been tightened to the core.

    Added after 4 [minutes]: .

    faber wrote:
    Hm.... well there is 230V on the contacts
    .
    Well that's right. And if it is switched on there will be zero on the switched contact. Do you have the information?
  • #9 19014857
    faber
    Level 24  
    khoam wrote:
    faber wrote:
    As there is no way to e.g. detect the 12V flow of the relay coil ?
    .
    This will 100% not mean that the contacts have switched on or off.
    .
    And would it be possible to do so after all ? :) i.e. this monitoring of the state of the relay is not sensitive, just by the way of changes I wanted to know, but it is not a function on which something will depend, just monitoring, I would not like to simply interfere with the 230V circuit
  • ADVERTISEMENT
  • Helpful post
    #10 19014862
    jozgo
    Level 42  
    faber wrote:
    As it would be possible after all ?
    .
    Collector voltage. If it is close to zero, i.e. the full voltage of 12 V is on the coil of the relay.
    With a circuit with e.g. a zener diode and a resistor you can lower it to e.g. 5 V.
    It will be a negative signal.
  • #11 19014867
    khoam
    Level 42  
    jozgo wrote:
    By a circuit with e.g. a zener diode and a resistor you can lower it to e.g. 5V.
    .
    Specifically to 3V3, as this is the ESP.
  • #12 19014920
    jozgo
    Level 42  
    For separation, you can insert an optocoupler.
  • #13 19015042
    krzysiek_krm
    Level 40  
    faber wrote:
    no at the contacts is 230V
    .
    It is possible to detect this voltage (230V), for example with a brazenly copied mains zero detection circuit.
  • #14 19019675
    krzbor
    Level 27  
    If no separation is needed (i.e. we have a common ground) then it is best to connect the cathode of the diode to the collector, a 10k resistor to the anode and the other end of the resistor to supply the ESP (3.3V). To the anode we connect the free I/O. The signal will be in negation.

Topic summary

The discussion revolves around detecting the status of a 12V relay using GPIO without relying on the D1 relay switching mechanism, as the relay may be activated by other circuits. Participants suggest various methods for monitoring the relay's state, emphasizing the importance of using the relay's contacts for accurate detection. Suggestions include using a zener diode and resistor to lower the voltage to 3.3V for the ESP, and employing an optocoupler for isolation. The conversation also touches on the challenges of working with high voltage (230V) circuits and the need for safe monitoring solutions.
Summary generated by the language model.
ADVERTISEMENT