What you build
A phone that plays music. The Uno reads the rotary dial pulse by pulse, watches the hook switch, makes dial tones, busy signals and a 20 Hz ring on a buzzer, and tells an MP3 module which song to play.
- The dial: a rotary dial, PULSE on pin 4 and DIAL on pin 5.
- The hook switch: a lever microswitch under the handset, COM to ground and NO to pin 6.
- The ringer: an active buzzer on pin 7.
- The music: a DFPlayer Mini with a card of songs, on a serial link (TX to pin 10, RX through 1k from pin 11) with BUSY on pin 3.
- The brain: an Arduino Uno.
How it works
Pulse dialing. Let go of the wheel and a spring runs it home at ten pulses a second. Each pulse is a 60 ms break and a 40 ms make, the 60/40 ratio exchanges were built for: one pulse for 1, ten for 0. The off-normal contacts hold DIAL low while a digit comes in, so the sketch counts breaks between them.
Numbers from gaps. Pulses come every 100 ms, but a finger takes at least half a second to reach the next hole. A short gap separates pulses, a longer one digits, and a pause of a couple of seconds ends the number.
The hook switch. The handset's weight holds the lever down. Lifted, the phone plays a dial tone; hung up, everything stops. Dialing on hook does nothing, as on the real thing.
An MP3 player on a serial link. The DFPlayer reads the card and drives the speaker itself. The Uno sends ten-byte commands, and BUSY goes low while a file plays.
Phone sounds. A dial tone is the buzzer held on, a busy signal is half a second on and off, and the ring is two seconds of a 20 Hz rattle every six seconds, the North American cadence.
The course
Build a rotary phone jukebox has six lessons, all on the same wiring:
- Pulse dialing: off-normal contacts, breaks and makes, and ten for zero.
- Counting digits: pulses into digits, digits into numbers.
- The hook switch: dial tone, hang up, and dialing on hook ignored.
- MP3 tracks: dial a track, a busy signal, and hang up the music.
- Ring sounds: the operator rings you back with a 20 Hz bell.
- Project: dial a song: two-digit songs and a phone of your own.
Every step is checked against the running circuit, apart from the last, where you make the jukebox your own and share it.