Where to find arduino code for simple LED controller?

Jonathan Troutt

Well-Known Member
View Badges
Joined
Apr 1, 2018
Messages
970
Reaction score
1,173
Location
Indianapolis, IN
Rating - 0%
0   0   0
Hey guys I am looking for a piece of code that is only for controlling an LED black box.

By simple I want Sunrise and sunset functions and the ability to control the length of sunrise and sunset and the LED intensity of 2 channels. I have used google and done a lot of searching experimenting in the Arduino IDE.

The ones that I have found don't work for me. Does anyone know of anything?

If I cannot find anything I guess I am going to be spending some money on something like this

https://reefledlights.com/shop/storm-controller/

I suck at coding, and for some reason I cannot grasp it no matter how hard I try.
 
Are you having trouble getting the electronics wired up? Is the coding the problem? Or is it both?

I think you should start by looking at how the black box is dimmed. Some drivers dim by receiving an analog 0-10v signal, while others are dimmed using a PWM signal. I don't have much experience with the Arduino, but with Raspberry Pis, you can't output an analog 0-10v signal without a DAC converter. Depending on how your black box works, you might need a DAC. The Storm controller works great, but it's not going to help you if your light's drivers use an analog 0-10v signal.

I don't have a ton of experience modding black boxes, but there are a lot of threads on Reef Central and a lot of videos on Youtube. I think the information is out there, you'll probably just have to do a lot of reading/watching.
 
It’s purely the coding. The hardware side of it is not the problem at all. My drivers in my black box use a 0-10v pwm single. I was gonna make up a simple protoboard with a transistor circuit to bump the arduino up to get the 0-10v pwm. I’ll prolly just end up getting that storm controller.
 
It’s purely the coding. The hardware side of it is not the problem at all. My drivers in my black box use a 0-10v pwm single. I was gonna make up a simple protoboard with a transistor circuit to bump the arduino up to get the 0-10v pwm. I’ll prolly just end up getting that storm controller.

To the best of my knowledge, there's no such thing as a "0-10v pwm signal."

LEDs are dimmed one of two ways. The first is by what is sometimes called analog dimming. The driver is fed a constant "analog" DC voltage between 0V and 10V. The driver then uses this constant voltage to determine how much power to send to the LEDs. Very roughly speaking, 0V = 0% intensity, 10V = 100% intensity, 5V = 50% intensity and so on. This voltage can be supplied by just about any source and is just a simple, constant DC voltage.

PWM (pulse width modulation) dimming is frequently known as just that, although sometimes it's called "digital" dimming. With PWM dimming, a controller sends a very fast on/off signal to the LED driver. The driver determines how bright the LEDs need to be based on how quickly the signal turns on and off (the frequency), as well as how long the signal is left on relative to how long it is left off. Let's use the Meanwell LDD as an example. The LDD accepts PWM inputs between 2.5VDC and 6VDC. The controller tells the driver how bright the LEDs need to be by turning that signal on and off for measured periods of time every second. This is an over simplification, but if you want the LEDs to be at 90% intensity, your controller would have to keep the voltage signal on for 90% of a second and off for 10% of the second. The voltage makes no difference whatsoever when it comes to the dimming functionality (so long as it's within the driver's specs). What causes the actual dimming is turning the signal on and off.

It's possible your light has drivers that are PWM and uses a DAC (digital to analog converter). A digital to analog converter could take a constant voltage between 0-10V and turn it into a PWM signal that the driver would understand. It's also possible the reverse is true, that your drivers are analog 0-10V dimming and there's a converter that transforms PWM signal into an analog voltage. I would think this is much less common though.

As I mentioned though, I don't believe there's such a thing as 0-10V PWM dimming. There may be some combination of the two using a DAC, but at the end of the day, your drivers likely either use PWM dimming or analog 0-10V dimming, not both.
 
I'm not sure why that might be. These two dimming technologies (PWM and analog dimming) are wholly incompatible. It could be that by PWM they're referring to how the LEDs are actually dimmed. In a lot of cases, when you dim LEDs, the actual LED is turned on and off by PWM. Meaning, if you choose 40% intensity, the LED is cycled on and off very quickly; it's left on for 40% of the time and left off 60% of the time. The on/offs are so quick that most people don't notice. The end effect is the LED runs at about 40% intensity. It also could be that everything in the box was made in China and the manufacturers making the parts don't have a great grasp on the English language.

Could you post a picture of the inside of the light? It's possible to determine what kind of dimming the light uses if you have a multimeter and measure voltage at key points.
 
I can when I get home tonight from work. In the mean time when I was searching for drivers for my diy fuge light I ran across many that stated 0-10v pwm. Here is one example

https://www.ecolocityled.com/product/10v_led_dimmer_3chan/pwm_led_light_dimmer

Right, but PWM in the context of that driver refers to how the LEDs are actually controlled. The product spec sheet explicitly states that the dimmer is PWM and the control signal is an analog 0-10V source:

A three channel LED PWM Dimmer for use only with 0-10V Control Signal such as a home control system or 0-10V switch

It does not anywhere say that the control signal is a 0-10V PWM signal.
 
I see what you are saying. I obviously interpreted it wrong. Thanks for the calirfication. Makes sense though because with pwm dimming. They use duty cycle correct? So voltage would remain constant.
 
I see what you are saying. I obviously interpreted it wrong. Thanks for the calirfication. Makes sense though because with pwm dimming. They use duty cycle correct? So voltage would remain constant.

You're welcome :) and correct, with PWM the voltage is fixed, the only change is the duty cycle.

When you have some free time, if you have a multimeter you can test to make sure your drivers use an analog 0-10V signal. Disassemble the light and turn it on (be careful doing this, as you can seriously injure yourself if you touch the wrong wires). Look at the wires going into the LED driver. There will be two wires for the power source, a positive and a negative. They should read relatively higher voltage, like 50V or so. Then, there will likely be one (or two) additional wire that carries the dimming signal. Put your + lead on this wire, then the negative lead on the - power supply wire. Play around with the dimmer. You should see that on the highest settings, you will have close to 10V flowing through the dimmer control wire. As you turn the intensity down from 100%, you'll see that voltage decrease from 100% to close to 1V or so.
 
Right on. I forgot I do have a picture of the driver with the casing off.

On a different note. In this picture there are two pots. The pot that is labeled min set is cool. If I have the lights dimmed really low this pot can be turned down and will make the dimmest setting dimmer. I’ve played around with the possibility of using the 1% point as a moonlight setting. My blue channel would never shut off rather at night just be super dim.

I hope that made sense. But I will get the trusty fluke out tonight and take some measurements.

437E7E6D-FDE9-4270-865A-CE3D290C21F2.jpeg
 
Hm wow, so there's a lot going on there. The bottom of the picture looks like it could be the AC input because of the transformer. So the stuff up at the top would be the outputs. It's hard to tell though. Does this fixture have any external potentiometers? If so, which wires in the picture above attach to the potentiometers? Could you also tell me what wires from the circuit go to the LEDs?

@Brew12 might also know what's going on here. We're trying to figure out which of the wires above might carry the dimming signal, which I suspect is a 0-10v analog voltage.
 
Yip totally. So the fixture is a Viparspectra 165w. You are correct the bottom is the AC input. For the output side starting from left to right. The first connector is the output to the LED's, the second(4wire) goes to the front of the fixture and connects to a little board that contains a display, Rotary encoder, and IR receiver for the remote, the next goes to a 12v fan, and the last single wire is the ground. The 4pin connector is what carries the dimming signal. Same exact setup for the other driver.
 
Ah okay, I have a Viparspectra as well.

So this may actually be a PWM-dimmed fixture. If I had to guess, I would say the red and black wires on the four pin connector power the display while the yellow and green return the control signal. See what kind of voltage reading you get from the green and yellow wires, as well as the black/red wires just for curiosity's sake. See if those readings go up or down as you change the intensity on the front panel.
 
Have you done any modifications to yours? I replaced all the white leds in it with super cold white leds.

Nope, I haven't. It's been working really well so far. If anything, I wish the light was a little more blue. The blues are up at 100% already, so if I want any more PAR I have to add more white light. More "blue" whites might be beneficial.
 
I was thinking the same thing which is why I switch all the whites out for a colder white. It helped a bit. The one thing I have noticed is it got a lighter blue diode as well. I have been thinking about swapping some of those for the royal blues.

Ive thought about redoing the white channel and mixing some royals blue in with it as well. I would obviously have to buy a new driver for it. Still havnt decided yet.
 
OK so here are some readings. Red and black changes with intensity from 0 volts for off and 3 volts for full. YEllow and green I get ~8.5V with the unit off and ~11V with the channel at maximum.

Also I think the signal might be inverted. Black lead on red and red lead on black gives me a positive voltage. If I go red to red and black to black The voltage is negative.

Also in the picture above the connector above the CAP is the connector the the LED panel. The other connector with red and black wires powers the fan. 86.6V is max for the blue channel 73.1V is minimum for the blue channel.

Although I can change the minimum voltages for each channel by adjusting the MIN-SET pot on the driver.

I am confused why only 0-3V. Or is it because my reader set on DC is seeing the Duty Cycle and measuring a dc voltage out of it. But if that is the case would I read 5V at max?

All measurements taken with a FLUKE 115
 
SO these drivers are constant current drivers and change brightness level by changing the voltage correct? The meanwell driver I am using for my fuge is a constant voltage driver and I vary the brightness by adjusting the current pot.
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top