100 led push button project

Discussion in 'The Projects Forum' started by happysoul, Sep 9, 2014.

  1. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    Hi Guys i was wondering if anybody can give me some ideas for a 100 led/momentary push button project, the idea is to push one of the hundred buttons and the next random light would appear and it would only move on when that particular lit button is pushed.I was thinking 2 *4017 in a matrix setup with a 555 fast clock rate so it would appear random but the question is how to control the switching. any ideas i would be truly greatful.
     
  2. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Welcome to AAC.

    Is there following correct?
    • 100 Momentary Buttons
    • 100 LED's, one per button, either next to the button or perhaps inside the button
    • Only one LED will ever be lit at any one time
    • When the single lit button is pressed, that LED goes off and another button is 'randomly' lit - does it matter how long the button is pressed?
    • If a non-lit button is pressed, nothing happens
    Using the 4017 to light the LED's would work, but then having another circuit distinguish between all 100 buttons and which LED out of 100 is on may get complex quickly. Not to say impossible, but the circuit will be involved. I'd suggest using a microcontroller with I/O port expander. You could do this nicely with a PICAXE and a few MCP23017 IC's. If this is of interest, I can put a schematic together and some code.
     
  3. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    thanks for your answer, yeah you have it right, the switching was where i got stuck i thought of running all the switches and the activated o/p of the 4017 through some sort of gate which would activate the clock, but as you say this gets complicated and a hell of a lot of wiring.I have had some experience with the picaxe and your offer sounds great, thank you very much for your interest, let me know what sort of price we are talking.
    happysoul.
     
  4. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Assuming you'll build and program the circuit yourself and you're not in a hurry, I'll post the schematic and code here as time allows. In this way, others can learn and you don't have to pay anything (other than what you'll spend on parts). AAC is about learning and teaching electronics, we're here for fun not profit. If, however, you're wanting this done privately, in a hurry, or need it built for you, that's a different subject. :)

    Do you have a PICAXE programmer? If not, I'll show you an inexpensive one you can make.

    Are you planning to mount LED's above or around the switches or are you going to use switches with LED's built in?

    If you have already selected a switch and/or LED, can you post a link to the datasheet for each? If not, can you define what size, type, color, etc. you'd like for the switch and LED? Will they all be the same or will there be different colors?

    Where are you located approximately: U.S., Europe, China, etc.? I'll tailor the parts list to an electronics parts distributor close to you.

    What kind of layout do you envision? Or put another way, how far apart will the switches be from one another?

    May I ask what the purpose of the circuit is? Interactive museum display, teaching tool, etc.?
     
  5. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    Yes, the purpose of the circuit is?
    Why you need to use so many push button and led, and why you use random function?
    100 push button, 100 leds, random function?
     
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,812
    834
    Have you considered a microcontroller or discreet multiplexing/ demultiplexin circuits? Demultiplexin the ground can be used for both the input and output circuits. Then, you could demultiplexin the input and multiplex the output. The microcontroller can determine the random selection as well as control the selection of lights and pushbuttons.

    Note: Ever re-read a post you wrote and wonder what the heck was I smoking?
     
    Last edited: Nov 19, 2014
  7. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0


    thanks for the offer sounds great, i'm not in a hurry so no problem there. I have the picaxe cable and software that is also no problem, I'm living in Salzburg , Austria so i have access to all needed components and i can build it myself no problem.i will probably use a momentary LED switch like this one:

    [​IMG]
    the layout i haven,t worked out yet but i will probably go with a 10 by 10 square, and the project is for a local museum (kids game) and i'am helping out with the electronic side thanks again, looking forward to the build and thank you everyone else for the input, excellent forum.
    Happysoul
     
  8. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Are you looking to use a multi-colored switch or will each switch only be one color? If you're planning to use a bi-color or RGB LED switch, the circuit will get more involved, extremely so if we need to employ PWM.

    If you select a LED switch designed for something other than 5VDC, we'll need to add transistors - not a big deal, just more parts.

    The switch you posted is nice, typically vandal-resistant (read: should stand up to abuse) and should be easy to clean. The caveat is they will be expensive, though you can save some cost by getting them from eBay. You may also want to considered lighted arcade buttons. I came across another project that used large lighted buttons (over 5cm in diameter) to create a Whack-A-Mole game. You could do something similar, perhaps add a timer or perform a memory function/code like the Simon Says game. Just some thoughts for future development.
     
  9. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    I think i will stick to one colour, keep it simple, and 5v will be fine, and i have got the go ahead for this type of switch and thought to go with a 10 by 10 pattern.The Simon idea would also be a good idea for the future.
     
  10. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Here is a first cut at the schematic. I'll put together a small prototype to test code against as time allows. I'm not sure if the OP would like to add a buzzer or other items, but there are eight spare I/O's on U4 and a couple on the PICAXE itself. A different PICAXE can certainly be used, I just went with the smallest one since that is all that should be needed. If anyone sees any errors or has better ideas, I welcome them. :)
     
    absf likes this.
  11. Dario Dentes

    New Member

    Oct 2, 2014
    2
    0
    One idea for optimization of wiring. If LEDs draw, for example, 5 mA wire the switches (normally open contact) in series with a resistor that will draw additional 5 mA, and in parallel with the LED+resistor combos. This way you can have only one 10x10 matrix. The supply of the power to the decoder circuits should be thru a sensing resistor (probably arround 50 OHM), so when only 1 LED is powered voltage drop accros the sensing resistor will be ~0.25 V, and when the switch is pressed that voltage drop will double. Comparator with a fixed threshold of ~0.37 V will confirm that the correct switch is pressed.
     
  12. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Dario Dentes,

    I like your suggestion - I learn something new every day. I don't think there is a PICAXE available with ten comparators built in, but I may be able to work some magic. Unfortunately, I'm attempting to draw out your recommendation and I can't quite visualize it. Could you post a simple schematic showing, say, nine LED's & switches in the manner you describe?
     
  13. Dario Dentes

    New Member

    Oct 2, 2014
    2
    0
    I was thinking more about driving it with cmos decoders, having inverters on the already decoded lines on one of them to produce the negative logic for the rows, while keeping positive logic for columns.
    Now that i'm thinking about it some more, you would need diodes in series with switch's resistors, so only the decoded one can increase the current draw.
    Alternatively connect the additional resistor+switch serial combination in parallel to the existing LED resistor. This would cause the LED to shine double as bright, but only for the very short time during detection of the correct button press. I would separate the power supply for these several chips from the rest of the logic supply by the means of the sensing resistor, and since cmos draws very little current to operate, the majority of the sense current would go to illuminate the LED.
    The comparator would be external component with one input on the sense resistor, other on the potentiometer wiper that has a reference voltage a bit over the maximum draw, or alternatively if arduino or pic are used, maybe just wire the active side of the sense resistor directly to the analog input, and compare numbers instead of voltages in order to detect the increase in the current.
    One thing to consider is relatively week current sourcing capacity of the cmos chips. If done with arduino I would probably leave rows undecoded, seting only one of the 10 outputs high, and use the decoder with active low logic level (or decoder + inverters) for columns. In this case only the final chips driving the columns should be connected to ground thru the sensing resistor. The maximum voltage drop un the sensing resistor should be low enough as to not mess up the input logic levels.
    I hope this verbose post was interesting enough to read.
     
  14. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    Hi I was just wondering if you had a chance yet to configure the code
    thanks
     
  15. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Sorry, I was intending to build a small demo, but became overcome by events and got sidetracked. I don't think I'll have time to put together a demo and test, but I've started the code and I'll post it once finished. You'll have to work out any bugs, but I'll be here to help.

    Just to confirm, you only need to see if the button pressed matches the lit LED correct? In other words, there is no reason to scan all 100 buttons when we're only interested in one? That will save a lot of time coding. I think I have the LED portion done, I've just started the button detection portion.
     
  16. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    Yes that's correct we only need the led that is lite to move it onto the next random selection, no problem with the timing, still waiting on the delivery of the leds/switchers. thanks again for your help.
     
  17. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
  18. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
    I can get them from Hong Kong for about 1.50 a piece
     
  19. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    Could you share with us where you got them? At that price, I'd buy a bunch too. :)

    Also, what voltage does the LED require for the switches you ordered? A link to the product page would help. The circuit, as designed, assumes the LED's require 5VDC or less. If you're going to use 12VDC LED's, we'll have to add parts to handle the voltage.
     
  20. happysoul

    Thread Starter New Member

    Sep 9, 2014
    28
    0
Loading...