“This project was intended to serve as a proof of concept for using a rotary phones dial as an interface between a user and the Arduino microcontroller. However, this experiment quickly turned into an opportunity to learn all about the Atmega328Ps various timer and interrupt capabilities and how to manually set registers within the Arduino IDE in order to utilize them and handle IO operations more efficiently. This section includes a brief video demonstration of the rotary dial’s use as an input to a microcontroller.
While disassembling a few legacy phones, I was excited to learn that their dials are completely self-contained devices that operates as mechanical switch. When the user draws the dial back to a specific number the switch will periodically open that number of times, with a specific timing that is dictated by the rotary dial’s inner clockwork. In order to test the possibility of using the device to act as a sort of keypad, the circuit depicted in the top diagram was constructed. Both LEDs have their own digital pins (D3 and D4) which are simply used to communicate whether the correct predetermined code has been entered into the dial. The microcontroller counts the low pulses at the rotary dials pin (D2) in order to determine which number has been entered.
Though the circuit is very straight forward, programming for this operation required an intimate knowledge of the Atmega328P’s timers. A timer had to be utilized in unique ways in order to distinguish one pulse from another, debounce the rotary dial’s switching, and decide when to stop counting pulses for one digit and start counting pulses for the next digit. The project has left me with a much deeper understanding of the registers used to control the 328P and a comfortability with the technical documentation involved. Below is the entire program used to run the demonstration in the introductory video.”