Connect with us

Electronic whack-a-mole

Discussion in 'General Electronics Discussion' started by Diggs56, Nov 18, 2012.

Scroll to continue with content
  1. Diggs56

    Diggs56

    2
    0
    Nov 18, 2012
    I am an electrician, but have never really gotten into electronics. My son is starting to show an interest in all things electronic, so we want to build something together.
    What we were thinking of was a game, like whack-a-mole, where you would have six led's on a panel, and six push-buttons. An led would light at random, and you would have to push the button associated with that led within say 1/2 second. If you push the button within the time, you get a green led, and the game continues for a max of five goes (five green led's). If you get 5 greens, you win. However, if you don't push the button in time, you get a red led, and the game stops.
    I know this is probably basic stuff for most, but please have pity on a poor noob.
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    That's a job for a microcontroller, so less about electronics, and more about programming.

    If you're still interested, there are a number of ways to approach this, and I'm sure we could assist in pointing you in a reasonable direction.
     
  3. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    I was going to say the same thing but was stepping out the door...

    But, I also ran though my head how much of a brain exercise this would be on the 'cool' factor doing it with simple logic chips and timers... Anyway I'm far to lazy to even attempt the design the old fashion way, a few lines of code it my way :)
     
  4. Diggs56

    Diggs56

    2
    0
    Nov 18, 2012
    Thanks (*Steve*),
    I have some experience of programming in C++, but none of circuit diagrams or parts lists, so any help would be much appreciated.
     
  5. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    Well the schematic/circuit as well as parts kinda go hand in hand with the software...

    Depending on the micro you choose there might be a few extra components required, but if you choose say a PIC with an internal oscillator and a software disableable MCLR you can get away with just a capacitor to get it fired up and running off 3-5 volts... Although most people would use a voltage regulator of some sort and a wall wart vs batteries... The LM7805 is a popular voltage regulator and only requires 2 capacitors to get fired up...

    The easiest way to hook it up is to simply do a 1:1 wire up... Hook the 6 individual LEDs to 6 digital output pins on the micro with a current limiting resistor for each LED to ground... Turn the appropriate pin logic 1 (high) in the software and the LED lights, turn the logic 0 and the LED goes black...

    Take 6 other digital I/O pins and make them input, again at this point the micro you choose will dictate things a little, a PIC with internal pull ups will simplify things... Enable the pullups on those 6 input pins and then wire the pins to the buttons that connects them to ground... If you don't have internal pull ups you will have to use external ones, or flip the logic and use pull downs... Anyway with the interal pull ups enabled when you press the button the input will go low (logic 0) when not pressed it will be high (logic 1)...

    Now you have 6 LEDs on 6 pins and 6 buttons on 6 pins... The rest is software, light the LED and then monitor the inputs for a press and count the elapsed time...

    The drawback here is that this is not simply a purchase the parts and wire together solution, you need to invest in a microchip system and learn that system... This involves choosing your micro, choosing your compiler, and choosing your programmer... Right now a lot of people just jump on the Arduino bandwagon as you get it all in a user friendly package, including the chip already up and running so you just need to plug in your LEDs and buttons...
     
    Last edited: Nov 19, 2012
  6. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    Not to spoil your fun, but Bob's Space Racers licensed the Whac-a-Mole game to Hasbro to make a small electronic version. It's been on ebay for $10.
     
    Last edited: Nov 19, 2012
  7. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    652
    May 8, 2012
    At this very moment Kris might be designing a totally discrete model of this. If we needle him enough we might be able to goad him into including plans for home made passive components too! :D

    Chris
     
  8. Raven Luni

    Raven Luni

    798
    8
    Oct 15, 2011
    I'm crazy / challenge starved enough that this would be my first method of thinking :p

    I think the point was to get the experience of learning and building something. Half the projects in here can probably be bought in some form somewhere.


    Anyway, if you went by pure logic, A shift register would do for your score counter - reset it at the start and feed it a 1 on each hit (contingient on an AND of the button press, the active state of the hole and the timer (a 555 should do) ), hole selection probably done with a 3/8 demux (so you could have 8 holes if you wanted). As for the 3 bit hole number, thats the hard part. You'd need a source of thermal noise - an analog circuit amplifying resistor noise for example. And dont forget a counter for the number of rounds :)
     
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    LOL Chris :)
    Yes I've been thinking about a discrete design.
    I'm sure you'd like to see a design that uses just resistors and Darlingtons, or something like that, but the design I'm working on uses CMOS MSI. Sorry to disappoint you!
    No promises, but if I can get something that I think should work, I'll upload it.
     
  10. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Aw, come on, Kris, you can certainly do it with tubes (valves).

    Bob
     
  11. CDRIVE

    CDRIVE Hauling 10' pipe on a Trek Shift3

    4,960
    652
    May 8, 2012
    I'm disappointed too. No shop made carbon resistors or foil/paper capacitors. :(

    You can redeem yourself by designing this around a mahogany base with OGee profile on the edging. Must be Tung or Danish Oiled though. No poly! :p

    Chris
     
  12. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    LOL :)
    Actually I'm having enough trouble designing it with CMOS!
    Re mahogany base, somehow I don't think a whack-a-mole game really deserves that kind of treatment!
     
  13. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    Yeah, but consider the cost of replacing all those smashed tubes!
     
  14. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    That's why the hardwood base come in handy, you hide the tubes under it.

    Bob
     
  15. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Well, I've nearly finished my CMOS design. I have a question, because I've never actually played whack-a-mole (I think it's mainly an American thing). Is there a random delay between the moles appearing?

    I know that only one mole appears at a time, and WHICH mole appears is chosen randomly, but is there also a random TIME before the mole appearing? Or do they all appear at regular intervals?
     
  16. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,496
    2,837
    Jan 21, 2010
    No, it's all pretty random. The time they are "up", the time between them, etc. The variable is that they appear more often, closer together, and for shorter periods as the game progresses.

    I was looking at an LFSR the other day for another purpose, and it strikes me that if you used one of these and slowly increased the clock rate, you could simulate many of the behaviours.
     
  17. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Bugger! I didn't know that the game gets harder as it progresses. I guess I'll submit my design but it won't be a very accurate simulation. I can't be bothered going back to the drawing board... unless someone gives me a complete specification, and maybe not even then.

    This is a classic example of why a software solution would be so much better than a hardware-only design!
     
  18. KJ6EAD

    KJ6EAD

    1,114
    159
    Aug 13, 2011
    If the link works, you should be able to try the game online.
    http://www.bobsspaceracers.com/frames/playagame.htm
     
  19. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Thanks KJ6EAD.
    I couldn't find a playable version at Bob's Space Racers but I found a few online rip-offs. They're not exact copies of the original though.
    I think I'll just go with what I've been working on. I guess it's proof that something like the game can be implemented with logic ICs.
     
  20. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Kris's CMOS Whack-a-mole design, revision 001

    [​IMG]
     

    Attached Files:

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
Loading...
Electronics Point Logo
Continue to site
Quote of the day

-