1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics 12-key keypad wiring

Discussion in 'Modding' started by dragon2309, 15 Jun 2007.

  1. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    Ok, im going to level with you here, all of that code in those examples means absolutely nothing to me... it may seem simple to you or others who have dabbled with it before, but seriously, straight over my head... especially seeing as this doesnt actually seem to relate to being able to complete a circuit, these examples and solutions seem to just read keypresses from the keypad... and one of them beeps...
     
    Last edited: 16 Jun 2007
  2. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    No. That's just wrong. Read my post.

    Dragon, if you say what PIC you're using, people can tell you exactly how to wire it up and what code to program into the PIC.
     
  3. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    if you want it continually polling. or you could use an interrupt. don't be a dick.
     
  4. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    Sorry for being a dick in the way I said it, but it still stands that you're wrong. Where is the +ve voltage coming from to make the two inputs high? The keypad doesn't have a common anode. If it did, it would have 8 pins.
     
  5. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    Ok, look guys, i didnt want to start a fight, i know just enough to understand if contacts go high or low, and yes, as i understand it, there is no potential difference between any of the contacts as it stands so none of them will ever be high or low in relation to each other.

    Cool it down a bit...

    Anyway, back to the question in hand... What type of PIC, well i dont exactly know specifics, i sell them all day, and have access to them etc... but obviously, i would need one with 7 I/O lines at least, im guessing all of them have a clock input to be able to keep timing inside the chip right? Something like a beep output might be nice as an extra but not crucial.

    How about something like the 16F628, although that looks a bit bigger than i might need... The 16F84 looks ok aswell, a few more IO ports than the 628... not that it matters...

    I dont see a beep output or anything on those ones though, any suggestions...

    Also, i dont have a programmer, the cheapest is £20 on eBay, but i will only be using it for this one thing... This is turning out expensive, more than I would like to pay.
     
  6. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    sorry, i was in a bad mood. i apologize, he was right... :blush:

    i'm not exactly sure which one, so i can't really answer that. we used the 16f877 in school, so thats what i'm partial to, mostly b/c i still have all the notes for it (although they apply to a lot of PICs). i can link the notes if you like.
    edit: http://oak.cats.ohiou.edu/~uijtdeha/EE395A_Fall06/EE395A_Notes.htm

    you'll probably want something with at least 9 IO lines, 7 for the keypad, 1 for the output to "unlock" the computer, and another to output for a beeper.

    as far as a programmer goes, you could build one yourself:
    http://web.tampabay.rr.com/hazer/what_you_will_need.htm
    (thanks to hazer for the sweet website)

    along with a crystal to clock the PIC, you'll probably want some other things when your designing and testing your circuit, like a reset switch, some leds or something to test your output, etc. there a pretty good list on the above site.
     
  7. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    Right, thanks for that link btw, and yeh, i can get all the components from work, but we also sell a PIC programmer, both in a kit version and pre-built...

    I'm fairly decent with a soldering iron, lol, but building a PIC Programmer is a bit further, it sounds liek a lot of wasted money if i accidentlly screw it up.

    Even buying the kit to build one doesnt make it that much cheaper
     
  8. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    If you're happy to go for an AVR instead (which I personally prefer, even though I've used PICs for longer), there are some decent plans here. I think a little bit of investment is going to have to happen - and it could be worth it if you ever want to do something else.
     
  9. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    I'm not sure of the advantages of AVR over PIC, but PIC is definitely more well known, i think i would prefer PIC's tbh

    Can anyone clarify which PIC i would need and perhaps go voer how to use it in the final product etc... any code would be a major bonus too.
     
  10. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    you're going to love me. i found a site doing almost exactly what you want to do, complete with source code and everything for the PIC (he uses a 16F628) as well as a parts list and schematic, even a board layout. The only difference is that he uses his keypad to unlock a gate, but does so by simply activated a relay. if you place the PWR_ON+ on one side of the relay and PWR_ON- on the other side, when the relay is tripped, it will short the 2 pins together, the same as a push button.

    I'd recommend version V2-024, the second one on his webpage. He even tells you how to go thru the code and change it for a 3x4 keypad matrix.

    heres the site: http://jap.hu/electronic/combination_lock.html

    edit: looking thru it, it seems pretty easy to change the amount of time the relay is activated as well.
     
    Last edited: 18 Jun 2007
  11. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    absolute genius.... truly thanks a lot... unfortunately its late and i have two exams tomorrw, so it'll be about 18 hours before i can read through it fully, but if its all you cracked it up to be then my god i love you, lol

    Thanks man :D :D :D :D :D
     
  12. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    hey, if you have a .edu email address, microchip will send you free samples. good luck on your exams
     
  13. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    just checking in on the thread before i leave for the exams. Unfortunately the email address they provide you with for school is a .org.uk address... DAMN!! Ah well, I can buy them at work and get staff discount, means they're only £1-2, not too bad i suppose

    *thinks* - i wonder if you can register a .edu domain to get an email address on it...

    ;)
     
  14. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    Good find! Have you managed to get a programmer?

    Please don't abuse the sampling system, it just puts the prices up for the honest people on this planet.
     
  15. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    Not found a programmer yet, seems i will have to pay out around £20 for one, I have absolutely no money at the moment, have to wait until i get paid again :'(

    I won't abuse the sampling system, i don't have a .edu email address to do it with.
     
  16. dragon2309

    dragon2309 techie

    Joined:
    28 Jul 2006
    Posts:
    959
    Likes Received:
    19
    Right, just resurrecting the thread a bt, they get buried fast in these forums... Just letting you know that i managed to find a 16x2 Blue Backlight LCD w/ White Characters for uber-cheap, so im getting that, and interfacing it with the PIC16F628 which is in turn connected up to the key-pad... Still using the code and examples given by the link supplied by jakenbake.

    Should be good

    dragon

    *EDIT* - oh and this is an official plea of help, can anyone, or does anyone want to program a PIC, i'll supply the code, and pay you in advance via paypal for you're costs/troubles? If not then I have to buy a programmer
     
    Last edited: 20 Jun 2007
  17. Hazer

    Hazer In time,you too will be relixalated

    Joined:
    14 Apr 2003
    Posts:
    957
    Likes Received:
    2
    You could build a simple one using a couple diodes and resistors, or buy the same thing from Olimex for alot cheaper than £20.
     

Share This Page