Dial A For Arduino

A lot of phrases surrounding phones don’t make sense anymore. With a modern cellphone, you don’t really “hang up” and there’s certainly no “dial” to be had. However, with [jakeofalltrades’] project, you can read an old-fashioned phone dial using an Arduino.

The idea behind a phone dial is actually pretty simple. When you pull the dial back to the stop using one of the numbered holes and release it, it causes a switch to open and close the same number of times as the hole you selected. That is, if you pull back the 5 hole, you should get 5 switch closures. The duration of each switch event and the time between switch events is a function of the speed the dial moves because of its internal spring. The zero hole actually produces ten pulses.

There are standards for how precise the timing has to be, but — honestly — it’s pretty loose since these were not made to be read by precise microcontroller timers. In the United States, for example, the dial was supposed to produce between 9.5 and 10.5 pulses per second, but the equipment on the other end would tolerate anything from 8 to 11.

Even if you don’t want a rotary dial in your next project, the code has some good examples of using ATmega328 timers that you might find useful in another context. However, a dial would add a nice retro touch to any numeric input you might happen to need.

If you need project inspiration, how about a volume control? Or, why not a numeric keypad?

19 thoughts on “Dial A For Arduino

    1. CooI! At the turn of the millennium, I used a rotary dial on a Win98SE PC to operate Winamp through a plug-in that someone wrote. I wired it to a COM port, without the need for a 555, PIC16F84, let alone an ATMega328! šŸ˜

    2. My college roommate and I had a cheap-ass plastic touch-tone phone on which all but the top row of buttons was broken. We discovered that by quickly tapping the hook we could simulate pulse dialing and actually make calls. But if you spazzed in the middle of hammering out 10 reasonably-timed pulses…. you had to start over.

      Any number ending in 0 was damned annoying.

      1. I used to dial with the receiver hook from my dorm room in college (c. 1977) just for laughs. A dorm mate who used to work in a phone CO told me that he always knew when some numbnut was dialing with the phone hook because it made the mechanical switches hack and grind. I thought that was funny as hell so I dialed with the phone hook all the time after that.

        I’ve grown up a bit since then.

    3. “Was pretty fun to use.”

      Nope. I’m calling BS here.

      It sounds fun. If you haven’t done it for a long time. We had rotary and pulse when I was a young kid. Years later I was in college, most of us had cellphones but also had not yet given up our old landlines. I found an old rotary phone in a thrift shop and thought it would be fun to have it in my apartment’s livingroom.

      I and my roomates all thought it was pretty cool up until we each used it once. Once was enough, no one used it twice. Even just dialing a 7-digit local number just seemed to drag on and on. It was like you could feel yourself aging just waiting to finish the dial.

      Still cool as a conversation piece. But not fun to actually use. Not fun at all!

  1. It’s so much simpler to use a Schmidt trigger to “debounce” the pulses, but denouncing in software is easy enough. Back in 1977, I worked at Vendo, and they used stepper switches as a “money” counter (“accumulator”) to count in 5cent increments via a coin validator. One of the reasons they hired me (and others) was to try to get things converted to microprocessors. But the management was reluctant and slow to accept micros and micros weren’t cheap then and required mask ROMs and a production run of something like 1K or more micros (essentially, a whole wafer, which back then was about 3 inches in diameter or maybe a bit less).

    1. I worked with mask-ROM microcontrollers in the early 90’s. I don’t recall what the minimum purchase was, but it cost $7000 to create the mask. So you better have you code right by that time.

      But by then we have EPROM versions of microcontrollers, and the non-window OTP versions we programmed ourselves for production. We used a mask-rom only for the highest volume products.

  2. A rotary dial phone as a kitchen timer is a nice beginner project – you just need an Arduino and a dual relay… The only issue I had was that the ringing was rather quiet, as I did not step up the voltage to 48V.

  3. I once had a usecase, where I needed to repeatedly press the Down-key 10 times in a row, while everything else was doable by mouse. So I took the pcb from an old keyboard, soldered a phone dial on the two contacts where the Down-key originally was and plugged that in instead of the normal keyboard while working on that.
    There are two contacts in parallel on a dial, one is really good at conducting, and the other ist really good at chopping: the first one opens once the dial leaves the zero position, and the other generates the pulses, so the transmitted sounds pass a contact pair which is not subject to multiple arcing while dialing.

  4. The timing of what read the dialing pulses did indeed have pretty wide margins. In college, the phone in the studio of the student radio station had a lock on the dial to keep us from making long-distance calls, but we got pretty good at “dialing” out by pulsing the hook switch by hand.

    1. I don’t quite get it. This uses an interrupt input to “trigger”. And it says only one dialer can be used per application (not a big limitation). The big issue is the interrupt input, since there’s no debouncing and can potentially generate interrupts faster than the process can handle and cause it to lock up. Does this Czech telephone Tesla AS-10 include “debouncing”? I really doubt it, if it all mechanical, even if it has “wetted” contacts. That was what my reference to “debouncing” was for in my earlier comment. The old vending machines didn’t have that issue since it used slow relay “logic” to run things, but todays micros are super fast (and most are faster than the now ancient ATMega328, like the SAMDs and ESP32, etc.). Even a gigabit sampling rate scope may not be able to adequately catch the noisy pulses coming from switches, especially cheap and/or ancient ones.

      The “SW debounce” technique I mentioned uses a fast timer interrupt to sample the up/down (open/close) excursions of the switch every timer interrupt and then a SW routine counts them up/down (depending on application) or resets the count when it sees the “wrong” kind. I even suspect that some 3D printer end-stop issues may be related to this but it’s less of an issue since if it misses it going from NO to NC or vice versa, it will only miss the first one or two and catch is soon enough (but not for a very fast stepper motor).

      One easy way to verify bounce is to use this to count pulses. Dial 0 (10 pulses on most) a hundred times and see if you get a count of a 1000. That’s also why we used to get some misdialed numbers, but we “corrected” that ourselves and Ma Bell didn’t need to “fix” it if we did. If we misdialed a long-distance number, they got richer for it (unless you called and complained).

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.