logo elektroda
logo elektroda
X
logo elektroda

How do I connect an intercom bell (9v) to Sonoff Basic for OpenHab?

zoch 1026 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18120945
    zoch
    Level 10  
    Hello !
    I am not familiar with electronics :-) .
    Can I connect the bell from the intercom ( 9v ) to as a sensor ( instead of a reed switch ) to the Sonoff Basic - directly or via some relay ( what kind ? ) . I wanted to "receive" the ringing in OpenHab
    Thank you for your help

    Jacek
  • ADVERTISEMENT
  • #2 18128575
    kaczakat
    Level 34  
    You can use an optocoupler, see the schematic of a popular relay for Arduino with optoisolation, just reverse the action, the part with the led you connect to the bell, add a resistor to limit the current, if it is alternating add a diode, the part on the other side you connect to the pin set up with a pullup resistor, output to GND. When there is a high state on the pin, that means there is no 9V voltage from the other side. Of course you are using the optocoupler itself from this relay circuit, the whole thing is not needed, I just gave it as an example of how to isolate these circuits from each other.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #4 18134178
    kaczakat
    Level 34  
    The relay coil is already a clear power draw for a uC, and you don't need that, it's supposed to be detecting a signal rather than sneaking current from the circuit. As there is some electronics in there you can even damage by switching the relay on and off.
    Just the right question to Google and you have examples. E.g. "Arduino input optocoupler":
    How do I connect an intercom bell (9v) to Sonoff Basic for OpenHab? .
    According to this schematic, if you apply 9V to S1 through resistor R1 1k a current of about ~9mA will flow through led D1, which will open Q1 and on Vo the voltage will drop from 3.3V to about 0.5V (logic state change from 1 to 0). R2 you can take ~0.5k. You can handle the whole circuit with code just like a button shorted to GND. The cost of materials is less than a zloty. Choose the resistors so that the opening is certain (catalogue of the chip) and the current is as low as possible, maybe even R1 2-3k is enough.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 18135019
    zoch
    Level 10  
    Thank you for your help. I'm not very proficient, so I'd rather have something ready to go. The bell is on 24 volts
ADVERTISEMENT