How to make 32 LED's each come on 1@a time for 3 sec each?

Dear people, I am conducting research at the University of Southampton, UK. I am building a device featuring 32 LEDs...each in the 450-500 lumen, 250mA range. The power source is a 15w 42v 350mADC constant current. I need the ability to either be able to manually turn on each LED individual for...oh...say a 3-5 second count, or program the array somehow so that each one will come on for 3-5 seconds, and then shut off, followed by the next one...and so fourth. Somebody mentioned Arduino might be the perfect solution. I have never heard of this. I am reasonable fluent in electronics, but the last time I worked with 'computer program language' was the 1980's and a language called "basic" lol (Anybody out there remember that? :) Am I at the right place to find help to build this thing??




this project should be pretty simple. I am an old Applesoft-Basic (started programming in 1980) guy and I turned to Arduino a few weeks ago. Pretty simple transfer.

Here's how I'd start:

  • Have a look at and test it with LOW POWER leds
  • when you have that working try with more leds
  • find a solution through electronics to get enough power for your leds (as not to blow up your Arduino)

It is like the old joke, when asking for directions to a small village the local replied, well if I was going there I wouldn’t start from here.

You have a high current LED which you rightly drive with a constant current supply. But then you want to switch which one of a lot of LEDs this goes through. Normally you would use a multiplexer but that will not provide you with enough current, so you need a multiplexer driving a FET or transistor for each LED. This would then switch one of the LEDs to to power supply.
That is a lot of electronics to wire up.

The arduino control program is quite trivial in comparison.

You can not directly control 32 LEDs with Arduino, a it does not have that many I/O pins. The eay work around would be to use 4 74HC595 shift regiters, the you just have your Arduino send 4 bytes of data to the shiftregisters eachtime you need to change which LED i on.

Look in the playground for 595 sample code, it should be fairly imple to do what you want.

A few things you should consider:

Is the time interval between each LEd beeing on always the same? Do you ever need to have more than one LED on at a time ? (if so you might need a beefer powersupply)

MikMo: You can not directly control 32 LEDs with Arduino, a it does not have that many I/O pins.

Oh yes you can: Arduino Mega (but that doesn't solve the power problem)

It appears I have stumbled upon people here in the know. So I shall simply divulge the nature of the work and see if people have a better idea. What I am doing is conducting research in underwater Reflectance Transformation Imaging. I take a camera and I mount it in an 'umbrella-like' frame of 8 semi-circle arms. The object to be photographed is directly below the camera (center of the '8 arm dome' at a focal distance of about 40-50 cm). Mounted to each arm is 4 LED lights. One mounted at...oh about 45 degree mark and 3 more 5-10 degree increments below the first. The camera remains motionless...the object remains motionless... and the camera starts firing away pictures on an auto take setting (1 pic ever 2 seconds, roughly). This generates a set of identical pictures with light coming from 32 distinctly different angles. By changing the angle/position of the incoming light source... we can then import the photos into a processing software that can create mathematical '3D' texture of the object surface. To this texture, we can then apply 'transformations' and digitally modify the output for research and analysis purposes. I have to be able to control these 32 LEDs. It can be as simple as a piece of plywood with 32 push-button switches and I manually turn every single one on and off. I am prepared to go to hardware store and rig this if I must. My next thought was to wire the LEDs in 'banks' and control them by a manual rotary switch. But what would be wonderful... is if I could digitally control them so that they jus go through a cycle of each one coming on and off...3-5 seconds (which assures that at my shutter rate of 1 pic per 2 seconds gets a usable picture from each LED position). So now you have my true objective and dilemma. I look forward to your input. :)

Since the LEDs require more current than the Arduino can provide, you'll need the Arduino to control a switch rather than power the LEDs directly. This means using external hardware taking a logic level control signal from the Arduino and supplying a controlled current to a given LED.

Given that you only want to turn on one LED at a time, I think the simplest way to achieve that would be to wire the LEDs in a 6x6 matrix and control that using 12 transistors e.g. six connecting the rows to V+ and six connecting the cols to GND. If you know that only one LED will be powered at a time then you could get away with a single current limiting resistor, if you want the potential to switch on combinations then you'd need a resistor per LED.

You might look into things like digital LED strips. I was just looking at Adafruit and noticed they have various strips of LEDs that are made for costumes that you can control each LED with only two pins from the Adruino. This strip with 32 leds per meter is not at the power level that you want, but if you look around, you might be able find variants at the level you want:

It appears I have stumbled upon people here in the know.

Could have fooled me. They all seem to have missed the point that you are wanting to pull about 250mA through each of the LEDs and therefore, quite rightly, you have chosen to use a constant current supply. You can not use a current limiting resistor for this amount of current. As far as I can see only my answer addresses your problem.

It sounds an interesting application. Are you going to get the arduino to trigger the shutter as well so the whole thing will be synchronised?

If you can figure out how to do it with pushbutton switches, porting it to the Arduino is going to be the easy part. You just replace each of your switches with a transistor of some kind or an IC driver or a relay. I wouldn’t be able to do more than guess how you’re going to do it efficiently in hardware, because I have very little experience with constant current power supply. But I could easily make a design with 32 relays. Maybe not efficient and not the cheapest way to go, but guaranteed to work.

I really appreciate all the input. It would appear this thing is a bit more complicated than I'd hoped. This is a masters dissertation project for and MA in Maritime Archaeology at the University of Southampton's archaeological department. The technology is called "Reflectance Transformation Imaging" and it has been around a while but only done on the surface, never underwater. I am a technical scuba diver and a recreational diving instructor. I decided to attempt to take this technology sub-aquatic. It really is not terribly complicated in the execution phase. (I'm not writing software codes or creating new technologies. I'm simply taking a basic concept and attempting it underwater.) The implications, however, are very significant. Huge...actually. The professors here would like to see a 'controlled experiment in a water tank' to go with the research. So this umbrella light dome will be sitting in less than a meter of fresh water. I'm not even planning to seal the electronics from electrolysis! (well...I might attempt to silicone things really good in truth, recognizing this is short term.) The LEDs will only be on for a few seconds at a time and I believe (hope??) the device will survive a couple of weeks to gather the data I need for that portion of the research. To answer all the questions... 1 LED at a time, same amount of time each one, same current/voltage drop across each one. My electrical understanding is limited to wiring a house...and if I go back 25 years to a Heathkit-Zenith correspondence course.. I am able to apply Ohm's Law to a series, parallel, or combination circuit to figure out voltage drops across the loads and current through the branches. That is about it lol. So when somebody says 'the easy part....' that is a very relative term. I have 40 of these LED's. I had to order them from a supplier here in England who got them from a distributor in China... by the time I paid the rush fees and whatnot.. they cost about $300 US. The amount of current and voltage that must pass over each of these LED's is in a specific range to create a specific amount of lumens. These little LEDs are massive in terms of their light output. I'm going to get between 400-500 lumens per LED. But even the 42V 350mA constant current power supply I bought is enough to fry them. Therefore, once again going back to my electronics home study course 25 years ago, I believe that I need a resister in parallel to syphon off some of the current, and resister in series to drop off some of the voltage. I have been trying to get an answer as to exactly HOW do I wire this circuit to achieve my goals? I have attached a PDF explaining my situation in layman's terms (the only terms I can use haha :) and the first person who can answer this will be happily cited in the acknowledgments section of this masters dissertation! :) Oh crap, I thought I could insert a document. Apparently I cannot. Ok... I put three documents in a 'Google drive' folder. One is labeled 'blog diagram' and it explains my situation. The other two are the spec sheets on the LED and power supply. Here is the link:

But even the 42V 350mA constant current power supply I bought is enough to fry them.

Yes of course it is. You have an LED with an absolute maximum current of 240mA and you push 350mA through it then yes it will fry. You should never run components at the absolute rating, the data sheet says they were designed to run at 120mA. So basically you have the wrong sort of constant current supply.

I believe that I need a resister in parallel to syphon off some of the current, and resister in series to drop off some of the voltage.

While that might look like it is a solution it is not very good or stable. LEDs are none linear devices so that means they do not obey ohms law. You need a constant current supply of the correct current, that is 120mA. You can buy one or make one. Here are some chips that contain constant current drives up to 120mA:-||,&filtersHidden=false&appliedHidden=false&autoApply=true&originalQueryURL=%2Fjsp%2Fsearch%2Fbrowse.jsp%3FN%3D2031%2B202729%26Ntk%3Dgensearch%26Ntt%3Dconstant%2Bcurrent%26Ntx%3Dmode%2Bmatchallpartial%26No%3D0%26getResults%3Dtrue%26appliedparametrics%3Dtrue%26locale%3Den_UK%26divisionLocale%3Den_UK%26catalogId%3D%26skipManufacturer%3Dfalse%26skipParametricAttributeId%3D%26prevNValues%3D2031%2B202729

Then you need to control all the LEDs. You can do this through either using several of the constant current drivers in that huge link above, or by driving each LED with a FET and multiplexing the output to the FETs gate. Like shown here:-

I suggest you go and talk to someone in the Elec Eng or Physics department as I think you will need a bit of physical guidance as to wiring things up.

One big problem you have is the 40V requirement, some of those chips can't produce / handle that much voltage.

Google for constant current schematics.

EDIT How about this one:-

Mike, the last link you attached for the 4 channel LED driver looks very interesting. Can you explain in layman's terms how I might employ that? Would I use one channel per each '2-arm branch' of my octopus light rig? what about the current? it shows only 80 mA per channel and I need 1.5 x that... how would that work? Also isn't the variation in the a diode's draw almost entirely determined by its temperature? And since these are going to be submerged in water and only turned on for a few seconds at most, will there really be opportunity for enough change/ramp up in temp to cause stability issues in the circuitry... or am I misinformed here? Lastly, if I put three of these LED's in parallel just to try them out with the power supply I DO currently have, that will 1/3 the current through all of them to about 116 mA, correct?

oh wait mistake. It says 120mA

it shows only 80 mA per channel

Where? The top of the data sheet says 120mA and the operating conditions shows 102mA with a Rset of 13.3K.
You need only one chip to give you the constant current supply.

Can you explain in layman’s terms how I might employ that?

I have already said. You need a FET on each LED, look at the attached picture.

Also isn’t the variation in the a diode’s draw almost entirely determined by its temperature?

No there is a manufacturing spread to start with and it also changes with the age of the LED.

Lastly, if I put three of these LED’s in parallel just to try them out with the power supply I DO currently have, that will 1/3 the current through all of them to about 116 mA, correct?

That assumes that the LEDs will share current evenly. That will only happen if the forward voltage drop for the LEDs is the same on each LED which it is not there is a spread. You can try a series resistor in each LED to try and “balance” this but you do not have a lot of excess voltage to play with and this is an unstable solution that would need experiments to get right on any one LED. It is not a soloution that can be universally applied. That is I can’t tell you what resistor value you need.


It's finally it is starting to sink in. I am getting it now. I really appreciate this. You have been of great help pointing me in the right direction. I've made an appointment with somebody from the National Oceanographic Center here in Southampton who apparently has built this very thing before to offer guidance. At least I will be able to arrive at the initial meeting with a better understanding of what my questions should be and not such a blind ignorance to the situation as I did when I started this blog. Thank you.