Sleepy Keypad


Closed Thread
Results 1 to 1 of 1

Thread: Sleepy Keypad

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358

    Default Sleepy Keypad

    This was originally posted on the piclist but unfortunately the archives drop the attachments... reposted by request...

    --- snip ---

    You don't actually need an On button... the PIC can sense a Keypad Button has been pressed and turn itself On. What is your Keypad arrangement? I assume it's a standard Matrix style whereby the PIC sequentially powers the rows and reads the columns.

    If this is the case, the columns get connected to RB4 thru RB7 and you have an interrupt on change preset in software. Meanwhile, you need to power the Rows when the PIC sleeps (since the PIC is no longer polling the buttons. So a transistor and a splattering of Diodes will do that... you'll need an extra PIC pin to accomplish this.

    Consider the schematic of the SLEEPY-KEYPAD I've just thrown together (see appended file). You will recognise Fig 1 as the 'Classic' arrangement. Now look at the rehash of the arrangement in Fig.2. With the PIC switched OFF (asleep) additional assigned pin RA0 is either high impedance (Input) or Logic 0. Transistor Q1 is powered ON via R9. In turn power is applied via Diodes D4-D8 onto the Matrix. Any keypad depression will apply a voltage onto RB4-RB7 and trigger a wake on change on those pins. Diodes D1-D4 prevent this aux power arrangement from attempting to power the PIC thru port pins RB0-RB3. When the PIC wakes, the first thing it does is apply a Logic 1 (High) onto the pin I've assigned as RA0. This turns OFF Q1, and now the PIC can scan the Keypad Matrix as normal to detect the offending key-press. Diode D9 is dual purpose, it again prevents external voltages from powering the PIC, and stops you blowing up Q1 by driving RA0 Low. Before going back to sleep, PIC sets either Logic 0 or Input for RA0 to switch ON Q1.

    Q1 is any low-power transistor (eg BC237). Diodes are signal types (eg 1N4148). Resistors are 10K except R5, which you may get away with a few hundred K (eg 470K... experiment here).. the higher the better as it just keeps Q1 turned on and adds to your OFF-state power drain.

    I'm sure there are heaps of other arrangements, but this is one simple one that obviously springs to mind without burning too many calories over the problem.

    Melanie

    PS. Rubbish GIF, so save and enlarge accordingly. As an afterthought, the Keypad Resistors can be dispensed with reducing the component count, however transistor base Resistor R9 is still required.
    Attached Images Attached Images  
    Last edited by Melanie; - 25th October 2003 at 10:47.

Similar Threads

  1. 4x4 keypad Help
    By aaliyah1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th October 2010, 17:34
  2. Universal Keypad System
    By aratti in forum Code Examples
    Replies: 3
    Last Post: - 18th January 2009, 14:06
  3. Keypad input test
    By Kalind in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th October 2008, 05:00
  4. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 14:16
  5. Keypad unlock (as in garage door possibly)
    By Fred in forum Code Examples
    Replies: 5
    Last Post: - 2nd April 2006, 05:26

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts