I am trying to build a circuit that will interface a ESP32 with my buildings existing analog intercom. Currently I have a standard Bitron AN0002 handset connected to the intercom circuit. The functionality I am looking for is;
- Detect when a guest presses the buzzer using a GPIO PIN on the ESP32
- Open the lock using a GPIO PIN on the ESP32
I am more interested in the components (and alternate / better options) and design of the circuit. Attached are two diagrams.
- Intercom diagram showing the internals of the Bitron AN0002 and how things are wired.
- The other is my first attempt at drawing a circuit diagram (go easy on me) to interface the ESP32 to the intercom.
Buzzer detection
Looking at the intercom diagram, the voltage across "Ground" (6) and "AC Buzzer" (11) is zero, or there abouts when not being pressed. I haven't been able to get accurate readings when the buzzer is pressed. Does anyone have an idea? Possibly 12 - 24 volts AC? I'm then passing this signal through a bridge rectifier and then an optocoupler to ensure the circuits remain isolated. I would then read the buzzer signal on GPIO 4 of the ESP32. Besides not knowing the exact incoming voltage I think this may work. Any suggestions on improvements? Zener diode choice okay? Should I have a cap after the bridge rectifier?
Lock release
Looking at the intercom diagram, the voltage across "Ground" (6) and "Lock Release" (9) is roughly 13.6V AC. The lock release button is in a normally open state.
I have been stumbling over how best to work this (with my limited knowledge), I was looking at using a MOSFET (depletion mode) however I think I would then struggle with keeping the circuits isolated? I was also looking at solid state relays but wasn't sure which type was needed.
Is it maybe best to go with an electromagnetic relay like the JQC3F-03VDC?
What would be your suggestions around controlling this part of the circuit. My obvious requirement is to keep the circuits isolated and power the switch / relay using 3.3v.
Thanks for your help and any suggestions or pointers on simulators or other tools I should be using then please let me know.
Thank you for your response Tony, all very helpful.
- Since I have no control over the intercom circuit, how would I go about protecting the optocoupler from undesired conditions. Is a zener diode not the correct solution in this case, or have I just sized this incorrectly? With regards to the half wave rectification, should I not then be placing a cap after the rectifier to smooth it out? Sizing of the cap?
- It may have been difficult to see in my diagram, but I wrote that the ESP32 has an internal pullup resistor, so this should already be covered.
- My apologise, I am using EasyEDA and found an AC symbol which did not have 2 terminals. I have corrected this in the below updated diagram.
- Thank you, I have made the correction to R and C
- Same mistake in point 3? This should be reflected in the updated diagram.
With all things said, in this scenario is a relay the most effective option to drive the lock release mechanism or are there other components I am missing? I cannot use a MOSFET, right? As this will require a common ground? - Still (always) learning so any pointers are welcome.
Thank you for your time and input.
Updated diagram, as Peter pointed out I have the relay the wrong way round, doh!