Step 3Interface/Buttons
I first saw the idea here: ( http://www.kpsec.freeuk.com/trancirc.htm ):
"A Darlington pair is sufficiently sensitive to respond to the small current passed by your skin and it can be used to make a touch-switch as shown in the diagram. For this circuit which just lights an LED the two transistors can be any general purpose low power transistors. The 100kohm resistor protects the transistors if the contacts are linked with a piece of wire."
A PNP transistor was added to this simple design (in place of the LED in the diagram) so that it could give a high/low output to the PIC. A pull-down resistor was added between the PIC pin and ground to help prevent false button presses. This switch is solid state, water proof, and low power - with the added geekieness of pin headers.
Switches are de-bounced using Timer2 on the PIC. When a switch is pressed, Timer2 (8 bit timer) is started with a 16 prescaler and 16 postscaler. On Timer2 interrupt the PIC checks to see if the buttons are still pressed. After two consecutive interrupts with no buttons pressed the timer is stopped and the buttons are configured for further input.
The top switch is connected to the PIC interrupt pin. Input on this pin can bring the PIC out of sleep mode. This lets us use a neat power management technique: the PIC is in low power mode when the display is not in use. Input on the buttons wakes the PIC and resumes operation.
Transistors:
Darlington Transistor, SOT-23, (Mouser #512-MMBT6427, $0.07).
PNP Transistor, SOT-23, (Mouser #512-BCW89, $0.06).
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
![]() |
Add Comment
|

















































