Author Topic: Need help designing a load selector!  (Read 4721 times)

0 Members and 1 Guest are viewing this topic.

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Need help designing a load selector!
« on: May 29, 2020, 05:58:08 pm »
So, I’m stuck. I’m trying to control LEDs using a decade counter that drives some transistors, but I just can’t seem to get it right. I need help!

What I’m trying to accomplish is a circuit that controls a set of LEDs in such a way that if you press a button, the counter would trigger the next output and illuminate the next LED in the sequence (of course through a transistor, since the chips themselves can’t directly drive heavier loads more than about 10mA). Here is the sequence I am going for:
Red, Green, Blue, RGB, Off.

Im using the transformer of a small digital alarm clock, and since I want to run both the clock and the LED circuit on one transformer, I need to keep the power consumption of the LED driver circuit as low as possible.

My theoretical idea was that by using a resettable decade counter, I could have one input and several outputs, which the counter would progress to the next output in the sequence when I pressed the button. I would use the secondary counter, controlled by the final output, to reset the counter and turn all LEDs off until the button is pressed again.

“You stupid fool, use a Raspberry Pi or an Arduino!” Well I would but I do not have one. Besides, I’d like to get more into logic circuits and the raw functionality of them.

I don’t have schematics that are useable. The two failed attempts to draw a schematic had the logic improperly wired, it wouldn’t work as I expected it to when I breadboarded the circuits.

The logic chips I have in my inventory that I could use are:
Ne555 (x2)
74LS74A
CD4094BE
MC14520 (that’s the decade counter I tried to use)
SN74196N (x2, and those are also decade counters)
74LS157N
MC14013B
HEF4053BP
SN74LS123N

I appreciate your help.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #1 on: May 29, 2020, 07:32:39 pm »
Okay.  I'll take a wack at it.
Without any logic gates, you will need to press the switch 5 times to get it started.
And there may be an "All Off" state before it starts over?

 
The following users thanked this post: WyverntekGameRepairs

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #2 on: May 29, 2020, 07:47:07 pm »
Okay.  I'll take a wack at it.
Without any logic gates, you will need to press the switch 5 times to get it started.
And there may be an "All Off" state before it starts over?

(Attachment Link)

Let me build this circuit and see if it works.
And yes, I’m hoping that it has an “all off” before the cycle repeats.

Also, I have an additional output for the colour-changing RGB LEDs, you probably didn’t notice that listed. I listed it as RGB.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #3 on: May 29, 2020, 07:49:42 pm »
If you use the SN74196 counter "Load" feature to preset the value to '4' would get
it to start up with the Red LED being ON.

Use an RC time constant on the LOAD pin at power ON to do the preset.
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #4 on: May 29, 2020, 07:53:35 pm »
I’m assuming that it would be wired differently too?
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #5 on: May 29, 2020, 08:25:22 pm »
Round #2:

I'm not very familiar with the RGB LEDs.

Edit:  Switch protection
« Last Edit: May 29, 2020, 08:34:12 pm by MarkF »
 
The following users thanked this post: WyverntekGameRepairs

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #6 on: May 29, 2020, 08:30:47 pm »
Round #2:

I'm not very familiar with the RGB LEDs.

(Attachment Link)

Breadboarded the first circuit, and nothing. I get what it’s theoretically trying to do, but it just didn’t work.
The RGB LEDs im using are like regular LEDs, these just have integrated circuitry that drives the colour changing effect with the internal diodes. It has the same anode and cathode as regular LEDs.

All right, going to bb Round 2.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #7 on: May 29, 2020, 08:59:10 pm »
Round #3:

I don't think the logic around the Flip-Flop is correct.
It's always going to preset 'Q' high.

You might try playing around using the clock, Q and Q' to get a single high pulse to start.

You really need a couple logic gates:  Inverter, NAND, etc. to form the high for one clock.
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #8 on: May 29, 2020, 09:12:11 pm »
Hmmm...
I don’t have any inverters or NAND gates lying around. I do have some transistors, maybe a PNP transistor that’s negatively biased could serve as an inverter?
« Last Edit: May 29, 2020, 09:20:26 pm by WyverntekGameRepairs »
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #9 on: May 29, 2020, 09:30:51 pm »
Wait a sec! Hol up. What if we could omit the BDC completely? Here’s my thought: Use the bit shift register itself. Pressing the button sends a clock pulse, causing the output to shift to the next bit in the sequence. We just need some way for the register to get the initial data pulse we need, and let it be able to send the pulse again after the bit reaches a certain point.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #10 on: May 29, 2020, 09:51:22 pm »
Wait a sec! Hol up. What if we could omit the BDC completely? Here’s my thought: Use the bit shift register itself. Pressing the button sends a clock pulse, causing the output to shift to the next bit in the sequence. We just need some way for the register to get the initial data pulse we need, and let it be able to send the pulse again after the bit reaches a certain point.

Bingo!   You have the idea and my two failed attempts at it to get the initial bit for just one button press.

Here's my last attempt if this counts to five.  It is a decade counter after all (÷2 and ÷5).,
Hopefully, it counts: 0, 1, 2, 3, 4, 0, etc and we can use the '4' to start another 'high' through the shift register.



Timing:

« Last Edit: May 29, 2020, 10:26:55 pm by MarkF »
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #11 on: May 29, 2020, 09:59:30 pm »
Whoooo! Here we go, bbing this one now... wish me luck.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #12 on: May 29, 2020, 10:17:04 pm »
Aaaaand unfortunately nothing.
I am thinking that my resistors aren’t a good rating. I’m also using 6v regulated, but a single volt shouldn’t do any harm as these are rated from -0.5V to +18V according to the data sheet.

I have the LED’s resistors at a value of 4.7k. What do you suggest for the resistors on the switch?
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #13 on: May 29, 2020, 10:33:31 pm »
The SN74196 can ONLY handle 5V.  Check the datasheet: It may go to 5.5V max.
You have a mixture of CMOS and TTL logic listed.

Your resistors are far to big.
   R = V / I

   R = (5 - 1.5) / 20mA = 175Ω

Let's start with 200Ω.  Each LED color will have a different Vf so you will need to tweak each to get the intensity to match.  The RGB LED may NOT need a resistor (check its datasheet).


Connect each LED to 5V through 200Ω to test each before connecting them to the circuit.
« Last Edit: May 29, 2020, 10:42:30 pm by MarkF »
 
The following users thanked this post: WyverntekGameRepairs

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #14 on: May 29, 2020, 10:53:18 pm »
WAIT WAIT WAIT
I found a 74LS00 and 74LS20N - NAND gates!!
Maybe this will make things easier? Unless this works, that is, in which case we won’t need these. But if it doesn’t work, we now have some NAND gates we can use.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #15 on: May 29, 2020, 11:16:50 pm »
One of your counter chips will give you 4 bit binary count.
You can use the NAND gate(s) to create the 'Data' input to the shift register.
Refer to the timing diagram I added a few posts back.
 
The following users thanked this post: WyverntekGameRepairs

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #16 on: May 29, 2020, 11:42:06 pm »
All right. So what is the schematic looking like now?
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #17 on: May 29, 2020, 11:53:38 pm »
Maybe some partial testing is needed here.

Take the last circuit posted and remove the SN74196 decade counter.

Testing the CD4094 and LEDs:

Then manually clock in all 1's followed by all 0's and verify the shift register and LEDs are working.
  - Tie 'Data' pin (2) high.
  - Press the switch five times.  (all LEDs should turn 'On' one at a time)
  - Tie 'Data' pin (2) low.
  - Press the switch five more times.  (all LEDs should turn 'Off' one at a time)

Then, you can figure out the logic to generate the 'Data' input signal.
 
The following users thanked this post: WyverntekGameRepairs

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #18 on: May 30, 2020, 12:02:41 am »
I found an error:

   The Output Enable (pin 15) and Stobe (pin 1) both need to be 'High'.

   I have the wrong chip on the drawing.
 
The following users thanked this post: WyverntekGameRepairs

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #19 on: May 30, 2020, 01:05:59 am »
It appears that I miss-read you original post several times....

You never ask to have ALL LEDs On at one time.  Just sequence through and one all Off state.

I think I fixed the startup initialization.  The RC time constant may be too short for the LOAD pin.

« Last Edit: May 30, 2020, 02:06:24 am by MarkF »
 
The following users thanked this post: WyverntekGameRepairs

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #20 on: May 30, 2020, 01:27:51 am »
It appears that I miss-read you original post several times....

You never ask to have ALL LEDs On at one time.  Just sequence through and one all Off state.

I think I fixed the startup initialization.  The RC time constant may be too short for the LOAD pin.

(Attachment Link)

998342-0
You also kinda messed that up. I don’t recall the 74196n being a 20 pin chip... lol :D

Edit: You also have a pin 18 and 16 on the ic. The chip isn’t 20 pin, it’s 14 pin.
« Last Edit: May 30, 2020, 01:58:22 am by WyverntekGameRepairs »
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #21 on: May 30, 2020, 02:07:55 am »
Schematic updated.
I picked the wrong component out of the library.   :palm:
 

Offline WyverntekGameRepairsTopic starter

  • Regular Contributor
  • *
  • Posts: 118
  • Country: us
  • MAKE: My Day
Re: Need help designing a load selector!
« Reply #22 on: May 30, 2020, 05:57:17 pm »
I just had a thought. What if we used an AND gate (I’ve ordered some) on Q12 of the multivibrator? Connecting that output to the AND A1 and the button to the AND A2 could allow a pulse to be sent after the 1 bit reaches the end of the chain.
That just leaves us with the startup triggering. It is possible that a 555 timer could be used to make a one-trigger latch. Something that, when the system turns on, triggers the timer - but when the button is pressed and the data pin no longer needs to be held HIGH, the timer deactivates until the power to it is completely removed.
-Sterling Ordes
Wyverntek Game Repairs
(Business License Pending)
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #23 on: May 31, 2020, 07:34:10 pm »
I did a little checking of the  CD4094B  datasheet.
It appears it can only source -1mA of current (not enough for LEDs).
Disconnect the LEDs, then check the outputs with a Multimeter to verify the circuit.

A popular shift register used to extend Arduino outputs is the  SN74HC595.
It would be able to drive the LEDs. 
The RGB LED may be a special case. I don't know what its current requirements are.
 
The following users thanked this post: WyverntekGameRepairs

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2764
  • Country: us
Re: Need help designing a load selector!
« Reply #24 on: May 31, 2020, 07:39:46 pm »
Another option to drive the LEDs is the  ULN2003B  darlington transistor array.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf