Controlling the SLIC
A powered up AG1171 SLIC can energize a phone, but without some additional components, it can't do much else. The rest of the functions happen by interacting with pins 3, 4, 5, 9, 10 and 14:
- To play un-amplified audio into the phone line from any computer or media player (from a line-out jack for example) connect that signal to Pin 9 of the AG1171 (through a 10nF capacitor as specified in the datasheet) and the AG1171 will handle the amplification and send the audio to the handset. If your only goal is to playback audio, you can stop here.
- To cause the connected phone to ring, you'll need some extra stuff. The AG1171 generates the high voltages needed to ring internally, but you'll need to tell it how frequently the voltage should oscillate by pulsing Pin 3. In the North America, the ringing signal alternates at a rate of 20hz. Other geographies have differing rates, ranging from ~16-60. Therefore you'll need an oscillator, and ideally a variable one.
- You'll also want a way to control the *cadence* of the ring, meaning the duration of the bell ringing and the time between each ring. Additionally, you must enable ring mode by energizing Pin 4.
- If you want to know when the phone is on or off the hook, so you'll need to monitor the hook switch indicator on Pin 5.
- It might be important to know what digits the connected phone is dialing. Rotary phone dialing can be detected on Pin 5, but DTMF tones are different. To catch those, you'll have to monitor the audio coming out of the phone line on Pin 10.
- Finally, grounding Pin 14 allows us to power down the AG1171.
A Microcontroller Match
The Raspberry Pi Pico W is a powerful microconroller with more than enough pins to operate all the features of the AG1171. Even while running less-optimized code such as Circuitpython, the Pico's RP2040 processor is fast enough to do mp3 and wav audio playback, as well as audio capture for monitoring DTMF tones. The "W" version with wifi retails for $6, while the non-wifi version sells for $5.
Why Pi
Almost any microcontroller would work to control the basic functions of the AG1171. Heck, even a 555 timer and a few switches can do it. Here's why I chose the Pico line for this project:
- Local availability. The Pico was already on my desk.
- Supply. The Pico is widely available. (Here in 2023 there is still an ongoing chip shortage, making other systems like the Raspberry Pi 4 expensive or impossible to find)
- Affordability. The Pico eliminates the need for all of the following standalone modules:
- Power supply ($1-5): pico provides a well-regulated 3.3v
- DTMF decoder ($5-10): CPU can handle this instead
- Audio player ($2-20): audio output is available via PWM
- Programmability. The Pico's 2040 processor is popular and widely supported in CircuitPython and other environments, making it easy to code for.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.