EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: pstimpel on February 01, 2021, 10:01:08 pm

Title: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 01, 2021, 10:01:08 pm
Good evening.

I want to trigger an input of an Arduino or ESP. The Arduino is driven by a wallplug transforming 230VAC to 5VDC. The doorbell is driven by one of those 230V to 8V AC transformers. Both transformers do isolate the 230V completely, turning the circuits behind the transformers into floating ones.

Now, my idea was to use a rectifier on the 8 VAC from the doorbell, and run either a relay or an optocoupler by it. This way the doorbell circuit and the Arduino circuit are isolated as well from each other.

1.) Is this the right idea?

2.) Does this work this way, or do I have to connect the rectified "ground" and the Arduino ground to each other?

3.) Is this approach by isolating both circuits from each other needed, or overkill?


I would love if we skip the safety discussion if possible, I am not going to touch any of the 230V parts, of course. And I do not see any safety issues with this idea. If there is one, I would like to learn more about it.

I am not a beginner in DC stuff, but never had to use AC stuff in my projects so far, except for running transformers to get DC of course. So why I put that into Beginners? I am one in terms of using low Voltage AC.

Oh, and while we are at it: is it safe to use an DSO in the low voltage AC parts of this circuits?

Thanks a lot

Peter
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Alti on February 01, 2021, 10:16:05 pm
If that is a doorbell then I assume you won't press the bell thousands of times per day.
For not so frequent ON/OFF cycles a relay is the way to go. 1e4 - 1e6.
If you want to ring jingle-bells 24/7 then I suggest to drive primary of transformer with triac / optotriac.
Or secondary with just triac on II and III quadrant.



Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 01, 2021, 10:25:22 pm
I dont wanna drive the doorbell from the Arduino, just to catch the signal when someone rings it. Did I get your answer the wrong way?
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: tunk on February 01, 2021, 10:58:03 pm
Would it be possible to use a microphone module connected to the arduino?
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 01, 2021, 11:02:37 pm
Would it be possible to use a microphone module connected to the arduino?

Crazy idea, but would love not to go that way, if possible
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: themadhippy on February 01, 2021, 11:57:05 pm
More crazy ideas,either wrap a coil around one of the wires going to  the bell push an use the induced voltage to trigger the ardunio,or if its a bell or other type of mechanial sounder  use the hammer to bell dome as switch contacts.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: alsetalokin4017 on February 02, 2021, 12:34:32 am
I dont wanna drive the doorbell from the Arduino, just to catch the signal when someone rings it. Did I get your answer the wrong way?

If I may....
You could connect the coil of the relay in parallel with the ringer of the doorbell circuit, and use the closing of the contacts to signal to the Arduino. I presume you know how to do that with the Arduino.
So you need a small AC relay with a low voltage coil and at least one set of normally open contacts. Or normally closed, either way, just change a variable in the Arduino sketch.

Quote
Oh, and while we are at it: is it safe to use an DSO in the low voltage AC parts of this circuits?

If you have to ask... probably not.   :-BROKE
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 02, 2021, 07:57:32 am
Quote
Oh, and while we are at it: is it safe to use an DSO in the low voltage AC parts of this circuits?

If you have to ask... probably not.   :-BROKE

Hm ... there so many different opinions out there ... others said you can do that safely. That's confusing. Really.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Zero999 on February 02, 2021, 09:24:48 am
Just add an opto-coupler, in parallel with the doorbell coil. When the doorbell rings, it will pulse the Ardunio's input at the mains frequency. D1 protects the opto-coupler's input from reverse votlage. It might not be needed, or could be replaced with an LED, which will double as an indicator to aid debugging.
(https://www.eevblog.com/forum/beginners/8vac-driven-doorbell-and-an-arduino-how-to-connect-to-each-other/?action=dlattach;attach=1163748;image)
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: richard.cs on February 02, 2021, 10:02:47 am
Just add an opto-coupler, in parallel with the doorbell coil. When the doorbell rings, it will pulse the Ardunio's input at the mains frequency. D1 protects the opto-coupler's input from reverse votlage. It might not be needed, or could be replaced with an LED, which will double as an indicator to aid debugging.
(https://www.eevblog.com/forum/beginners/8vac-driven-doorbell-and-an-arduino-how-to-connect-to-each-other/?action=dlattach;attach=1163748;image)

This is pretty optimal. AC input optocouplers also exist, containing two antiparallel LEDs which would remove the need for D1 and double the output pulse rate.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 02, 2021, 10:26:30 am
Just add an opto-coupler, in parallel with the doorbell coil. When the doorbell rings, it will pulse the Ardunio's input at the mains frequency. D1 protects the opto-coupler's input from reverse votlage. It might not be needed, or could be replaced with an LED, which will double as an indicator to aid debugging.


Yes, something like that I had in mind. Btw, did not know I would have to protect the opto coupler by such a diode. You learn something new every day.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: nightfire on February 02, 2021, 10:40:02 am
Basically I would use an industrial relay used for exactly this purpose: Coupling.

Main difficulty could be to find one that is rated for 8V, because the usual voltages here are 12V/24V (DC or AC).
Below 12V it is mostly DC for coil voltage.

But there are special installation relay available:
https://www.eltako.com/fileadmin/downloads/de/datenblatt/Datenblatt_R12-100-_200-_110-_020-.pdf (https://www.eltako.com/fileadmin/downloads/de/datenblatt/Datenblatt_R12-100-_200-_110-_020-.pdf)
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Ian.M on February 02, 2021, 10:52:01 am
Quote
Oh, and while we are at it: is it safe to use an DSO in the low voltage AC parts of this circuits?

If you have to ask... probably not.   :-BROKE
Specifically, when the bell is ringing, if its a regular electro-mechanical bell, when its contacts open, or the button contacts open, and break its coil current, there will be very large transients which may well exceed the input voltage rating of your scope.   
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Zero999 on February 02, 2021, 11:00:47 pm
Basically I would use an industrial relay used for exactly this purpose: Coupling.

Main difficulty could be to find one that is rated for 8V, because the usual voltages here are 12V/24V (DC or AC).
Below 12V it is mostly DC for coil voltage.

But there are special installation relay available:
https://www.eltako.com/fileadmin/downloads/de/datenblatt/Datenblatt_R12-100-_200-_110-_020-.pdf (https://www.eltako.com/fileadmin/downloads/de/datenblatt/Datenblatt_R12-100-_200-_110-_020-.pdf)

Yes, a relay would work, the problem is the voltage rating. A 12V relay with a Schottky bridge rectifier and smoothing capacitor would be the most reliable option.

Just add an opto-coupler, in parallel with the doorbell coil. When the doorbell rings, it will pulse the Ardunio's input at the mains frequency. D1 protects the opto-coupler's input from reverse votlage. It might not be needed, or could be replaced with an LED, which will double as an indicator to aid debugging.


Yes, something like that I had in mind. Btw, did not know I would have to protect the opto coupler by such a diode. You learn something new every day.
The data sheet gives an absolute maximum reverse voltage of 6V. In real life it will probably be fine with out it, as infrared diodes can safely avalanche over, without being destroyed, but diodes are cheap, so it covers that possibility. It could go in series, but parallel is better, as the voltage spike from the bell could exceed the maximum reverse voltage rating of the 1N4148, which is only 100V

The values of R1 and R2 are selected assuming assuming a current transfer ratio of 50%, the worst case for the PC817. The peak voltage of 8VAC is 11.3V take the forward voltage drop of the IR diode, which is about 1.2V, gives just over 10V, and a forward current of 1mA, with R1 = 10k and R2 = 10k is 500µA on the output. Even if the current transfer ratio is a bit under 50%, it'll be fine,a s the Arduino will probably trigger around 2.5V.
https://www.farnell.com/datasheets/73758.pdf (https://www.farnell.com/datasheets/73758.pdf)

Another possibility is to put the opto-coupler in parallel with the doorbell switch. The operation will be reversed, or you could swap the positions of R2 and the phototransisor, so R2 goes to +5V, to make it non-inverting. The tiny 1mA draw won't activate the bell. The main disadvantage with this is it will shorten the life of the optocoupler.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Terry Bites on February 03, 2021, 03:57:11 pm
https://cpc.farnell.com/unbranded/mchrs4fh-s-dc12v-c/relay-pcb-spco-12vdc/dp/SW03277?st=relay
You will have to de-bounce the input to your device.[attachimg=1]
note that 8v (RMS) is 12v peak so a 12v relay will be fine.
If you relay is to buzzy add a bigger cap.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: pstimpel on February 03, 2021, 04:43:08 pm
Thanks a lot, guys. Appreciate your help and input.
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Zero999 on February 03, 2021, 08:14:05 pm
https://cpc.farnell.com/unbranded/mchrs4fh-s-dc12v-c/relay-pcb-spco-12vdc/dp/SW03277?st=relay
You will have to de-bounce the input to your device. (Attachment Link)
note that 8v (RMS) is 12v peak so a 12v relay will be fine.
If you relay is to buzzy add a bigger cap.
I don't see why you'd need any extra hardware for debouncing, which can be done in software.

You don't need a capacitor, if bridge rectifier is used, preferably Shottky. Relays have a huge hysteresis band. The release voltage is typically under a tenth of the must operate voltage. The data sheet linked below for small relay gives 75% of the voltage rating, for the must operate voltage, but only 5% of the voltage rating for the release voltage, giving 9V and 0.6V for the 12V version. What's more important though is the coil current, rather than voltage. In the simulation attached, the relay current remains above the minimum for it to stay closed, 9mA, way above the 2.1mA, (5% of the 41.7mA rating), even though the voltage across it falls below zero, because its inductance keeps the current flowing through the bridge rectifier diodes. It will be better in real life, since the inductance increases to 740mH, when it closes, which I didn't bother modelling.
https://omronfs.omron.com/en_US/ecb/products/pdf/en-g5v2.pdf
Title: Re: 8VAC driven doorbell, and an Arduino - how to connect to each other
Post by: Terry Bites on February 04, 2021, 05:41:15 pm
hardware or software, debounce any way you like.