I'm a software guy who doesn't know much about the hardware side of things, so I'm looking for some guidance on a project. I live in an apartment that has an ancient intercom / door buzzer and I'm trying to make it a bit smarter.
The in-unit piece is a Pacific Electronics 3406 6-wire unit (see here for a clear shot of the PCB). This connects down to a TekTone PK-543 in the basement which is where all the wires hook up. The PK-543 also amplifies the audio from what I've been able to gather, but I've not been able to find much information about how the TekTone PK-543 works internally. All of the documents I've found just indicate how to wire it up, and very few of what I've found covers the 6-wire model at all. The only picture for the 6-wire I've been able to find is also attached, although it's wired up to an AF-1000 (which, from what I gather has basically been replaced by the PK-543).
Here's how it works from a workflow perspective:
First, a person outside the building presses the button for my apartment. This comes through the "SIG" line (which is only to my apartment - all the other wires are common to all apartments), which runs through the speaker, and plays a "warble" sounds through the speaker.
Next, I press the Listen button to hear the person at the front. This connects "T" to the speaker and I hear them talking. If I talk they can't hear me.
Next, I press Talk to speak back to them (using the speaker itself as a microphone). This connects the "PT" line to "-" and "T" to the speaker. In this mode I can still hear them talking and they can hear me. I presume that "PT" somehow indicates to the amplifier unit in the basement that it needs to stop blocking the audio out from my unit.
Lastly, I press Door to buzz them in, which connects "D" to "-" and buzzes the door.
I've done research and come across a bunch of similar projects, however, they're almost exclusively focused on buzzing the door which is trivially done by using a relay to connect "D" and "-". I'd like to do more than that. Ultimately, the goal is for me to be able to buzz in deliveries when I'm not at home, but also be able to listen and talk (with the Arduino effectively receiving/sending PCM) so I'm not blindly buzzing people in. I can handle the Arduino software side of things and I know that I need an ADC/DAC. The thing I'm struggling with is how to wire things up, specifically around what voltages are involved and all of that to ensure I don't fry the Arduino or vice versa.
A few questions:
Putting a multimeter between "D" and "-" I read between 11-12V DC that is fairly constant (if I switch to AC it fluctuates wildly from like 0.2V to 1.0V). Same reading for "PT" to "-". In most of the projects I've seen people have used SPDT relays for connecting those. From what I've gathered those are "safer" because things are truly isolated, but can I use a MOSFET or something else to switch those? The relays are kind of large and I'd like to avoid them if possible, especially since it seems like they're more generally useful for switching like 120V AC rather than 12V.
I found a layout for a relay circuit that claims to detect the buzz here. Can some please explain like I'm five what that circuit is doing? He also claims the buzzer is 24V pulsed DC, but I don't see 24V anywhere, not even across SIG and C. Would I need to tweak that if it's 12V or something else?
The multimeter reads a fairly constant 18mV DC across "T" and "C" and if I switch it to AC it fluctuates wildly from like 0.5V to around 5V. If I press the Talk or Listen button and do the same, it looks like the DC fluctuates down to 0 and the "center" of the AC fluctuation drops as well, but I don't really see anything that correlates with loud sounds. It just looks random. I know the ADC/DAC on whichever Arduino I go with will have voltage limits, but how do I know what range they should be in? Is it 18mV? What's up with both the AC and DC component? Do I need to isolate the Arduino from the signal?
Can someone explain how things are working when Talk is pressed and the speaker in my unit (45ohm, 0.5W) is acting as both a speaker and a microphone? How would that work with me wiring it up to the ADC and DAC?
As you can see, I'm ignorant to how the electrical side of things works, which is frustrating because the software side of this looks super fun, so I'm hoping to learn a lot and get some guidance from the community. Thank you!
That's wonderful. It turns out that I am the landlord since I own the place and I'm on the board of the co-op. Would still love to hear any advice and insight you have past that though, if you have any to offer!
I'm a software guy who doesn't know much about the hardware side of things
You are asking for help on what is a fairly difficult project with lots of scope for errors and mistakes and misunderstandings. The questions you ask reinforce what you admit; that you don't know much about hardware. I doubt anyone can help much when you know so little about electronics. You need to start simple and get a simple project working, learn the basics of electronics always with your eye on this project when you know enough.
I appreciate that and as you acknowledge I admitted as much. A simple description of what I'm missing in each of my questions (or just generally) would be helpful as part of me educating myself. Even if I don't end up actually building this, simply being pointed in the right direction to understand how the intercom works in the first place, so that I could try things out on a smaller scale, is appreciated, and how one learns! Just as a simple example, I'm curious where I might go read up to learn how the speaker functions simultaneously as both a speaker and a microphone. What is likely happening on the PK-543 when I connect PT and "-" that makes that work? What does it mean that I'm measuring both DC and AC over the T line for audio? Learning how the system works as a whole and building a mental model for that is perhaps more important to me than actually building anything in the first place.
Sorry, I cannot answer your questions. To begin to answer them I would need a thorough understanding of the circuit which I neither have not want to acquire. You need the skills to find the answers yourself, which starts with learning basic electronics and applying what you learn to the circuit.
I know this is not the answer you want but it is my most helpful answer. Maybe someone else will give you answers, but I can't, sorry.
Thing is, hacking an existing device is actually a very advanced electronics project, especially when the schematics are not available - that's reverse engineering which in some ways is harder than engineering. When you build something yourself, you can control the complexity and limit the components to what you have documentation for. Also you own the liability for any damage. That is a better way to begin learning.
You have said that if you are talking to the person wanting to enter, you can also hear him/her talking at the same time. That simultaneous 2 way conversation using a single audio element (loud speaker) would be difficult to implement. Can you verify your statement?
I guess the use of the listen button is optional. You could simply press the talk button and it would cancel the door ring tone and open the audio channel. From the circuit picture, it looks like the talk button also closes the listen button circuit.
If I understand you correctly, you want to extend the the apartment unit to a cell phone or something similar. I guess it would be possible to initiate a call to a cell phone on detecting the door ring tone, and relay the audio channel, via a cell phone module. You’d also have to interpret keypad presses on the cellphone and relay these to apartment unit. Any Arduino that you used would not be processing audio signals, it would simply be switching audio channels (with a relay or an equivalent switching circuit), so there would be no role for a dac or adc as far as I see.
To detect the door ring, I’d probably use a opto coupler based circuit, but would first check what the signal looked like with an oscilloscope.
In general, using relays to duplicate the function of push to make switches is the easiest approach, because you don’t have to understand too much of the circuit you are connecting to.
However, the whole project is not trivial and the main issues to solve, as I see it, are (1) identifying the door ring tone, (2) conditioning the audio signals so these are compatible with a cell phone module, that is designing an audio gateway between the two systems (probably isolated with say a 600 Ohm audio transformer) (3) interpreting the cell phone keypad (DTMF tones) to duplicate the functions of the buttons on the apartment unit (listen, push to talk, open) and (4) joining it all up.
Thank you, @6v6gt. I will check later today on my claim about the two way communication, as I may be wrong. I was basing that off the fact that when you press "Talk" the speaker makes sounds, but I think it may just be white noise rather than being open to the front door's mic.
I don't actually intend to hook this up to a cell phone directly. Instead, I'd like to use the ADC to pick up the audio and stream that 8-bit 8khz as PCM over USB. I'd then like to read from USB a similar 8-bit 8khz PCM stream and send that over the DAC back into the audio circuit. The USB would be connected to a more powerful device that was doing something with the audio (i.e. ultimately talking to my phone via Bluetooth or Wifi or the cell network via Twilio, etc). I'd like to decouple the physical interface from the smarts, with the Arduino doing all of the former, it connecting via USB to a Pi or something else, and that having all of the logic and connections to the external world.
The company that makes the intercom used to sell a relay circuit for detecting the door "buzz" that was intended to power a strobe light or something like that. It's been discontinued, but was sold here with a brief description here.
So, going back to your description of the parts:
Identifying door ring tone - I think the above article addresses that bit
Conditioning the audio signals - I don't need to make them compatible with a cell phone directly - I just want to know how to hook them up to the ADC and DAC so that I can send them somewhere and do something with them. To me, this seems the core problem to be solved.
I don't need to deal with the DTMF tones. Something "else" will ultimately send a control packet over USB to the Arduino to instruct it what to do, and it'll interface GPIOs to the relays to mimic the physical button pushes. My original question about MOSFETs was really to understand if there were alternatives to relays since they're rather large and from what I gather the relays are "slower" to switch. This matters less for the door button since you push it once, but you could be pushing Talk on/off as part of the conversation and the click of the relay could be annoying.
Joining it all up - Yes! I'd like to start small and do each piece in isolation before having everything all hooked up together.
Your suggestion was to use an opto-coupler for the ring detection. Please correct me if I'm wrong, but the circuit I linked above is doing that differently -- instead it's using the capacitor to "flatten" out the 1khz pulsed 24V DC of the buzzer (my unit is 12V) and then turn the relay either on or off to close the detection circuit on the other side. But would an optocoupler into the ADC be an approach that works for the audio itself?
mthz:
I don't actually intend to hook this up to a cell phone directly. Instead, I'd like to use the ADC to pick up the audio and stream that 8-bit 8khz as PCM over USB.
On what board? The USB on a typical Arduino only supports serial communications, not streaming.
I took a rather simple view as to how I would extend the whole thing "wirelessly" with a cell phone. There are surely many other, even more technically interesting, solutions.
The solution with a relay and capacitor may well work to identify the ring tone. I would not suggest such a thing as a general solution, unless it is perfectly clear that the audio signal had enough power to keep a relay energised. A 5volt relay will have a coil resistance of 70 Ohms, which is quite heavy. However, you are in a good position to test it with your setup.
If a relay can be driven, an opto coupler surely can. It would be good, however, to see the signal shape. important is that it accurately identifies the ring tone, but is not triggered during normal speech. An opto coupler is not ideal for analog speech. Isolation is, however, important and for this I'd attempt to use a 1:1 audio transformer (600 Ohms)
I'm not sure about using an Arduino as a digital signal processor, especially an 8 bit one. But try to find some examples. I had some success using an ESP8266 (32 bit) in a speaking clock project, though.
6v6gt: You were correct. I tested this afternoon and when "Talk" is pressed you cannot hear someone talking at the front door, so the audio really is unidirectional.
aarg: Serial communication actually works fine in this scenario. Given the use case, telephone-quality 8-bit 8khz audio is sufficient. This is only 64,000 bits per second so it would work if the serial is set to 115,200. That said, I'd actually planned to do this using generic/raw HID over USB which supports 64-byte packets in a single report at 1khz. At its simplest, the ADC writes into a ring buffer, you queue up 8 samples for 1ms of audio and send that 8-byte packet in a single HID report. Alternatively, you could queue up 64 such samples for 8ms of audio and send that in a full 64-byte HID report. I just don't really know what the interrupt latency is like since I haven't played around yet to determine which approach is better. Either way - I was looking at a board with the SAM D21 since it has both an ADC and DAC and USB support. The MKR1000 stood out since it also has WiFi if I want to send it out directly that way rather than over USB.
It sounds like you are attempting to integrate your door intercom, as an end point, in some sort of VOIP system. Anyway, an interesting but ambitious project. If I understand the use case correctly though, the most practical device I see for the remote user to access it, would still be a smartphone/cellphone.
6v6gt: Agreed! But I'd like to decouple how the audio (and control commands) gets to/from me and the physical interface between the Arduino and the intercom itself. So long as I can pull PCM from the intercom, and send PCM back into the intercom, the software side doesn't really matter...
If the board has Bluetooth, I can send/receive the audio over Bluetooth and let my phone decide what to do with it.
If the board has WiFi, I can send/receive the audio over local UDP/TCP multicast and let any device on my local network decide what to do with it.
If the board has WiFi, I can send/receive the audio over UDP/TCP to some specific endpoint on the Internet and let it decide what to do with it.
If the board has 3G/4G/LTE/etc, I can send/receive the audio over the cellular network and let my phone decide what to do with it.
If the board has USB or serial, I can send/receive the audio over that and let the other end (which may be another small device, or my laptop, or a desktop, etc) acts as a proxy for one of the above.
I've comfortable with all of that, as figuring out how to do things like the above is what I've done professionally for over 20 years.
So although VoIP is an option, it's actually not what I'm aiming for. In all of those scenarios there are far simpler paths to getting unidirectional 8-bit, 8khz PCM from the Arduino to my phone or another device without having to touch either VoIP or SIP.
The challenge for me, instead, is learning how to (a) electrically isolate the audio in/out from the intercom and the Arduino and (b) determining the voltage range that both the ADC and DAC should operate in for everything to work correctly. Your suggestion to get more data here was a good one since the multimeter I have is insufficient for the task, so I'm going to buy an oscilloscope so that I have a better idea of the system.