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:
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 ) that's correct so far, how do I determine the values for the components?
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.
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?
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.
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.
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
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.