Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
One-Pin Keypad Features Low Component Count

Hank Wallace  |   ED Online ID #3560  |   May 26, 2003


Building on the recent Design Brief theme of one-pin keypads, this design uses only one analog microcontroller (MCU) input to scan numerous keys, plus one resistor per key and another resistor and capacitor. The circuit is simply a crude digital-to-analog converter. The MCU reads the analog voltage and quickly computes which key is pressed.

The figure shows the circuit's layout. When a key is pressed, a voltage divider is created and the signal KEY drops from VCC to a lower voltage. The capacitor suppresses noise. The MCU scans the KEY signal periodically—every 10 to 50 ms—and qualifies the key press when the voltage drops below VCC. Using VCC as the analog-to-digital converter's (ADC's) reference ensures that drift and regulator tolerance won't affect system operation.

To compute the resistor values, first choose the pull-up resistor. In this example, R1 = 10 kÙ. Some ADC inputs require lower input impedances for the rated conversion speed. But to save power, you can get away with higher values at low conversion speeds.

Next, note that the divider network must slice the MCU's ADC digital range into equal-sized bins. If B is the bin size, N represents the number of bits in the ADC, and K the number of keys scanned:

B = 2N/K

For a 10-bit converter scanning eight keys, B = 1024/8 = 128 counts per bin. The edges of the bins are simply multiples of this number.

To compute the target "key-pressed" value in the middle of each bin for each key, k (starting at k = 0), we have:

Xk = kB + B/2

For the 10-bit example, the threshold for the first bin is 64, for the second bin 64 + 128 = 192, and so on.

The value of the resistor attached to each switch is then:

R = (Xk R1)/(2N − Xk)

So the first bin's resistor is 667 Ù, the second is 2308 Ù, etc. The closest 5% values are shown in the figure.

The resistor tolerance must be chosen according to the number of keys and bins. With eight keys, the bins are 1/8 = 12.5% wide. By carefully selecting the values, ±5% resistors may be used while keeping each key's voltage within its bin. For 16 or more keys, the bin size is 6.25%, and you will need 1% resistors to ensure that each key's voltage stays within its bin.

This technique really suits low-power systems because the keypad draws zero power until a key is pressed. If the MCU's analog input can be configured for wake-on-pin-change, then the MCU can go to sleep until a key is pressed.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • Network-On-Chip Tools Arrive for The Masses
  • Tackling System Design Challenges Through Early Verification
  • ESL Tools Take Center Stage As Designers Move Up
  • Parasitic Extraction Tool Targets Next-Generation Custom ICs
  • Synopsys Jumps Into ESL-Synthesis Pool
  • Verify Control Systems Before Committing To Hardware
  • You're Using How Many FPGAs?
  • Tool Up For The FPGA Blitz
    1) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (180 views today)
    2) Hot Hands For Some Cool Rock: Motion Sensing Meets Audio Engineering
    (170 views today)
    3) What's All This Transimpedance Amplifier Stuff, Anyhow? (Part 1)
    (90 views today)
    4) GPS-Derived Grandmaster Clock Delivers Ultra-Precise Time And Frequency Sync
    (84 views today)
    5) Downconverting Mixers Lower Power Consumption While Improving Performance
    (67 views today)
    ALL TOP 20



    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Web Seminar
    Sponsored By:
    Title: Read Pacing: A Performance Enhancing Feature of PCI Express Gen 2 Switch Devices
    Speakers: 
    Date: 07/01/08
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF
    Mobile Dev & Design Schematics Find Power Products Military Electronics EE Events Related Resources