Help with bi-polar (rg) random led project

Discussion in 'The Projects Forum' started by Newcircuit, May 9, 2013.

  1. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
    Hi all -
    I'm a newbie & I hope you'll be nice to me :). My goal is to create a simple circuit that would randomly flash a group of bi-polar leds either red or green.

    Specifically, the process would be as follows:

    1) press button to start random flashing (some leds flash red others green)
    2) press button again to stop flashing leaving only 1 led on.

    I've searched around I found the following schematic from another forum user that I think may work. My questions are as follows:

    Schematic\Breadboard Questions:

    1) On the schematic (top left) what does "u2" mean? (it's to the left of the chip number 74ac14)
    2) Regarding the top left of the schematic where do I connect the 3.9M resistor? (It seems like it should go to pin 11 or 12 but then it doesn't connect to pin 13)

    Also, how do I connect the capacitor? It seems like 1 leg of the capacitor is connected to pin 10 and other leg is NOT connected to pin 13.


    Parts Questions:
    1) Resistors 2.2m,6.8m,3,9m,470... they come in different watt sizes, which ones should I be using? Does the composition matter (ceramic, carbon etc..)?

    2) Capacitor .1uf ..same issue. Will any .1uf work for me?


    Thanks for all your help. I really looking forward to ordering these parts and making this happen.
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
  3. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
    Wow!!! Thank looks great and a lot easier than my original schematic.

    I need to use bi-polar (red/green) leds and have them INDIVIDUALLY be random (somtimes be red and sometime be green). How could this be done?

    Also would there be a way to have it such that you push a button (to end the cycle) while keeping only 1 led lit?

    Thanks for your reply.
     
  4. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    The typical way with one one red green LED pair is the old "electronic dice" circuit.

    When you hold the button a 555 timer oscillates at a high frequency (a few hundred Hz) and the output clocks a flip flop Hi and LO as a divide by 2 counter. So there is equal chance of the LED output being red or green.

    Then when you release the button the LED will then be stable in a "random" state either red or green.

    To make a heap of them all you need is a 555 timer osc and a divide by 2 flipflop for each LED pair.
     
  5. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Basically it's like this "electronic dice" circuit, but instead of a 4017 as the final chip you use a flip flop IC which has two outputs only (red and green);

    [​IMG]

    As there are only 2 output states in your case (not 6) it's really an "electronic coin toss" circuit I suppose. :)

    You can get flip flop ICs with two FF's in each IC, so that reduces the parts count. Also you can get 556 ICs which basically have TWO 555 timers in one IC.
     
    Newcircuit likes this.
  7. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    This could actually be quite complex. Is the assignment to have a group of LEDs flashing randomly red, green or off, and then when the button is pushed, one LED is left on? Actually it seems as if you could fake this, by having two modes of operation: one where all the lights are bouncing around, but a background count where they're actually being sequenced. Pushing the button would just suppress the random flashing and stop the count at whatever it happens to be.
     
  8. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
    John -
    Thanks for your post.

    Regarding my assignment your correct. The assignment is to have 20 bi-polar (red/green) leds flashing randomly one at a time. In addition to that, each individual led would randomly be red or green when it does flash. Then when you push the button to end the cycle, there would only be 1 led remaining lit.

    thanks.
     
  9. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Sounds like a job for a microcontroller. :)
     
  10. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
    Thanks RB -

    I like you design but I've got a few questions.

    1) Based on your design, I understand how each led will be randomly red or green when selected, but will this design cause a random led within the group to flash?

    2) Does it matter which type of flip flop I use (sr, d, jk etc...)? I was thinking of getting a jk flip flop.

    3) Also if I get jk do you recommend + or - edge trigger?

    FYI - although the assignment was to use 20 leds, my plan is to try to do this with 6 leds to start & if it works, then I could figure out how to expand it to 20.

    Thanks for all your help...
     
  11. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    Agree re the microcontroller, but it gets kind of boring to answer every question here with "The best solution is to use a microcontroller".

    I think you want to have 4 states for each LED--red, green, and an "off" phase between red and green, and again between green and red. That's because it's easier to count to 4 than to 3, and if the assignment didn't say every state has to be equally likely, do it the easy way. So there are 2 output bits per LED, i.e. 40 bits. You can make a very nice pseudo-random generator with a shift register, if you care to do some research there. You'd need to add some extra logic to ensure that when the button is pressed, the device stops with a light on and not with all the LEDs off.

    Actually there's another ambiguous point in the assignment--when you "randomly flash a group of bi-polar leds either red or green" does that mean a maximum of one LED is lit at a time, or does it mean that every LED has an equal chance of being red, green or off (or maybe red, green, and 2 chances of being off) but basically, they might all light up at once? That difference really affects the design.
     
  12. Newcircuit

    Thread Starter New Member

    May 7, 2013
    6
    0
    Hi John -

    Thanks for your response. In regards to the assignment, there's actually 2 parts to it. I haven't considered part 2 yet since I haven't been able to master part 1. The assignment is as follows:

    Part 1:
    20 bi-polar red/green leds randomly light up 1 at a time (whereby only 1 is lit...[19 off 1 on]) . Each time an led lights up it should light up randomly red or green. Then when you press the button the last lit led remains lit.

    I'm thinking about using a 555 or 556 combined with 2 ic's 1ea of 74AC14 and 74AC138.

    Part 2: (Which I haven't even thought about yet)
    It's similar to assignment 1 (random flashing coupled with random r/g per each led). However, assignment 2 requires that a random number of leds flashing at the same time. When you press the button to end...whichever leds where last lit will remain lit.

    Thanks for all your help.
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Now that is completely different to what you asked in your first post!

    To light up "randomly 1 of 20 LEDs" means a gated high speed osc (555) driving a "1 of 20" linear counter.

    To make the final LED be randomly either red or green, requires another gated high speed osc, driving a "1 of 2" counter (ie a flip flop) to give randomly 1 of 2 final states, and a heap of logic gates (maybe 20 or 40 gates)!

    Then you have the complication where it must run "randomly" by itself (at least requires another oscillator).

    That's turning into a really big nasty logic circuit and sounds wierd for a logic assignment with no practical use.
     
  14. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    Part 1 of the assignment is boring. It's just the same as saying there are 40 LEDs. One at a time will be on, and design wise it's not relevant whether it's either a red or a green within a given package; it's just 1 out of 40. If the LEDs are the bipolar type and you have to drive them appropriately, it may seem intimidating to think about, but it's actually trivial to do.

    Tell your instructor "Some guy on the Internet says you're faking us out, and 20 bipolar LEDs are no different from 40 ordinary ones."
     
  15. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    Hello,

    Here I got an idea for a bi-color led driver:

    [​IMG]

    Bertus
     
Loading...