Drive esp32 from 20-24v AC and sense rising voltage?

Hi,

I recently moved and realized that we don't have a doorbell chime. What we do have is four wires (red, black, white and yellow). When the doorbell button isn't pressed there is 20v(AC) across red and white. When the button is pressed that voltage rises to 24v.

I think it's possible to both run the esp from that and sense the button being pressed, but I haven't worked with AC yet so I am not sure.

What I have so far:

I think I can use a AC to DC buck converter to get 3.3v DC from the 20-24v AC. I then need "???" to sense when the voltage increases:

Assuming that is correct so far I think I need this circuit to fill in for "???":

I think I need to reduce the voltage (R1) and then use two diodes (D1 and D2) to "rectify" the voltage. I then need a capacitor (C1) to smoothen out the ripples from the sine wave?

R2 and R3 form a voltage divider so that I can feed an optocoupler since it's probably best to isolate the esp from voltage spikes?

If (big if :slight_smile: ) that's correct so far, how do I determine the values for the components?

Any help is greatly appreciated! Thanks!

Where do you find those converters?

I was thinking about this one.

I was thinking of this one

A perfboard, bring out the ol' Weller and solder!

Of course you can get that one as well, it's just that I have no experience from it. And for 99c I probably never will... you never know what quality you get.

Thank you for your help :slight_smile: I admit it brought me out of my comfort zone, but I came up with this:

Is this what you had in mind? The diodes are the ones from your link, as is the capacitor.

Am I reading this right, the "rectifier" increases the voltage?

Something like this (the LM IC is just for illustration only, a buck converter module should be in place):

You would typically use either 1 diode or 4, as in the above configuration. 1 for halfwave rectification, and 4 for full.

At the primary DC side, you use a voltage divider, 100k + 10k or 470k + 47k. Not sure about the impedance of the ESP32, too high resistor values will affect readings.

Sorry, I didn't see this

1 VAC is not the same as 1 VDC. If you multiply AC by 1.41 you get the right voltage. It'll be a bit lower after the capacitors have brought down the ripple and with a load.

You are measuring something wrong. I never heard of a doorbell working that way.
I suspect that two of the wires are for the button and two for power.
You better check before you go any further.
Don't want to cause any fires by mis-connecting
Better safe than sorry

I agree with jim-p. That kind of doorbell circuit is no sense.
Your 20V voltage might be just some voltage coupling from adjacent wiring.
Since you have 4 wires and at least two of them are unidentified, the best option would be to find the transformer and identify wires from there. Then open the button and identify wires from there as well.
Do you have just one button?

Thanks, everybody!

I agree, I likely measured something wrong, I can't find anything about this type of setup on the net. I'll remeasure.

Do you have just one button?
Yes. The casing has space for a second one but as far as I can see there is only one installed.

Maybe you have some prewiring for additional buttons (if you have more than one entrance).


Typical doorbell circuit is dead simple. Measured 24V when button pushed supports that. I expect that 20V is just floating wire or bad button.
You could put a 4k7 resistor across the "20V" wires and measure voltage again.

Ok, so I had a talk with the neighbours and an electrician and I had it all wrong. The cables are for an intercom and a door buzzer. I even found the old intercom in the basement (Siedle HTS 711-01)

It's 20v/24v DC while the buzzer is 12v AC.

My plan is to step down the 20v/24v DC to 5v and use a relay to switch the buzzer.

It'd be great if I could use the ESP to make a voip call to my phone, but I've only found on source doing that. The explanation is kinda limited and I couldn't find the code on the persons github.

If anybody has an idea how to do this please let me know.

Do you mean you want to be able to have a conversation with someone who is at your front door?

Yes. The project I linked to seems to have been able to do that. And that seems like a neat feature.

Extremely difficult to do within the Arduino framework if at all possible. To use the ESP-ADF framework you would need to use the ESP-IDF. Not something that is easy to learn.

Sending an alert to you phone would be easier.

Hmm, too bad. It'd be great to know who is at the door without physically going to the door.
Maybe I can can add a camera at the doorbell :slight_smile:
Thanks for your input!

Jim, modern door bells have an incandescent light in each push button. Current is limited to give a little light so the button can be seen at night. Pushing the button shorts the lamp, removing the resistor and allowing the AC voltage to increase.

I suspect the actual chime unit detect the current change, not a voltage change.

You can buy wifi doorbells with camera and audio.

You could use Esp32-Cam.
But ready made wifi-doorbells are quite inexpensive...