multiple leds/multiple switches/same power source

Discussion in 'The Projects Forum' started by jjp, Apr 24, 2013.

  1. jjp

    Thread Starter New Member

    Apr 24, 2013
    5
    0
    Hey Guys, I am new here and there seems to be some really knowledgeable people here. Perhaps you can help me with a project I need to complete. I need to connect 15 leds to a circuit board that each have their own pushbutton switch and can flash independently of one another. I then need all of it to connect to one power source. I really dont have much experience with stuff like this but I assume I need everything to be on a circuit board. Any light anyone could shed on how to accomplish this would be amazing!

    Thanks
     
  2. Youssef.zein86

    New Member

    Apr 24, 2013
    5
    1
    can you give more details of your idea?
    if you just want the led to turn on when you push the button, its straight forward, you can use the push buttons as switches. but if you want it to act like a flasher when you push the button it can be solved with some added on complexity...
     
  3. edwardholmes91

    Member

    Feb 25, 2013
    185
    19
    If you want only one LED to flash at once when the push button is pressed, this shouldn't be too hard. I'm thinking of maybe a 555 astable setup going to a ground or power rail and then 15 LEDs and switches wired in parallel to each other, either sinking of sourcing current. I will draw up the circuit in a simulation package and if it works I will post a picture of it. If not then I will let you know.
     
    Last edited: Apr 25, 2013
  4. edwardholmes91

    Member

    Feb 25, 2013
    185
    19
    Ok, well here it is, it works in simulation. If you were to press more than one LED at once they would be dimmer... in fact... it's probably best that you only press one at once otherwise you might draw too much current from the 555 timer.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Edward (correctly) shows how to wire up the LEDs to a 555 to get them to blink.

    However, we don't know what kind of LEDs these are, so we don't know how much current they need. He's assumed low current diodes and gives them about 10 mA each... a good starting point.

    If your LEDs need more current, or you need to turn them all on let me know. It's pretty easy to add a transistor to get this to drive lots of high current LEDs.
     
  6. edwardholmes91

    Member

    Feb 25, 2013
    185
    19
    @ErnieM Thanks for your kind comments :) I feel quite proud of myself now! :) I'd be interested about using a transistor too. I did consider using maybe a relay and then I decided against it because the noise would drive you crazy!
     
  7. RayInMS

    Member

    Dec 12, 2012
    89
    1
    Edward, wouldn't it be easier to just use one resistor (right after pin 3 and before the switch array)?
     
  8. n1spx

    New Member

    Sep 23, 2010
    4
    1
    Only if you assume that only one button would be pushed at a time. Otherwise, as more buttons are pushed, the LEDs would get dimmer.
     
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Here's where I would put a transistor:
    [​IMG]
    It's drawn a little weird from normal because I just stuck it into edward's image.

    Just about any NPN transistor will work here, a 2N2222 as much as any. Collector current max is all 15 LEDs on, or 15 x 10 mA or 150mA. Power dissipation is nearly zero. (I think there is actually more power due to the base current then the collector current.)

    Base current should be 1/10th the collector current (that insures the low collector "on" voltage). Rg can be calculated from:

    Rg = V / Ib = (Vcc - Vbe) / Ib = (9V - 0.7V) / (150mA/10)

    Rg = 8.3V / .015mA = 553 ohms

    Any value close to that is fine.
     
    • Q1.GIF
      Q1.GIF
      File size:
      19.2 KB
      Views:
      106
  10. jjp

    Thread Starter New Member

    Apr 24, 2013
    5
    0
    Hey guys, Im really sorry it took me so long to respond, I got pulled away for personal reasons. Edward and Ernie, you guys are awesome! You guys are rock stars! I really appreciate the diagram and I should share a bit more specifics. Basically once you press one of the switches, the light flashes until you press the switch again. I would also need to have the capability to have more than one of them flashing at a time (perhaps all of them). How would it need to be set up so the lights dont get too dim when more than one is flashing? In regards to the leds, I assume they would be pretty basic. I was wondering though, is it possible to make the light fade in and fade out as opposed to flashing?
     
  11. jjp

    Thread Starter New Member

    Apr 24, 2013
    5
    0
    :D Ernie I really appreciate you adding the transistor, does that mean that I would be able to turn on all the lights without too much dimming? I would like to be able to switch on or off any combination of the lights.
     
  12. edwardholmes91

    Member

    Feb 25, 2013
    185
    19
    Yes you can turn anyone on or off without dimming I think. From the sounds of things you require latching push switches rather than monetary ones.

    With regards to fading them in and out that complexes things a little. I would suggest using a programmable microcontroller such as a PICAXE or Aurduino. You will need to program a pulse width modulator to vary the brightness and then use a loop to cycle and add one or take one away from the brightness if you get what I mean. Sorry I haven't really explained it very well, but I'm not really sure where you would start with that. It might also be difficult to do it with each individual LED. Thinking about it, you could maybe use a capacitor that charges and discharges? Then the LED would increase and decrease in brightness? I don't know is the real answer, I'm just throwing a few suggestions out in the hopes that someone might be able to expand on one of my ideas and help you out?

    Thanks for the compliments on the circuit, you're making me blush :p
     
  13. jjp

    Thread Starter New Member

    Apr 24, 2013
    5
    0
    :D Edward, you and Ernie are the best! I can't thank you enough for the diagram, it will really help! I will definitely need to turn on more than one at a time. But it seems that Ernie added the transistor that should make it work? Also I was wondering if there is a way to make the lights fade in and out?
     
  14. jjp

    Thread Starter New Member

    Apr 24, 2013
    5
    0
    Hey Edward, thanks for the quick reply. Yeah, I need to click on (lights flashing) then I when I click it again, it turns off. I dont think a momentary switch will work. Quick question. How small could this be? I would need it in a pretty small configuration? Perhaps a 5 x 8" configuration?
     
  15. elec_mech

    Senior Member

    Nov 12, 2008
    1,513
    193
    If you want all the LEDs to fade in and out at the same time, you can use Edward & Ernie's circuit as a guideline and use Bill's throbbing 555 circuit found here.

    If the LEDs don't need to blink or fade at the same time relative to one another:

    You can buy LEDs that have a built-in flasher. Just connect each to the proper resistor and switch and you're golden. The caveat is multiple LEDs will not blink at the same time. If you need to have every LED blink at the same time as the rest, then Edward and Ernie's solution is best.

    If you're not concerned with having the LEDs fade at the same time as one another and you want multiple colors, you can use fading RGB LEDs connected directly to a resistor and switch with no extra circuitry. You can see how these would look here.

    Based on your comments, you will want to use latching push button switches such as this. Note most push button switches are momentary meaning they will not latch, so be sure you are getting a latching switch when buying. Feel free to post a link to the product you have in mind and we can help verify if it will work for your application or not.

    A 5" x 8" enclosure should be fine as long as it is at least an inch deep, two inches being ideal so you have more play. Note you'll need enough height to mount the LEDs, add wires to the back and fit a circuit board if you opt to use one of the 555 designs.
     
  16. edwardholmes91

    Member

    Feb 25, 2013
    185
    19
    Yer, see comment in my previous reply regarding latching push buttons, the latch version of this: push button or one of these should be fine for what you want.

    The transistor placed where it is on my diagram will allow you to have more than one flashing at the same time.

    5" by 8" should be absolutely fine. Taking just the 555 part of the circuit I can easily fit this on a board no bigger than 1.5" by 1.5" using through hole components. Depending on what your plans are regarding positioning of the switches/LEDs will determine the overall size of your board. If they are in the PCB then some careful placement and you shouldn't struggle to fit them on :)

    With regards to the fading aspect, that circuit of Bill's looks good, I'm not entirely sure how it works though, so I would have to play around with it myself to see.
     
Loading...