Color changing LEDs at the push of a button

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
hey everybody,

It’s been about 10 years since I’ve studied electronics in school and it’s needless to say that I’m a bit rusty. I would like to ask for advice from you guys to see if my logic for a project I’m working on is actually correct.

The thing I want to do is build a dice tower for roleplaying, modeled after the helm station of a Star Trek vessel. Yes, I am a nerd. Part of this would be the possibility to change the internal lighting of the console from blue, to yellow, to red with one button to turn on each color. As someone who’s mainly an electrician, I was looking for a more crude solution, until I remembered some of my electronics training. After some research, I figured out that, using a USB as power supply, I should be able to use a 74LS175 Quad D Flip-Flop for my purposes.

As I said, however, I’m rusty when it comes to electronics and I’d like to see if my logic in the attached plan (Drawn on iPad because it’s the best software I have right now) is correct. The idea is that when the blue button is pressed, the Blue led goes on and the red and green ones turn off. When the yellow button is pressed, blue turns off and red and green turn on. If the red button is pressed, red turns on and green and blue turn off.

The LED’s I’d be using would be Eastilion 5mm Round head Common Cathode RGB LED Emitting Diodes

My main concerns are: 1) how bad is it that I’m using my signal as a clock pulse. In my head, doing this means that the unneeded outputs get the same clock and are turned off, while the one needed turns on. 2) how many LEDs can I hang to these exits. Do I remember correctly and do I just use 1 resistor of 100 for each color and just parallel them, or should each bulb have its own three resistors?

Thanks for the help

BD9CE333-1BCF-4924-BDA5-FD530A3D6260.jpeg
 

djsfantasi

Joined Apr 11, 2010
9,156
There is a limit to the number of LEDs you can “hang” on each output. It depends on the LEDs specific current draw. Since you have common cathode LEDs, you’ll need to supply them with a high signal to nake them light. Your flip flop IC can’t supply much current when outputting a high signal.

There are many solutions. I am old old school and use a BJT NON transistor to drive the LEDs. Note that properly wired parallel LEDs can be driven by one transistor (properly wired = 1 resistor per LED)

But this requires that s low signal means the LED is on. Not to hard to figure out.

My other comment is your reset logic. I’d use the~Q output, tied with a diode Or circuit to the flip flop of the other colors.

Questions? Ask away. I’m typing this on my phone st breakfast, so there’s a high probability that I made a mistake
 

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
I’d use the~Q output, tied with a diode Or circuit to the flip flop of the other colors.
The problem there is that it’s not that simple. It’s not, when one is on, the others are off all the time. For the yellow light I’ll need to turn on Red AND green. The only thing I thought off, might be that I could need a poti, like i used for the clock, so I don’t get any floating signals.

I will however look into the transistor, I remember those but I’ll need a serious refresher.
 

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
Okay, so a quick review of the given advice has lead me to redraw my plan like this
6D943FB1-006C-4C70-9A15-D01EC54630A1.jpeg

I really looked into the advice to use ~Q, but I can’t really find a logic there, feel free to point it out if I’m missing it. Of important notice is that I. The 74LS175, the Clock inputs of all 4 modules are connected internally. Since the outputs only change when CP gets a rising flank, the only easy way to actually give it that is by using the buttons. Since there might be button vibration going on, it’s too risky to actually use exits to logically decide what the next exit would be. Due to the fact that yellow is allowed to switch back to blue OR switch to red, it’s not an easy logical solution.

I’m still open to see where I made a mistake in that assessment, though.
 

dl324

Joined Mar 30, 2015
16,846
I’m still open to see where I made a mistake in that assessment, though.
What type of switches do you want to use? Switch bounce will be an issue when they're used as a clock to a flip flop that can react to the bouncing contacts.

Trying to have multiple inputs using the 2k trimmer is an unnecessary complication. Just use pulldown resistors on each input and the common clock.

Color coded schematics are distracting...
 

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
What type of switches do you want to use? Switch bounce will be an issue when they're used as a clock to a flip flop that can react to the bouncing contacts.
I figured the whole bouncing contacts might be solved by the fact that the clock signal and the input signal would basically experience the same bounce

Trying to have multiple inputs using the 2k trimmer is an unnecessary complication. Just use pulldown resistors on each input and the common clock.
I’m not sure I understand the difference between the two things you just described. I might have expressed myself wrong since English is my second language and I’m pulling deep from my memories for this stuff. I did mean to say that I’d put one adjustable resistor in front of each input, just like i did for the clock, so they’re grounded.

Color coded schematics are distracting...
Whoops, I’m sorry for that. I needed some color because it helps me sort things out. I’ll upload it in black white next time.
 

philba

Joined Aug 17, 2017
959
Well, another approach would be to get a rotary switch (at least 3 position), skip the flip-flops/transistors and just directly power the leds you want to light up. Not nearly as fun but pretty easy. The circuit shows a 3 position, 2 deck rotary switch, but y ou could get away with a 1 deck switch and use diodes to make sure the right LEDs are powered.
led switch.png
 

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
Well, another approach would be to get a rotary switch (at least 3 position), skip the flip-flops/transistors and just directly power the leds you want to light up. Not nearly as fun but pretty easy. The circuit shows a 3 position, 2 deck rotary switch, but y ou could get away with a 1 deck switch and use diodes to make sure the right LEDs are powered.
View attachment 136415
That is my backup solution. But it’s a visual project that would look better with buttons.
 

Thread Starter

Mandaquila

Joined Oct 3, 2017
7
Okay, thank you all for your comments. I found that I had all the needed components for a test build of my initial idea lying around at work. So for now I build the idea with an SN74LS174 (Same as the 175, but with 6 FlipFlops and no ~Q) and somehow it worked.

Admittedly, the bounce is slightly noticeable from time to time, but all in all it does exactly what I want now. And I thank everyone, since I wouldn’t have been e]able to do it without you guys.

A6951CF4-2A72-4171-B8C7-F57B27B762A8.jpeg
 

dl324

Joined Mar 30, 2015
16,846
Admittedly, the bounce is slightly noticeable from time to time, but all in all it does exactly what I want now.
How is your crew going to react when switch bounce causes the wrong alert status?

If you want a more robust circuit, try this:
upload_2017-10-4_6-0-1.png
This circuit handles the green+red requirement that was buried in your rambling post.
 

AndrewH7

Joined Oct 11, 2017
7
I did design a toy traffic-light circuit many years ago, = a bistable & diodes on the red LED's so as to only conduct 1 way. Now by using the voltage of the input from switch, & output of bistable (÷2) as well as + & - there = red, red + yellow, green & yellow. This be what you're after but using the colours different to have red + green & blue? So could use 2 of your D-flip-flops as ÷ by 2 (Q-D) with 1 following the other. Could use all 3, so as to not use diodes on the reds. O! I read the question as using 1 switch, but you're using 3.
 
Last edited:
Top