High Side Switch from Arduino to 12V+ LEDs

Thread Starter

mxabeles

Joined Apr 25, 2009
295
The 4017 has 10 states and 10 outputs. With 1-8 used to drive 8 LEDs, states 9 and 10 leave all LEDs off. So, with no additional hardware, and only 1 Arduino pin, you can do everything you are trying to do with an additional Arduino pin and an extra high side switch.
Ah I'm strobing them on and off synced to music and other bells & whistles via software - so basically the Arduino is strobing the 4017 chaser to music. Just having them "off" for a pulse in the sequence wouldn't be the effect I'm after.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
295
Yes...in theory.

Small signal diodes with the anodes toward the 4017.

Please test this before making any kind of commitment.
Ah got it - I tried it earlier with the diodes facing wrong direction lol. I may test it again, but I think I'm going with electromagnetic relay as high side switch. Less soldering than diode on each output, and it withstood over half an hour of brutal strobing. Hopefully contact welding won't happen with such a comparatively light load - they welded up previously when I was pulsing T5 tubes that run on wall power, and multiples chained together. Also I desoldered the relays from the throw away "module" I got off Amazon.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
295
Is there a way to close a thread? I'm going with electromagnetic relay as high side switch. It passed test earlier tonight. Thanks everyone for feedback. Wishing all a great night!
 

Ian0

Joined Aug 7, 2020
13,158
Which version of Arduino are you trying to use? Because most can be powered with the 12V, then you can use the 5V supply pin to power the 4017. Also, The COM pin should be on 12+ on the ULN2803.

The output of the 4017 should sink current so just the logic voltage is driving the uln2803. That is why the output doesn't go out. This is how the output of the 4017 should be loaded:
View attachment 321916
A CMOS logic gate already has a pulldown transistor. There is no need for an additional pulldown resistor.
The ULN2803 already has one.
https://www.ti.com/lit/ds/symlink/uln2803c.pdf?ts=1715191664427
See section 7.2
With no input connection, the ULN2803 is always off.
 

LadySpark

Joined Feb 7, 2024
194
A CMOS logic gate already has a pulldown transistor. There is no need for an additional pulldown resistor.
The ULN2803 already has one.
OK, its not often I see 4000 series into a TTL chip. But I would think the Low logic coming out would need something since their low is always near the threshold of a transistor. But the Uln 2803 has a series resistor on the base which is the normal solution to interfacing 4000 series with a transistor. It almost makes me think there is some sort of logic level shift issue caused by running the logic off an external 5V regulator, which you don't normally do with an Arduino board. Normally, you use its 5V out and Vcc out since its powered by 12V. Technically, it shouldn't matter unless the grounds are not connected from board to the digital logic.
 

BobTPH

Joined Jun 5, 2013
11,567
Ah I'm strobing them on and off synced to music and other bells & whistles via software - so basically the Arduino is strobing the 4017 chaser to music. Just having them "off" for a pulse in the sequence wouldn't be the effect I'm after.
Okay, I give up. Apparently you cannot even conceive that you can do what you want with what you already have.
 

ElectricSpidey

Joined Dec 2, 2017
3,340
I'm not sure the effect can be produced without a switch.

I'm thinking every time the music turns on the display the output will be at a random place.

Easy to do if the Arduino was driving all 8 channels of the load driver, but with a 4017 not so much.

Now if the output can always start from say...output #1 that would be doable.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
295
Okay, I give up. Apparently you cannot even conceive that you can do what you want with what you already have.
How am I supposed to have the LEDs i/o synced to complex musical events that must be arranged in software, with a 4017 and one Arduino pin? Please, I'm waiting with baited breath for this explanation. Take as much space and time as you want. I should add that I do not code Arduino's - I upload StandardFirmata to board and code in MaxMSP. That's non-negotiable for me, in my experience the visual object oriented language of MaxMSP is exponentially easier than Arduino IDE.
 

Thread Starter

mxabeles

Joined Apr 25, 2009
295
I'm not sure the effect can be produced without a switch.

I'm thinking every time the music turns on the display the output will be at a random place.

Easy to do if the Arduino was driving all 8 channels of the load driver, but with a 4017 not so much.

Now if the output can always start from say...output #1 that would be doable.
Yes, this. Thanks!
 

AnalogKid

Joined Aug 1, 2013
12,174
I haven't plowed through the entire thread, so this might already have been covered.

Do the LEDs need current-limiting? Also, what is the desired LED operating current?

ak
 

Thread Starter

mxabeles

Joined Apr 25, 2009
295
I haven't plowed through the entire thread, so this might already have been covered.

Do the LEDs need current-limiting? Also, what is the desired LED operating current?

ak
Thank you friend, but I got a solution - electromagnetic relay as high side switch.
 

AnalogKid

Joined Aug 1, 2013
12,174
Thank you friend, but I got a solution - electromagnetic relay as high side switch.
OR - because you are using a ULN2803 as the LED driver, you can in fact use a low side switch, a single MOSFET between the 2803 ground pin and the actual circuit GND. No relay, no relay driver, no suppression diode . . .

What is the voltage range on the Arduino GPIO pin in output mode?

Schematic later.

ak
 

AnalogKid

Joined Aug 1, 2013
12,174
Here is a first-pass at an alternate view of the problem, adapted from something I posted in another thread in 2019. The circuit also works with the ULN2003.

Most of this schematic is your drawing re-drawn (and expanded to 8 LEDs).

When PIN11 is low, Q1 is off and there is no current path to GND for any 2803 output. Q1 and R1 can be replaced by a logic-level n-channel MOSFET. The nice thing about a low-side switch is that you do not need to translate the Arduino output up to 12 V.

R2 is included in case the LEDs need current limiting. There is only one resistor because only one LED is on at any given time.

ak


!!LED-Chaser-Switch-1-c.gif
 
Last edited:

Thread Starter

mxabeles

Joined Apr 25, 2009
295
Here is a first-pass at an alternate view of the problem, adapted from something I posted in another thread in 2019. The circuit also works with the ULN2003.

Most of this schematic is your drawing re-drawn (and expanded to 8 LEDs).

When PIN11 is low, Q1 is off and there is no current path to GND for any 2803 output. Q1 and R1 can be replaced by a logic-level n-channel MOSFET. The nice thing about a low-side switch is that you do not need to translate the Arduino output up to 12 V.

R2 is included in case the LEDs need current limiting. There is only one resistor because only one LED is on at any given time.

ak


View attachment 321978
Hey, thanks!
 

ElectricSpidey

Joined Dec 2, 2017
3,340
Here is a first-pass at an alternate view of the problem, adapted from something I posted in another thread in 2019. The circuit also works with the ULN2003.

Most of this schematic is your drawing re-drawn (and expanded to 8 LEDs).

When PIN11 is low, Q1 is off and there is no current path to GND for any 2803 output. Q1 and R1 can be replaced by a logic-level n-channel MOSFET. The nice thing about a low-side switch is that you do not need to translate the Arduino output up to 12 V.

R2 is included in case the LEDs need current limiting. There is only one resistor because only one LED is on at any given time.

ak


View attachment 321980
Except this circuit won't work due to the pulldown resistors and the parasitic diodes in the load driver.

You have seven of the 4017 outputs pulled to ground, this has the effect of pulling the shared emitters somewhat to ground.

The resistors alone provide a 1.8k ohm path.

1715282680260.png

The OP already tried this, I suggested placing diodes in series with the 4017 outputs, but they have decided to go another way.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
12,174
Hmmm - not all datasheets show that diode. Double-checking, I have one sheet that does, but it gives no information about its characteristics. Still, nice catch.

ak
 

BobTPH

Joined Jun 5, 2013
11,567
How am I supposed to have the LEDs i/o synced to complex musical events that must be arranged in software, with a 4017 and one Arduino pin?
Since the Arduino is clocking the 4017, it can keep track of what state the 4017 it is in.

It can then put it in any other state, simply by supplying very fast clock pulses, so fast they could not be perceived by the eye.

I would use the freed up Arduino pin as an input connected to, say Q0 or whatever is the reset state so you can re-sync just in case it gets out if sync.

This gives you the ability to set any LED as the active one, or all off any time you like.

Does this help?
 

LadySpark

Joined Feb 7, 2024
194
Okay, I give up. Apparently you cannot even conceive that you can do what you want with what you already have.
At times it makes me think they started this to see if theirs a solution to it. Because I have never seen anyone use a ULN2003 or a ULN2803 with 4000 gate logic (commercially). Its always been 74xx000 series logic. Because the low on a 4000 logic gate will bias them on. But to verify this, they need to make a voltage measurement to see what volts their low is. Even if the ULN2803 has a 2.7K on its base, I still wonder if another 1K in series, or a 1K to gnd would change the low logic behavior,
 
Top