1
\$\begingroup\$

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;

  1. Detect when a guest presses the buzzer using a GPIO PIN on the ESP32
  2. 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.

  1. Intercom diagram showing the internals of the Bitron AN0002 and how things are wired. diagrams
  2. The other is my first attempt at drawing a circuit diagram (go easy on me) to interface the ESP32 to the intercom. enter image description here

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.

  1. 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?
  2. 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.
  3. 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.
  4. Thank you, I have made the correction to R and C
  5. 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.

enter image description here



Updated diagram, as Peter pointed out I have the relay the wrong way round, doh! enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ If the buzzer is a magnetic device, why not use a Hall effect device to detect it being on. Or a simple coil placed over it (protect the esp from -ve levels). The relay circuit seems to be wrong; I would have expected the gpio to drive the coil via a transistor, and the NO switch contacts to then close shorting out the lock release. I am not an engineer. \$\endgroup\$
    – meuh
    Commented Jul 31, 2021 at 12:57
  • \$\begingroup\$ Thenk you for your suggestion of using a Hall effect sensor. I would like to keep my circuit physically separate from the existing intercom handset. With regards to the relay circuit, I thought my circuit was already doing as you described. I am powering the relay from the 3.3 voltage source and then controlling the state of the relay using a NPN transistor. By default it will be normally open, when I set GPIO 5 HIGH then the relay will close which will drop the voltage to the lock and open the door. (I notice I may have the relay connected to the normally closed contacts) - I will update \$\endgroup\$
    – Jason
    Commented Jul 31, 2021 at 19:08
  • 1
    \$\begingroup\$ @Jason - I see you have tried to reply to an answer within an update to the question. That is generally not done here. FYI you would respond to points given in an answer, by writing a comment below that answer responding to those points. Otherwise the answer-writer might never see your reply (in the question), as they might be looking for your response only as comments below their answer. If you do update something in the question due to a point raised in an answer, it's typical to include in your comment on that answer e.g. "please see my update in the question". I hope that's useful. \$\endgroup\$
    – SamGibson
    Commented Jul 31, 2021 at 20:58

1 Answer 1

0
\$\begingroup\$

Errors:

  1. Opto 24V zener will never see 24V as the LED limits this voltage. There will also be zero output only for half wave rectification.
  2. Opto out IO4 needs a pullup R to gaurantee Vol for some worst case CTR and some Iin. Choose an Rc > 20x Rin or use worst case calculations.
  3. AC input is single ended and ACReturn is not shown with AC bridge inputs shorted
  4. On ESP avoid using large caps on signal inputs so that intermittent power on or grounding Vin does not cause ESD diodes (5 mA max) to short between signal input and power input caps. Change R to 1M and C to <=0.1uF
  5. Lock Release has AC return missing but also should go thru contacts and Q be driving the coil to Gnd with + side to Vdd.
\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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