Door phone interface and powering it using dc bias?

Thread Starter

perivar

Joined Jul 19, 2020
9
Hi,
This is my very first post on a challenge I have been struggling with for a year. How can I build a extender to my door phone (Brand Fermax) while protecting the inputs on the arduino and avoiding more power sources than necessary ?

This post only care about converting a 24v dc biased audio signal into 0-5v readable by the arduino.

What I have come up with are two options:
1. A simple diode protected opto isolated circuit using 4n35. This will both protect the arduino and enable reading a 0-5v signal but I assume the DC bias will in reality mean the audio signal get very compressed to voltages that only vary between 4 and 5v?

2. Therefore I have considered another circuit which first removes the 24v dc bias, then adds a smaller bias into a opamp that drives the input of the optocoupler. The issue here is that the opamp and audio signal needs a voltage source. And here I try to use the dc bias to power the opamp.
See circuit from EveryCircuit. Note this simulation is emulating input to a optocoupler for everything to the right of the opamp.

Which option is best and what would a better choice be?7D7696D2-9538-4775-AAD9-676ED8B2AD73.png
 

Thread Starter

perivar

Joined Jul 19, 2020
9
I’m unable to edit the post.
Some corrections:
Option 2:
Note! The EveryCircuit simulation is emulating input to an optocoupler. Ignore everything to the right of the led as EveryCircuit doesn’t support optocouplers as default.

Attached image of option 1 as well.641180D9-0AD7-46EB-93DC-70E3B4881A0A.jpeg
 

KeithWalker

Joined Jul 10, 2017
1,147
There is probably a very simple solution but I need to know the following before I can make a suggestion:
What is the amplitude of the audio signal?
How much current can the 24V bias supply?
What do you want the arduino to do when it receives the signal?
Regards,
Keith
 

Thread Starter

perivar

Joined Jul 19, 2020
9
There is probably a very simple solution but I need to know the following before I can make a suggestion:
What is the amplitude of the audio signal?
How much current can the 24V bias supply?
What do you want the arduino to do when it receives the signal?
Regards,
Keith
Thanks Keith! Here are hopefully the answers you asked for:
1. The signal from the door phone seems to be a 24v DC shifted AC signal (audio) with amplitude +/- 5v. Meaning the signal seem to vary from +22 to +27v. The signal is a square wave when the door bell rings and the spoken audio when someone is talking in the outdoor microphone.
2. I have no idea how much current the door phone DC component (in contrast to the AC audio component) can support. I don’t know how I can find out since I don’t have the original schematics. I have only used an handheld oscilloscope to try to find out the signal.
3. I have good control over what I would do when the arduino can read an analog (+/- 5v) signal through the A0 pin. I will in software detect audio over a given volume threshold, which will trigger sending a package of data to a remote arduino over NRF24L01 (Audio and “open door request” signal). The remote arduino has a button which will trigger an “open door“ command, which will be transmitted back and trigger a relay on the arduino connected to the door phone. Everything already works except the interface to the actual door phone.
 

KeithWalker

Joined Jul 10, 2017
1,147
This is all you really need. You may have to change the value of R2 to alter the discharge time of C2.
You can set the voltage threshold on the arduino analog input pin. Any general purpose signal diodes will work. The top one limits the positive input to 5.7V to protect the analog pin.
Regards,
Keith

Drawing1.jpg
 
Last edited:

Thread Starter

perivar

Joined Jul 19, 2020
9
This is all you really need. You may have to change the value of R2 to alter the discharge time of C2.
You can set the voltage threshold on the arduino analog input pin. Any general purpose signal diodes will work. The top one limits the positive input to 5.7V to protect the analog pin.
Regards,
Keith
View attachment 212854
Thanks a lot Keith, it looked like you know your business!
I’m somewhat of an amateur in electronics, but it would help if you could explain the circuit please ?
I understand C1 removes the DC offset and centres the audio signal around zero? But how does this circuit lift the voltage above zero and make sure it is compressed to stay below 5v?

I’m still concerned about the door phone signal “exceeding the spec”. Meaning spikes or voltages way beyond what I described (24v or 5v amplitude). Most similar circuits that I have seen uses an optocoupler to deal with this which tells me that this should be expected. Wouldn’t you recommend that as well? E.g An example for raspberry that is almost what I want

And does your circuit support the full amplitude of the audio signal? Many circuits I have seen just ”cuts” the signal using diodes and uses it as a detector circuit that is connected to a microcontroller. That won’t work for me as I’m looking to forward the full audio signal.

Apologize for all the questions but I would greatly appreciate if you also could look at my original schematic (option 2) and explain why this is a bad idea? Where is my thinking flawed?
 

Thread Starter

perivar

Joined Jul 19, 2020
9
Thanks a lot Keith, it looked like you know your business!
I’m somewhat of an amateur in electronics, but it would help if you could explain the circuit please ?
I understand C1 removes the DC offset and centres the audio signal around zero? But how does this circuit lift the voltage above zero and make sure it is compressed to stay below 5v?

I’m still concerned about the door phone signal “exceeding the spec”. Meaning spikes or voltages way beyond what I described (24v or 5v amplitude). Most similar circuits that I have seen uses an optocoupler to deal with this which tells me that this should be expected. Wouldn’t you recommend that as well? E.g An example for raspberry that is almost what I want

And does your circuit support the full amplitude of the audio signal? Many circuits I have seen just ”cuts” the signal using diodes and uses it as a detector circuit that is connected to a microcontroller. That won’t work for me as I’m looking to forward the full audio signal.

Apologize for all the questions but I would greatly appreciate if you also could look at my original schematic (option 2) and explain why this is a bad idea? Where is my thinking flawed?
Here is a cleaned up schematic.
DB8F5D63-779A-4D3D-9A8A-E1AF020AF1BF.png
 

KeithWalker

Joined Jul 10, 2017
1,147
Why do you need the full audio signal? You said in posting #4 "I will in software detect audio over a given volume threshold, which will trigger sending a package of data to a remote arduino over NRF24L01 (Audio and “open door request” signal). "
Are you planning on using the audio signal for more than that? If not, it is much simpler to use a hardware detect circuit that outputs a DC level proportional to the amplitude of the incoming signal. Then all the arduino has to do is to check if that signal crosses a pre-set threshold on its analog pin.
The circuit I posted is a half wave peak detector circuit with over voltage transient protection. If the amplitude of the incoming AC signal exceeds +5.7 volts, the top diode will clamp it to the 5 volt supply. Similarly, if the signal exceeds -0.7 volts, it will be clamped to ground through the bottom diode.
If you need the full audio signal for other purposes, just take it from the junction of the three diodes and use that.
Regards,
Keith
 
Last edited:

Thread Starter

perivar

Joined Jul 19, 2020
9
Why do you need the full audio signal? You said in posting #4 "I will in software detect audio over a given volume threshold, which will trigger sending a package of data to a remote arduino over NRF24L01 (Audio and “open door request” signal). "
Are you planning on using the audio signal for more than that? If not, it is much simpler to use a hardware detect circuit that outputs a DC level proportional to the amplitude of the incoming signal. Then all the arduino has to do is to check if that signal crosses a pre-set threshold on its analog pin.
The circuit I posted is a half wave peak detector circuit with over voltage transient protection. If the amplitude of the incoming AC signal exceeds +5.7 volts, the top diode will clamp it to the 5 volt supply. Similarly, if the signal exceeds -0.7 volts, it will be clamped to ground through the bottom diode.
If you need the full audio signal for other purposes, just take it from the junction of the three diodes and use that.
Regards,
Keith
I truly appreciate this Keith!
I wasn’t clear in my description. When I wrote that I would like to transmit the open door request and audio, I meant the full audio, so that I can hear what the person at the front door is saying remotely. So my main problem is getting the full audio between 0-5v and possibly use the dc offset to achieve this. So I believe I am not looking for the peak detector circuit, but rather a converter circuit? If I use the audio from the junction of the three diodes, isn’t that just a ac signal centered around zero? How can I convert the full ac signal into 0-5v range, while protecting against spikes and limit the number of external dc power sources? (The latter question is why I have brought up the question about using the DC bias for this).
Thanks in advance!
 

KeithWalker

Joined Jul 10, 2017
1,147
The output of the circuit that I posted is a DC level proportional to the amplitude of the audio signal, 5V pp gives around 2.5 volts DC. You don't need a full 0 - 5 volts on the analog input to detect a threshold level.
The signal available at the junction of the three diodes is the audio signal centered around 0VDC, free from transients. All you have to do is connect that through a capacitor and biasing resistors to a second analog input to digitize the audio, see attached.
Regards,
Keith
Drawing2.jpg
 

Thread Starter

perivar

Joined Jul 19, 2020
9
The output of the circuit that I posted is a DC level proportional to the amplitude of the audio signal, 5V pp gives around 2.5 volts DC. You don't need a full 0 - 5 volts on the analog input to detect a threshold level.
The signal available at the junction of the three diodes is the audio signal centered around 0VDC, free from transients. All you have to do is connect that through a capacitor and biasing resistors to a second analog input to digitize the audio, see attached.
Regards,
Keith
View attachment 212909
This looks like exactly what I need! The only thing that is still worrying me is my previous question about possible spikes?

I’m still concerned about the door phone signal “exceeding the spec”. Meaning spikes or voltages way beyond what I described (24v or 5v amplitude). Most similar circuits that I have seen uses an optocoupler to deal with this which tells me that this should be expected. Wouldn’t you recommend that as well? E.g An example for raspberry that is almost what I want
 

KeithWalker

Joined Jul 10, 2017
1,147
I don't quite understand your concern about interference. The diodes will limit the amplitude of the signal to between +5.7V and -0.7V. How far from the door bell is this circuit going to be? I was assuming that it would be very close, considering that you are going to transmit the information to a more remote location. If it is more than a few feet, use a shielded twisted pair to avoid picking up EMI.
 

Thread Starter

perivar

Joined Jul 19, 2020
9
I don't quite understand your concern about interference. The diodes will limit the amplitude of the signal to between +5.7V and -0.7V. How far from the door bell is this circuit going to be? I was assuming that it would be very close, considering that you are going to transmit the information to a more remote location. If it is more than a few feet, use a shielded twisted pair to avoid picking up EMI.
Thanks!
It’s not interference I was thinking about. Rather the fact that I’m not sure how stable my readings of the signal is over time. I.e. what happens with this circuit if the dc voltage have sudden jumps to 40-50 volts? How does this circuit handle a situation if the audio amplitude jumps to +/- 12v or more?
Since I am an amateur I’m not confident that my readings of the signal will always be within the ranges I gave you. And this coupled with the fact that all the interface schematics to intercoms/door phones I have seen on the internet involve optocouplers. Therefore I wanted to double check with you that you still don’t believe an optocoupler is needed, and that the arduino will not blow up due to voltages above or below what it supports?
If you confirm this I will go ahead and build the circuit you presented.
Thanks a lot!
 

KeithWalker

Joined Jul 10, 2017
1,147
I suggest that you breadboard the circuit I drew up. It's very simple and uses very common components. Test it with a few extreme signals and see what you get at the outputs to the arduino. If you use very high transients, make sure that the diodes and capacitors have a high enough voltage rating. Do you have access to signal sources and a scope? If not, I may be able to suggest alternate ways of testing it to put your doubts to rest.
Before I retired I worked for Hewlett Packard as an electronics engineer and technical consultant. My job entailed designing, building and programming industrial measurement and control systems and automatic test systems for munufacturing customers products.
Regards,
Keith
 

Thread Starter

perivar

Joined Jul 19, 2020
9
I suggest that you breadboard the circuit I drew up. It's very simple and uses very common components. Test it with a few extreme signals and see what you get at the outputs to the arduino. If you use very high transients, make sure that the diodes and capacitors have a high enough voltage rating. Do you have access to signal sources and a scope? If not, I may be able to suggest alternate ways of testing it to put your doubts to rest.
Before I retired I worked for Hewlett Packard as an electronics engineer and technical consultant. My job entailed designing, building and programming industrial measurement and control systems and automatic test systems for munufacturing customers products.
Regards,
Keith
Thanks!
I will make a test setup but will not be able to test with the actual signal since this is in my holiday home and I’m home. I have a cheap usb oscilloscope that also can generate some test signals with dc offset and what I believe is the right audio amplitude so will try with that first. I have never done this before. I’m a software engineer by trade and haven’t done much electronics like this. Appreciate your offer to explain alternative ways to test. What were you thinking?
 

KeithWalker

Joined Jul 10, 2017
1,147
Appreciate your offer to explain alternative ways to test. What were you thinking?
At this time you are really only interested in the protection capabilities of the circuit. Connect any voltage source (wall-wart or batteries) of around 5VDC to the circuit. As a very simple test, bypass the input capacitor C1 and connect a 9V battery across the input. See what voltage appears between the output end of R3 and ground. Reverse the polarity of the battery and measure the output again.
If you have higher voltages available, try them with C1 in circuit. Alternately momentarily touch the input of C1 and then short C1 to ground. See if you can catch any transient signals with the scope on R3. Don't exceed the voltage rating of C1 or you will damage it.
Have fun,
Keith
 
Last edited:
Top