By the end of part 4 of this series, the Tiny Telco prototype:

  • Could make phones ring.
  • Could generate tones.
  • Could detect DTMF touch tones.

If I had enough breadboards, I could have done all of this with 4 phones at once. But, there’s a pretty important thing missing from that list: I hadn’t actually connected a call yet. I was avoiding that part.

The reason I was punting the “actually placing a call” thing is simple: filtering circuits. Each phone line needs two active filters: one for the “audio in” path that routes to a tone generator, and one for the “audio out” path that routes to the DTMF decoder. Fully breadboarding those circuits would have been a nightmare, so I jumped straight to custom PCBs:

Photo of several blue circuit boards sitting on a desk. In the background are some small plastic containers containing electronic parts.

Top-down picture of the filter PCB, fully assembled.

These boards include many improvements over the breadboard prototype. The breadboarded circuits didn’t include any biasing, which meant signals going to the CD4066 switches had to be level-shifted from 0-5 Volts, to -5-5 Volts. These boards introduce a biasing high-pass filter on the “audio out” side, thereby allowing me to power the 4066 switches from 0-5 Volt power, eliminating the level-shifting shenanigans from the previous post.

Here’s the “audio out” filter:

Schematic showing the “audio out” side of the filter board.

I’ll work from right to left. At the far right side of the above schematic, we have the SimpleSLIC’s audio output line, feeding to a 20k resistor to ground. Combined with the 100 nF capacitor on the SimpleSLIC itself, that makes a basic RC high-pass filter. Technically its cutoff frequency is 80 Hz, but you should really just think of this as cutting out any residual DC bias.

After that is a 100 ohm resistor feeding into an opposed pair of 2.4V Zener diodes. I lifted this straight from Gadget Reboot’s SLIM board design. It suppresses any transient spikes that could appear on the audio line.

After the suppression and bias removal, I have a Sallen-Key low pass filter with a 7.2 kHz cutoff frequency. Typical telephone audio frequency is only in the 300-3300 Hz range, so this sounds a bit odd. Remember, though, that this is a second-order filter, so that cutoff frequency represents -6 dB of attenuation, not -3 dB. This filter hits -3 dB at about 4500 Hz.

The Sallen-Key filter feeds into a biasing circuit, which pulls the signal up by a couple volts while cutting off low frequency junk, while also cleaning up any low-frequency noise below about 230 Hz. There’s also another Zener diode, just to make sure no negative voltages escape the biasing circuit.

The filtered, biased audio signal feeds into two CD4066 switches. One attaches the signal to the “Originate” rail when the “Attach Originate” line goes high, and the other attaches the signal to the “Receive” rail when the “Attach Receive” line goes high. Pretty straightforward.

The filter on the “audio in” side is much simpler:

Note the lack of high-pass filters and biasing circuitry. In theory, this circuit should only every receive signals that were already cleaned up, so the filtering circuitry doesn’t need to be as sophisticated (foreshadowing). The SimpleSLIC’s audio input already has a series 100nF capacitor that should remove any DC bias with nothing more than the KS0835’s own kinda-crummy input impedance, theoretically (FORESHADOWING).

Note, however, that the 4066 switches are doing something a little odd on the “audio in” side. When the “Attach Originate” line goes high, the switches attach the audio input filter to… the “Receive” rail, and vice versa. Here’s a diagram that should help explain why I’m doing that:

I was quite proud of these boards. They’re very dense (by through-hole standards), and the result is really tidy packaging. A SimpleSLIC stacks on top of it like so:

Here’s the problem… they don’t work.

Many, many mistakes were made. It took me roughly 3 hours to figure out everything that was wrong, but several dumb errors got in my way before I could properly debug the circuit.

Before placing an order for the parts I’d need to assemble the filter boards, I noticed that I had a ton of chip sockets sitting around. I thought to myself “oh, I must have a few 14-pin sockets, guess I don’t need to order any.” Turns out, none of them were 14-pin sockets. So, lacking the socket I needed for the CD4066, I decided to just solder it directly into the first board I assembled. I then proceeded to fry that CD4066 by accidentally shorting out one of its switches.

The very same day, I stopped by my local surplus shop (American Science and Surplus), and lo and behold, they had a bunch of 14-pin sockets. If I had waited a few hours to get the parts I needed, I wouldn’t have needed to do surgery on a circuit board.

And then I ran out of solder, so I had to go get that. I was also waiting on my new function generator to arrive, since I needed it to diagnose the complete signal path and my old function generator was atrocious.

Two Weeks Later…

Alright, I have solder again. I cut the fried 4066 out of the circuit, and attached some bodge wires to the test points shown in the schematic above. That allowed me to wire the board into a healthy 4066 on a breadboard, so I could fiddle.

Remember how I figured the internal impedance of the KS0835F would be sufficient to filter out any DC bias alongside the series 100nF capacitor on the SimpleSLIC? Nope. The audio-in side of the circuit is passing the DC bias all the way into the SLIC, creating horrendous distortions.

I also noticed some other distortions on the audio output. It wasn’t noise, per se, but if I pushed a sine wave through the full chain of filters + switches, it came out looking… lumpy, but only if the amplitude was pretty high. If I removed the “receive-side” 4066 switches from the circuit, the lumpyness went away. I suspect that this is an artifact of leakage current through the switches, something like this:

Illustration of leakage current paths through the CD4066 switching circuit.

Some digging online indicated that 4066 switches could be leaking enough current to cause a problem, even though I don’t have equipment precise enough to measure it. Separating the switches from each other with some 100 ohm resistors got rid of the lumpy distortions for good.

There are other problems, too. I got a little lazy with the polygon fills. I kept the polygon that feeds 5 Volts to the SimpleSLIC separated from the rest of the circuit, but I didn’t separate the ground polygons. For testing purposes, this isn’t a big deal. It’s not good form, though.

I also don’t have any 10uF caps that fit in the footprint I used for C8 and C9. The diameter is fine, but all my 10uF caps are just a hair too tall. The photos at the top of this post show 2.2uF caps installed where the 10uF caps should be. I could bend the pins on some 10uF caps to make them fit, but then C9 would have to be bent at a weird angle to avoid overlapping the footprint for an optional ringing status LED, D4.

Improved Filters

The changes aren’t terribly demanding:

Note the addition of 100 ohm resistors ahead of the 4066 switches. There’s also a new high pass filter on the input side, which removes any residual DC bias before the signal makes it to the SimpleSLIC’s audio input. With these changes bodged onto a couple of the filter boards, I can now connect the Originate and Receive rails of two boards together, plug phones into the SLICs, talk into one phone, and hear myself talking through the other phone! Success!

The bodge job isn’t pretty, but hey, it works.

…sort of. There’s audible noise on the audio lines that seems to come from several different sources. Occasionally, some 60 Hz line noise appears:

There’s also some junk in the 76 kHz range, probably an artifact of the ICL7660 voltage converter and the crappy switch-mode power supply I’m using to test the prototype:

But then, there’s stuff that’s harder to explain. There’s a ringing noise whose frequency varies audibly, but seems to sit at around 1700 Hz:

Yikes. I can’t honestly say I know what’s going on here. It could still be leakage current, but I doubt it. Replacing the 100 ohm resistors with 1k resistors only makes it harder to hear the person talking into the other phone, and the hissing noises remain.

If I move the breadboard back and forth on the table, I can hear shuffling noises through the phone. I have a hunch that the remaining noise problems have less to do with my circuit than the cheap breadboard and switch-mode power supply.

Life Things

It took much longer to get this post out than I wanted. I was shooting for mid-October, and now it’s mid-November. Life got in the way, and it’s going to keep getting in the way for a while. I accepted a new job that will require me to move to California next month, and I’m currently scrambling to get everything in order. I also suspect that this new job is going to take up a lot more of my time than my old job, which means I won’t have as much time to work on this project.

This project isn’t going away, though. It’s too much fun to work on. At this point, I need to…

  • Design the updated filter boards.
  • Find a good, +5V / -5V linear power supply.
  • Design board(s) for the DTMF decoder, tone generator filter, ringer, and Arduino.

That’s a pretty good list, and none of it requires my workbench.