Author Topic: how do I get an arduino to run a 24v circuit?  (Read 16819 times)

0 Members and 1 Guest are viewing this topic.

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
how do I get an arduino to run a 24v circuit?
« on: May 18, 2014, 11:33:24 pm »
I am updating a monitor board (by building a new one) that consists of lots of LEDs (around 60).
The board runs from a 24 volt circuit so all the LED's will have 1.2Kohm resistors in series.
I want to be able to build a test unit to plug onto the board and run it with an arduino.
The arduino works on 5v.

Even if I use a number of shift registers (I have enough experience of writing arduino software to drive shift registers) I will still need some way of increasing the output to 24v.
Is it possible to do this with NPN's (I have plenty of C945's) or other NPN/PNPs (I have lots of old boards that are populated with various transistors)?
Alternatively could I do it with FET's?

If not is there any other way I could do it in solid state? If I use relays I will have to buy them (more than 60) and the size of the test unit will be bigger than the board itself.
I have experience of making printed circuit board and building small circuits.

I am aware that 5v will still turn LED's on and I could just run it from 5v (the LED's would be dim but clear enough) I just would like to make the circuit.

Thanks,
Bob.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #1 on: May 18, 2014, 11:45:02 pm »
Well running the leds directly from the arduino at 5v would definitely not be a good idea because you'd likely damage the chips.

If you've got enough transistors or mosfets you could just wire them to the outputs of the shift register I would think.  However I will wait to hear what others think as I'm not an expert in this field but there's several people here who've worked with 24v LED lighting.

Another thing to think about is dedicated LED driver chips.  Ones designed for this sort of thing.
The larger the government, the smaller the citizen.
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #2 on: May 18, 2014, 11:51:59 pm »
Code: [Select]
Well running the leds directly from the arduino at 5v would definitely not be a good idea because you'd likely damage the chips.Which chips?
Code: [Select]
Another thing to think about is dedicated LED driver chips.  Ones designed for this sort of thing.I was wanting to use transistors, I have plenty of them.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: how do I get an arduino to run a 24v circuit?
« Reply #3 on: May 18, 2014, 11:59:00 pm »
Use a transistor array to save space (eg, ULN2003)

Or discrete transistors if you prefer.

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #4 on: May 19, 2014, 12:02:35 am »
(In reply to the previous question before the schematic was posted)
Most like the chip the LED is connected to directly without something in between to handle the voltage.

So at 1.2k and 24V you're giving 20mA per LED or .48 Watts. So the first thing would be make sure your transistors are up to it.
Checking a sample datasheet https://www.fairchildsemi.com/ds/KS/KSC945.pdf makes it look like (to me at least) that you need a beefier transitor.  This one looks like it only will handle about 50% of the wattage you need if I read it correctly.
« Last Edit: May 19, 2014, 12:05:09 am by Stonent »
The larger the government, the smaller the citizen.
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #5 on: May 19, 2014, 12:13:19 am »
do you think it would be as easy as that sleemanj? What do you think RBase would be?
I will have to try it next time I am in my workshop(tomorrow maybe).


Stonent
Code: [Select]
Most like the chip the LED is connected to directly without something in between to handle the voltage.I don't understand this?

Code: [Select]
So the first thing would be make sure your transistors are up to it.Your link shows a collector current of 150mA, I only need 20mA?
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: how do I get an arduino to run a 24v circuit?
« Reply #6 on: May 19, 2014, 12:14:56 am »
24V and 1K2 series resistor implies that you are running 20mA through each LED.
An ordinary shift register like a 74HC595 will handle only 5mA at the outputs. Clearly that is not suitable for your circuit.
However, a high-power shift register like TPIC6B595 can handle 150mA at each output which would easily handle your circuit.

Note that virtually all microcontroller-controlled circuits like this have the "top" of the load connected to the supply voltage (24V in your case),
and then the "bottom" side of the load (the anodes of your LEDs) is connected to ground through a transistor to turn it on.
This is illustrated in sleemanj's post above.
Your panel must use this scheme ("low-side switching") in order to use most microcontroller circuits.
Switching the "top side" (the 24V) is possible, but the circuit is much more complex which is why we rarely do it that way.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #7 on: May 19, 2014, 12:16:15 am »
do you think it would be as easy as that sleemanj? What do you think RBase would be?
I will have to try it next time I am in my workshop(tomorrow maybe).


Stonent
Code: [Select]
Most like the chip the LED is connected to directly without something in between to handle the voltage.I don't understand this?

Code: [Select]
So the first thing would be make sure your transistors are up to it.Your link shows a collector current of 150mA I only need 20mA?

I was looking at the 250mW part, you need about 2x that. 

In regards to the chip, if each LED is using 24V and 20mA you're going to overheat or damage a shift register or whatever other logic device is there so you definitely would want a transistor or something there.
The larger the government, the smaller the citizen.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #8 on: May 19, 2014, 12:18:58 am »
24V and 1K2 series resistor implies that you are running 20mA through each LED.
An ordinary shift register like a 74HC595 will handle only 5mA at the outputs. Clearly that is not suitable for your circuit.
However, a high-power shift register like TPIC6B595 can handle 150mA at each output which would easily handle your circuit.

Note that virtually all microcontroller-controlled circuits like this have the "top" of the load connected to the supply voltage (24V in your case),
and then the "bottom" side of the load (the anodes of your LEDs) is connected to ground through a transistor to turn it on.
This is illustrated in sleemanj's post above.
Your panel must use this scheme ("low-side switching") in order to use most microcontroller circuits.
Switching the "top side" (the 24V) is possible, but the circuit is much more complex which is why we rarely do it that way.

Here's a sample circuit I found to drive an 8x8x8 LED cube using the tpic6b595. Not saying it's the exact circuit to use for this, but an example of one way to drive a lot of leds from an arduino that need more current.

The larger the government, the smaller the citizen.
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7992
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #9 on: May 19, 2014, 12:21:21 am »
(In reply to the previous question before the schematic was posted)
Most like the chip the LED is connected to directly without something in between to handle the voltage.

So at 1.2k and 24V you're giving 20mA per LED or .48 Watts. So the first thing would be make sure your transistors are up to it.
Checking a sample datasheet https://www.fairchildsemi.com/ds/KS/KSC945.pdf makes it look like (to me at least) that you need a beefier transitor.  This one looks like it only will handle about 50% of the wattage you need if I read it correctly.

Power dissipated in the load is not the same thing as power dissipated in the transistor. It should be a handful of milliwatts at most, not hundreds.
« Last Edit: May 19, 2014, 12:26:59 am by Monkeh »
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #10 on: May 19, 2014, 12:22:14 am »
I don't think I explained myself there. The shift register would be the driver and as such go to the base of the transistor. I would need more outputs than the arduino could provide, hence the need for the shift registers.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: how do I get an arduino to run a 24v circuit?
« Reply #11 on: May 19, 2014, 12:24:43 am »
Stonent, and Richard Crowley seem a little confused.

If you are passing 20mA over a 1.2k resistor the drop over the resistor itself is 24v (Ohm's Law), so that's already a contradiction, you can't get 20mA through your Resistor AND LED (and transistor) with a 24v supply and 1k2 resistor and ANY led.  LED's have a forward voltage drop, so you don't have 24v over that resistor any more.

The power dissipated in the transistor is of course determined by the voltage drop across the transistor and the current through the transistor, it cares not what the voltage drops above or below it is, only across it.

You of course don't need the led resistor at all, if your transistor can handle the full (24-VfwdLED)*Current power, and you select RBase appropriately. 

It sounds like you don't know a lot about transistors (or, anything), so I recommend you to have a bit of a study about Bipolar Junction Transistors, try this video: http://youtu.be/ZEDdFjvnAAo
« Last Edit: May 19, 2014, 12:28:31 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #12 on: May 19, 2014, 12:26:48 am »
(In reply to the previous question before the schematic was posted)
Most like the chip the LED is connected to directly without something in between to handle the voltage.

So at 1.2k and 24V you're giving 20mA per LED or .48 Watts. So the first thing would be make sure your transistors are up to it.
Checking a sample datasheet https://www.fairchildsemi.com/ds/KS/KSC945.pdf makes it look like (to me at least) that you need a beefier transitor.  This one looks like it only will handle about 50% of the wattage you need if I read it correctly.

Power dissipated in the load is not the same thing as power dissipated in the transistor. It should be a handful of milliwatts, not hundreds.

Ok thanks for clearing that up.
The larger the government, the smaller the citizen.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: how do I get an arduino to run a 24v circuit?
« Reply #13 on: May 19, 2014, 12:27:51 am »
With the TPIC6B595, you don't need a separate transistor. It is built into the TPIC6B595.

Ohm's law says that the current through any part in the circuit is the same everywhere.
Since matelot did not reveal all the necessary specifications (like the forward voltage of his LEDs), we used the stated voltage and current as a rough estimate to see what ballpark he is playing in.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: how do I get an arduino to run a 24v circuit?
« Reply #14 on: May 19, 2014, 12:30:16 am »
Ohm's law says that the current through any part in the circuit is the same everywhere.

No it doesn't.

Kirchoff's Current Law does.

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #15 on: May 19, 2014, 12:33:25 am »
Code: [Select]
Since matelot did not reveal all the necessary specifications (like the forward voltage of his LEDs),???
The LED's require 20mA max to give full brightness, to achieve this with 24v I need a 1.2k resistor in series. OHM's law.
what forward voltage do you need?
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: how do I get an arduino to run a 24v circuit?
« Reply #16 on: May 19, 2014, 12:34:34 am »
Code: [Select]
Since matelot did not reveal all the necessary specifications (like the forward voltage of his LEDs),???
The LED's require 20mA max to give full brightness, to achieve this with 24v I need a 1.2k resistor in series.
what forward voltage do you need?

Find out forward voltage of LED.
Determine voltage drop across resistor.
Apply Ohm's Law.
« Last Edit: May 19, 2014, 12:36:18 am by sleemanj »
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: how do I get an arduino to run a 24v circuit?
« Reply #17 on: May 19, 2014, 12:35:18 am »
Bzzzt,  yes I got the name of the Law wrong. But the facts remain the same.  Apologies to Dr. Kirchhoff.

Using the supply voltage and the current limiting resistor gives us a worst-case design point to use for specifying the rest of the circuit.
So it doesn't really matter what the forward voltage of the LED is at this level of circuit design.

The TPIC6B595 is MADE for this kind of application. It is a big favorite in the Arduino community for exactly this reason.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: how do I get an arduino to run a 24v circuit?
« Reply #18 on: May 19, 2014, 12:36:22 am »
I don't think I explained myself there. The shift register would be the driver and as such go to the base of the transistor. I would need more outputs than the arduino could provide, hence the need for the shift registers.

I understand. I was just clarifying connecting the LEDs directly to the shift register could damage the shift register unless it is rated for what you're trying to do. If you're just using it to control a transistor you're not going to have that problem.
The larger the government, the smaller the citizen.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: how do I get an arduino to run a 24v circuit?
« Reply #19 on: May 19, 2014, 12:38:51 am »
Code: [Select]
Since matelot did not reveal all the necessary specifications (like the forward voltage of his LEDs),???
The LED's require 20mA max to give full brightness, to achieve this with 24v I need a 1.2k resistor in series. OHM's law.
what forward voltage do you need?

Different colors (and even different constructions of the same color) LEDs exhibit quite different forward voltages at their designed operating point. It is necessary to take this forward voltage drop into account when calculating the current-limiting resistor.  Apparently someone else knew the forward voltage and made this calculation for you and handed you the resistor value for 24V.  But that doesn't help much if you have to design for a different supply voltage.  That is why the forward voltage is specified, so you can do the calculation for yourself, and not have it handed to you by others.
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #20 on: May 19, 2014, 12:41:34 am »
The data sheet shows 20mA for the LED.
sleemanj, what do you suggest the RBase would be on your schematic?
« Last Edit: May 19, 2014, 12:43:12 am by matelot »
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: how do I get an arduino to run a 24v circuit?
« Reply #21 on: May 19, 2014, 12:45:37 am »
sleemanj, what do you suggest the RBase would be on your schematic?

The base resistor is selected to feed enough current into the transistor to turn it on.
We typically feed more than enough current to ensure that the transistor is in "saturation" and not dissipating any power itself.
All transistors have published "current gain" or hFE values.
If you need to switch 20mA, and you have a transistor with a gain of 100, then you need at least 200uA into the base.
You can use Ohm's law to calculate the resistance needed to shove 200uA from a 5V source (i.e. the Arduino output).
 

Offline matelotTopic starter

  • Newbie
  • Posts: 7
  • Country: gb
Re: how do I get an arduino to run a 24v circuit?
« Reply #22 on: May 19, 2014, 12:52:14 am »
ok thanks for the help I will try that tomorrow.
 
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf