Rotary dialer PIC interface using PIC16F877
Rotary dialer PIC interface
For some reason I got it into my brain that interfacing the rotary control with a PIC chip would be a good idea. I can only think of a couple of vague uses for it at the moment and none are particularly useful, but I hope to do something cool with this in the future.
Go get stuff.
1 – Rotary phone
3 – 220 ohm resistors
2 – 0.1uF capacitors
2 – 20K resistor (can substitute anything between 10K and 47K)
2 – LEDs
1 – PIC development board (I used the Basic Micro development environment)
1 – 20 MHZ resonator or crystal
1 – Breadboard
1 – 5V power source
1 – A foot or so of hookup wire
1 – Screwdriver
1 – Wire stripper
Dissect the phone.
There will be four wires running from the rotary dialer to this junction-box-like thing. The wires should be held in place by little more than tightened screws. Loosen the screws and disconnect the wires.
After that, disconnect the rotary dialer from the phone itself.
Determine what the wires do.
The two white wires should be the pair that closes the switch that lets you know when the dial is turned. The blue and green wire should be the pair that lets you know what number was dialed.
As such, when you turn the dial, the LED connected to the white wires should turn on, and when you let go of the dial, the LED connected to the blue and green wires should blink on and off as many times as the number you dialed (see video).
For instance, if you dial 8, the LED connected to the green and blue wire will turn off and on 8 times. This happens because one way to dial a phone number is to rapidly break the connection the number of times for the digit you are trying to dial. So, again, to dial an 8 you would have to rapidly break the connection 8 times.
Connect the dialer to the PIC chip.
That is where the 20K resistor comes in. Adding this to the input allows for a clear differentiation between the signal from a closed and open rotary switch connection.
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw