Pages: [1] 2   Go Down
Author Topic: Variable resistance to control MEAN WELL HLG-120H-42B  (Read 1602 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would like to control LED lighting being run by a MEAN WELL HLG-120H-42B.  I know I can easily do this with a easily with a PWM signal, but that is not what I want to do.  Ideally, I would output an average of 50% brightness, with time periods that are higher output and others that are lower.  Running a LED with 50% the current is significantly more efficient that using a PWM to run it at 100% of the current and flickering it on and off 50% of the time.

This involves either a simply voltage signal between 0 and 10 volts, or variable resistance (like a potentiometer) on a 10 volt line, both do the same thing.  Here are the specs if you need more detail:
https://www.jameco.com/Jameco/Products/ProdDS/2148210.pdf

My actual project is my aquarium lighting, which will use 8 drivers total, 2 of which are HLG-120H-42B's.

BTW - is there an easy way to simply turn a driver on/off using and arduino?  Most likely with a switch at the AC current before it even hits the driver.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1847
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe what you want is a DAC (digital to analog converter).  This blog listed the DAC solutions that were available in 2011: http://embeddednewbie.blogspot.com/2011/02/review-of-arduino-dac-solutions.html

The new Due has 2 DAC's built in (though evidently there was a library bug that you could only use 1, but that will be fixed shortly).  Of course it will take some time before you can buy a Due from a vendor that has it in stock.
« Last Edit: October 31, 2012, 01:44:29 pm by MichaelMeissner » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I believe what you want is a DAC (digital to analog converter).  This blog listed the DAC solutions that were available in 2011: http://embeddednewbie.blogspot.com/2011/02/review-of-arduino-dac-solutions.html
The new Due has 2 DAC's built in (though evidently there was a library bug that you could only use 1, but that will be fixed shortly). 

A DAC would be nice, but I certainly could make this work with other options.  For example, if I could use a digital output to set my signal to either 0V (full power) or 5V(half power) I could choose either 100% or 50% power.  If I could carry a PWM signal on the same circuit, I'd have full dimming capability with full efficiency at 50% and 100% power (but sub-optimal for in-between values).


Quote
Of course it will take some time before you can buy a Due from a vendor that has it in stock.

Do you mean a few days or a few years?
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1307
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Running a LED with 50% the current is significantly more efficient that using a PWM to run it at 100% of the current and flickering it on and off 50% of the time.
Really????   The total power consumed (watt-hours) is the same in either case.    (I don't know if the perceived brightness is the same, but I'd assume so.)

If you just want two ranges, you don't need a full DAC.   I haven't got the details completely figured-out in my head, but you can simply use two Arduino outputs....   One switching-on 5V, and another switching-on 10V. 

Or, you can low-pass filter the regular PWM to get a smooth DC signal.   (You'd need an op-amp to linearly double the filtered 0-5V output.)
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1847
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Of course it will take some time before you can buy a Due from a vendor that has it in stock.
Do you mean a few days or a few years?
I have no idea how backordered the Due is (it was just announced last week).  Days is too short of a time period, years too long.  If I had to guess, by January time frame it should be easily available like the Uno is now.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Really????   The total power consumed (watt-hours) is the same in either case.
 Both consume almost exactly the same power, with probably a trivial difference due to driver inefficiencies.

Quote
(I don't know if the perceived brightness is the same, but I'd assume so.)
Nope, not linear.  For example CREE XPE-Green gives me about 25% more output at 500mA than it does cycling 1000mA 50% of the time:
http://www.cree.com/led-components-and-modules/products/xlamp/discrete-directional/~/media/Files/Cree/LED%20Components%20and%20Modules/XLamp/Data%20and%20Binning/XLampXPE.pdf

This isn't a big deal if you plan to do a 1 hour ramp up/ramp down with 10 hours in the middle of the day at full power, which is what most aquarists do, but what is the fun in that?  Ideally I'd like to have 6 hours ramping up and 6 hours ramping down with further ramping down to simulate for cloud cover.  Sounds complicated, but it really isn't much harder from a hardware perceptive, and Arduino is capable of much more complex programs.

Quote
If you just want two ranges, you don't need a full DAC.   I haven't got the details completely figured-out in my head, but you can simply use two Arduino outputs....   One switching-on 5V, and another switching-on 10V.
 I didn't know it could switch on 10V, but even switching between 0 and 5V on the same output that carries my PWM could work.  

Quote
Or, you can low-pass filter the regular PWM to get a smooth DC signal.   (You'd need an op-amp to linearly double the filtered 0-5V output.)
 This sounds perfect, but I'm a software guy, can you give me a gentle introduction to the hardware I would need to buy to low pass an Arduino PWM output to get a smooth 0-10V DC signal?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I had to guess, by January time frame it should be easily available like the Uno is now.

That is perfect for me.  I am getting married and have to completely renovate my house, and this is just a side project.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
even switching between 0 and 5V on the same output that carries my PWM could work.

That was a mistake, it gives good efficiency and good control between 50%-100% power, but I can't dim below 50% that way.  Going between 0, 5 and 10 with a PWM would work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How does the PWM output work?  Is there an input that corresponds to the output?  For example, can I just hook 10V somewhere and output a 0-10V PWM signal?  Or I am forced to output at 5V and someone how need to turn this into 10V?
Logged

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How does the PWM output work?  Is there an input that corresponds to the output?  For example, can I just hook 10V somewhere and output a 0-10V PWM signal?  Or I am forced to output at 5V and someone how need to turn this into 10V?

If you are using PWM from an Arduino it will be the same voltage level as what is powering the microprocessor IC (usually 5 VDC but sometimes 3.3 VDC.  You will need some type of amplifying or level shifting circuitry to increase the signal to a higher voltage level.

As far as correlating input all the following assumes your inputs are configured for the same voltage level as the PWM signal... 

PWM is a square wave, so a digital input would read it either LOW or HIGH depending upon what part of the waveform the signal is on the pin at any given time.  If you have the proper logic, either software or hardware-based), you could determine things like frequency and duty cycle.  ADC is intended for true analog signals, not digital pulses, but most of the time would read close to the extremes of the range of numbers used for the conversion (e.g. around 0 for when the signal is LOW and for HIGH around 2n - 1, where "n" is the number of bits of resolution).  The only time you'd see a number toward the middle is if the ADC managed to catch some part of the near instantaneous transition between the two extremes.  So generally nothing is gained by using ADC on a PWM signal, unless it is coupled with some sort of buffer or record of past values (like in a digital oscilloscope).   
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you are using PWM from an Arduino it will be the same voltage level as what is powering the microprocessor IC (usually 5 VDC but sometimes 3.3 VDC.  You will need some type of amplifying or level shifting circuitry to increase the signal to a higher voltage level.

Any suggestions as to how to amplify the signal?


Quote
PWM is a square wave, so a digital input would read it either LOW or HIGH depending upon what part of the waveform the signal is on the pin at any given time.  If you have the proper logic, either software or hardware-based), you could determine things like frequency and duty cycle.  ADC is intended for true analog signals, not digital pulses, but most of the time would read close to the extremes of the range of numbers used for the conversion (e.g. around 0 for when the signal is LOW and for HIGH around 2n - 1, where "n" is the number of bits of resolution).  The only time you'd see a number toward the middle is if the ADC managed to catch some part of the near instantaneous transition between the two extremes.  So generally nothing is gained by using ADC on a PWM signal, unless it is coupled with some sort of buffer or record of past values (like in a digital oscilloscope). 

By ADC, are you referring to the DAC on the Duo?  Does this mean the Duo can't output a constant 1.2345 V signal, for example?  Anyone, I think the correct road to go down is using a capacitor as a low-pass filter for the standard PWM.  I could get this working first with PWM only, then try to add the filter.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Uno advertises: Digital I/O Pins   14 (of which 6 provide PWM output).  Does this mean I get 6 separate PWM outputs?  Or do I only get 3 (if a negative and positive pin are needed for each) or some other number?

Even if I get 6 PWM signals, that isn't enough.  Can someone suggest which Arduino I would want?
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1847
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Uno advertises: Digital I/O Pins   14 (of which 6 provide PWM output).  Does this mean I get 6 separate PWM outputs?  Or do I only get 3 (if a negative and positive pin are needed for each) or some other number?

Even if I get 6 PWM signals, that isn't enough.  Can someone suggest which Arduino I would want?
You get 6 separate PWM outputs.  Note, that if you use the servo library, it disables PWM for 2 of the outputs (pin 9 and 10).

The Mega 2560 provides 15 PWM pins, the recently announced Due has 12 PWM pins.  The teensy 3.0 has 10 PWM pins.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I posted the 5V to 10V question on an aquarium forum, and most people are using a separate 10V supply and an NPN 2N2222 transistor to switch between 10V and ground.  All the PWM from Arduino does is control the transistor.

If I go with this approach, the DAC is useless since I don't want an analog signal sent to my transistor.  But I can still use the capacitor low pass filter trick.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The Mega 2560 provides 15 PWM pins, the recently announced Due has 12 PWM pins.  The teensy 3.0 has 10 PWM pins.

Other than cost, any reason not to just use a Mega?  The Due has more computing power, but I think they all have more than I need.
Logged

Pages: [1] 2   Go Up
Jump to: