Таксофон
status In progress. I’m still working on this, but wanted to document the progress so far.
My brother came home with a payphone. It’s an AMT-69, a Soviet model out of Kazakhstan, brought over by a friend of his who used to live there. Steel body, enamel finish, rotary dial. Everything you’d imagine a late-60s Soviet payphone would look like.
He asked me how hard it would be to fix it up so he could install it at the bar he owns in Minnesota, The Black Hart of St. Paul. The idea was to put some electronics inside and turn it into an amusement, a curiosity. Put a coin in, dial a number, hear something you weren’t expecting.
The mistake I made first
The coin mechanism was the main problem, and I spent the first few days solving the wrong version of it.
The phone was built for kopecks. We wanted it to take quarters, which are bigger. My first instinct was to modify the existing mechanism to accept the larger coin, so I started sketching metal parts and figuring out which original components I could shim or alter without destroying them.
After a few days I realized I was asking the wrong question. The original mechanism exists to satisfy an electromechanical telephone exchange. It handled billing and signaling to a central office. That infrastructure is gone, so none of those functions matter anymore. Strip all that away and the phone only needs to report three things:
- A coin went in
- The handset is up or down
- The numbers being dialed
Once I wrote the requirement down that way, it stopped being a restoration problem. I wasn’t modifying the old mechanism. I was building a new one that only had to do one job.
If at first you don’t succeed…
It took six printed versions before the coin path worked.
The hard part is measurement. You put calipers on a sixty-year-old steel casting, transfer the numbers into 3D modeling software, and then have to hold a fraction of a millimeter on a part that drops into a space you can’t redesign. Every version was close, but close wasn’t good enough here. A coin either falls through the path cleanly or it hangs up, and the difference is smaller than the error you introduce moving a physical object into 3D space.
The loop was: measure, print, doesn’t fit. Measure again, find where I was half a millimeter off, print again, doesn’t fit for a different reason. The sixth version worked. Coin in, coin through, switch clicks, coin lands in the bucket. I stood there feeding the same quarter through over and over just to watch it happen.
I also had to file down the coin slot on the face of the phone, since it’s cut for a kopeck and a quarter won’t physically fit. So there’s now a hand-filed slot on the front of a Soviet payphone. Call it vandalism or call it restoration, but nobody was going to feed it kopecks in Saint Paul.
How the Pi reads the dial
This is my favorite part of the build. A rotary dial has no electronics in it. There’s nothing to interface with.
What it has is a spring and a cam. You pull the finger hole around to a number and let go. The spring drags the dial back, and on the return, a cam taps a switch open and shut once per number. Dial a 3 and the switch clicks three times. Dial a 7, seven clicks. Dial 0 and it clicks ten times, which is why 0 sits at the end of the dial instead of the start.
So the Pi just counts pulses on a wire. The dial switch goes to GPIO17. The Pi holds that line high with an internal pull-up, and every time the switch breaks the connection, an interrupt fires. The handler increments a counter and records the timestamp.
Two details make the counting reliable.
Debounce. A mechanical switch chatters for a few milliseconds on each click, so a naive counter reads one physical click as several. Any edge within 5ms of the last one gets ignored.
The gap. The Pi has no way to know when a digit ends. The pulses in a 7 are identical to the pulses in a 3 followed by a 4. Same wire, same switch, same seven clicks. The only difference is timing. Pulses within a digit arrive at about ten per second, because that’s how fast the spring returns the dial. Between digits there’s a pause while your finger travels back. So the rule is a timeout: once 250ms passes with no new clicks, whatever’s been counted is the digit.
Seven pulses is a 7. Ten or more is a 0. Digits stack into a buffer, and when the buffer matches the length of a target number, the code compares them. A match plays the recording. A miss plays an error tone and resets.
The other two pins work the same way with less arithmetic. GPIO22 is the hook switch, up or down, nothing to count. GPIO23 is the coin switch, where one click equals one quarter.
That’s the whole system: count electrical pulses, and use a pause to decide where one digit ends and the next begins. It’s the same logic a telephone exchange ran in 1950, except that took a room full of relays and this is about forty lines of Python.
The brain
A Raspberry Pi Zero, on a mounting plate I printed to fit the cavity the original electronics left behind.
Audio goes out through a MAX98357, an I2S class-D amplifier, and into the original handset earpiece. That choice matters. The voice comes through a 1969 receiver with all the bandwidth limits and coloration that implies. A clean modern speaker would have been easier to install and would have sounded worse for this. The narrow, boxy handset sound is the effect.
I printed a coin bucket too, since the coins have to land somewhere.
photo pending · Pi Zero and MAX98357 on the printed mounting plate
What it does
You pick up the handset, put in a quarter, and dial a number. Someone talks to you. The recordings are messages from celebrities and notable people, each behind a number you have to know, guess, or hear about from someone else at the bar. The only interface is the dial and word of mouth.
The coins go to a local charity. That was the plan from the first sketch, and it’s why the coin mechanism had to actually work instead of just clicking convincingly. If the coin slot were fake, the donation would be too.
What I’m still chewing on
The idea I keep coming back to: letting people leave messages. Dial a number, hear a tone, record something, and it sits there for whoever dials that number next.
That’s a very different machine from the one I’m building now. It turns a jukebox into a place where strangers talk to each other across time, unsupervised, in a bar. It might be the best idea I’ve had this year, or a moderation problem with a rotary dial attached. Probably both. I’m not deciding until the first version is on the wall and I’ve watched people use it.
Next
Finalize the wiring and troubleshoot a few mechanical issues so the rotary dial is solid and reliable. After that, it ships from my studio workshop in Texas back up to Minnesota to go on the wall at the bar.