Home assistant control for dimming grow lights constant current driver.

Home Assistant automation projects, questions, etc. go here.
Post Reply
FortyTwo LUE
LED-Curious
LED-Curious
Reactions:
Posts: 1
Joined: Thu Oct 08, 2020 3:00 am

Great vids, thx for taking the time to share. I am in process of designing a custom grow light using an HLG-480H-B1400B driver and Samsung Horticulture LED Modules. Since I am in design mode for the light, I want to consider home automation while at this stage.

I am definitely a novice, but not an uninformed one. Powering and triggering the LED driver/lights on and off is clearly straightforward, and if that is all I want to do, I would just use an off-the-shelf smart plug, which is what I do for my current lights. However, I have been thinking about the 0-10V dimming functionality built into this meanwell driver and how one would best incorporate that in an automated smart home system (I only use Google home now, and hate the trigger less and super limited functionality routines, so this could be an excuse to get into home assistant and the whole 9 yards anyway. At the same time, I realize that it might be overkill or less practical than it seemed and thus it is likely that I won’t use it much, but having said that, it could be cool to have artificial sunrise/sunset and perhaps cycle dimming for different growth stages/rooms (in my previous life in plant science R&D, we even used to simulate clouds passing this way). Anyway, what I am trying to figure out is what device you would use to connect to the DIM+/DIM- ports on the Meanwell driver that would interface with - say - your raspberry pi or computer and home assistant, such that you could ultimately set up automations, e.g slowly ramp the lights to 100% when they come on in the morning, if the lights get too hot, dim them to 80%, etc. It seems like the rp4 or the esp boards have PWM outputs but not 0-10V, only 3.3 or 5, so that doesn’t work with out trying to step up the Voltage, which seems complicated. Is there a shield or module that is built for this? I don’t want to waste money or time (or burn anything down), so if anybody could at least shove me in the right direction that would be great. A smart plug/relay for on/off I can do, the relay boards are fairly straightforward, however, I can’t seem to land on the right hardware for the 0-10v PWM dimming for a 480W high voltage DC constant current driver, other than people putting on the manual knob/potentiometer, which isn’t automation at all. Anybody help steer me to what I need???
kmccor
LED-Curious
LED-Curious
Reactions:
Posts: 1
Joined: Thu Oct 22, 2020 12:52 pm

You want to be using the PWM dimming functionality of the Meanwell via a microcontroller (MCU) which in turn links to the automation system.

This guy details a solution -



...although rather than writing MCU code, in the first instance I'd look at whether something like ESPHome can deliver the functionality
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

I ended up answering this in comments on YouTube. I’ll paste in my reply:

“ That's an easy one on those drivers since they supply the 0-10V on those wires themselves. I did mine with a PC817 optocoupler. PWM/ground from your microcontroller goes to the 2 input pins of the optocoupler (don't forget a little resistor in series on the PWM output to make sure you're not overdriving the IR LED in the optocoupler) and then you just hook up the DIM+ and DIM- of the driver to the output side of the optocoupler.”

And yeah this can be done using ESP home to drive the PWM.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
bestinc
LED-Curious
LED-Curious
Reactions:
Posts: 17
Joined: Tue May 05, 2020 11:03 pm

LEDG wrote:
Fri Oct 23, 2020 1:47 pm
I ended up answering this in comments on YouTube. I’ll paste in my reply:

“ That's an easy one on those drivers since they supply the 0-10V on those wires themselves. I did mine with a PC817 optocoupler. PWM/ground from your microcontroller goes to the 2 input pins of the optocoupler (don't forget a little resistor in series on the PWM output to make sure you're not overdriving the IR LED in the optocoupler) and then you just hook up the DIM+ and DIM- of the driver to the output side of the optocoupler.”

And yeah this can be done using ESP home to drive the PWM.
@LEDG , I am slowing try to sort out PWM dimming from a raspberry pi for a XLG-240-H-AB with 6 eb gen 3 thrives. If I am honest, I am way over my head. I can do the programming side but the circuitry side is tough. Do you have any idea how to use a raspberry pi pwm circuit? I am having quite a hard time finding much material on pwm dimming for meanwell drivers specifically.

I am hoping to use a software pwm signal to ramp up the brightness from 0 to 100 over about a ~30 minute period using a cron schedule then do the reverse at night. Any clues to the circuit I have is ground and pin out from the pi, resistor, NPN Bipolar Transistors (PN2222), show how drop the voltage of a 12V power supply (voltage regulator and some resistors?) and feed that mess into the + and - dim on the driver

Thanks
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

bestinc wrote:
Tue Nov 24, 2020 3:25 am
LEDG wrote:
Fri Oct 23, 2020 1:47 pm
I ended up answering this in comments on YouTube. I’ll paste in my reply:

“ That's an easy one on those drivers since they supply the 0-10V on those wires themselves. I did mine with a PC817 optocoupler. PWM/ground from your microcontroller goes to the 2 input pins of the optocoupler (don't forget a little resistor in series on the PWM output to make sure you're not overdriving the IR LED in the optocoupler) and then you just hook up the DIM+ and DIM- of the driver to the output side of the optocoupler.”

And yeah this can be done using ESP home to drive the PWM.
@LEDG , I am slowing try to sort out PWM dimming from a raspberry pi for a XLG-240-H-AB with 6 eb gen 3 thrives. If I am honest, I am way over my head. I can do the programming side but the circuitry side is tough. Do you have any idea how to use a raspberry pi pwm circuit? I am having quite a hard time finding much material on pwm dimming for meanwell drivers specifically.

I am hoping to use a software pwm signal to ramp up the brightness from 0 to 100 over about a ~30 minute period using a cron schedule then do the reverse at night. Any clues to the circuit I have is ground and pin out from the pi, resistor, NPN Bipolar Transistors (PN2222), show how drop the voltage of a 12V power supply (voltage regulator and some resistors?) and feed that mess into the + and - dim on the driver

Thanks
The dim circuit on the MW driver provides its own current, so all you need to do is open and close the connection between the dim + and dim - wires with a PWM signal. You can do it with an optocoupler and resistor as I mentioned above, or with transistors as you've stated. Use the pi to provide PWM to the gate of your transistor and hook up the dim wires to the source and drain.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
bestinc
LED-Curious
LED-Curious
Reactions:
Posts: 17
Joined: Tue May 05, 2020 11:03 pm

LEDG wrote:
Tue Nov 24, 2020 4:17 am
bestinc wrote:
Tue Nov 24, 2020 3:25 am
LEDG wrote:
Fri Oct 23, 2020 1:47 pm
I ended up answering this in comments on YouTube. I’ll paste in my reply:

“ That's an easy one on those drivers since they supply the 0-10V on those wires themselves. I did mine with a PC817 optocoupler. PWM/ground from your microcontroller goes to the 2 input pins of the optocoupler (don't forget a little resistor in series on the PWM output to make sure you're not overdriving the IR LED in the optocoupler) and then you just hook up the DIM+ and DIM- of the driver to the output side of the optocoupler.”

And yeah this can be done using ESP home to drive the PWM.
@LEDG , I am slowing try to sort out PWM dimming from a raspberry pi for a XLG-240-H-AB with 6 eb gen 3 thrives. If I am honest, I am way over my head. I can do the programming side but the circuitry side is tough. Do you have any idea how to use a raspberry pi pwm circuit? I am having quite a hard time finding much material on pwm dimming for meanwell drivers specifically.

I am hoping to use a software pwm signal to ramp up the brightness from 0 to 100 over about a ~30 minute period using a cron schedule then do the reverse at night. Any clues to the circuit I have is ground and pin out from the pi, resistor, NPN Bipolar Transistors (PN2222), show how drop the voltage of a 12V power supply (voltage regulator and some resistors?) and feed that mess into the + and - dim on the driver

Thanks
The dim circuit on the MW driver provides its own current, so all you need to do is open and close the connection between the dim + and dim - wires with a PWM signal. You can do it with an optocoupler and resistor as I mentioned above, or with transistors as you've stated. Use the pi to provide PWM to the gate of your transistor and hook up the dim wires to the source and drain.
It is really as simple as the attached image from Here? . If so thats much simpler than I hoped
Attachments
Meanwell PWM Dim.png
User avatar
LEDG
Site Admin
Reactions:
Posts: 1599
Joined: Sun Jun 04, 2017 8:15 pm

bestinc wrote:
Tue Nov 24, 2020 4:51 am
LEDG wrote:
Tue Nov 24, 2020 4:17 am
bestinc wrote:
Tue Nov 24, 2020 3:25 am


@LEDG , I am slowing try to sort out PWM dimming from a raspberry pi for a XLG-240-H-AB with 6 eb gen 3 thrives. If I am honest, I am way over my head. I can do the programming side but the circuitry side is tough. Do you have any idea how to use a raspberry pi pwm circuit? I am having quite a hard time finding much material on pwm dimming for meanwell drivers specifically.

I am hoping to use a software pwm signal to ramp up the brightness from 0 to 100 over about a ~30 minute period using a cron schedule then do the reverse at night. Any clues to the circuit I have is ground and pin out from the pi, resistor, NPN Bipolar Transistors (PN2222), show how drop the voltage of a 12V power supply (voltage regulator and some resistors?) and feed that mess into the + and - dim on the driver

Thanks
The dim circuit on the MW driver provides its own current, so all you need to do is open and close the connection between the dim + and dim - wires with a PWM signal. You can do it with an optocoupler and resistor as I mentioned above, or with transistors as you've stated. Use the pi to provide PWM to the gate of your transistor and hook up the dim wires to the source and drain.
It is really as simple as the attached image from Here? . If so thats much simpler than I hoped
Yeah, that'll work. Only problem is it'll be inverted, so sending a 0 will be full bright and a 255 will be full dim. If the Pi PWM stops, it'll revert to full brightness.

I'm sure you could work around this in software or figure out how to invert it with parts.
Want to Support the Site?

Use this Amazon referral link and any purchase you make within 24 hrs will earn LEDgardener a commission at no cost to you!
bestinc
LED-Curious
LED-Curious
Reactions:
Posts: 17
Joined: Tue May 05, 2020 11:03 pm

LEDG wrote:
Tue Nov 24, 2020 8:47 pm
bestinc wrote:
Tue Nov 24, 2020 4:51 am
LEDG wrote:
Tue Nov 24, 2020 4:17 am


The dim circuit on the MW driver provides its own current, so all you need to do is open and close the connection between the dim + and dim - wires with a PWM signal. You can do it with an optocoupler and resistor as I mentioned above, or with transistors as you've stated. Use the pi to provide PWM to the gate of your transistor and hook up the dim wires to the source and drain.
It is really as simple as the attached image from Here? . If so thats much simpler than I hoped
Yeah, that'll work. Only problem is it'll be inverted, so sending a 0 will be full bright and a 255 will be full dim. If the Pi PWM stops, it'll revert to full brightness.

I'm sure you could work around this in software or figure out how to invert it with parts.
You're absolutely right on both counts. To combat the PWM signal revert to full brightness, you can use hardware_PWM through pigpio. It keeps the last sent PWM signal even after the script has finished. Thanks for the help
stud
LED Lover
LED Lover
Reactions:
Posts: 143
Joined: Wed Jun 03, 2020 4:19 pm
Location: Canada

i will try to achieve the same with ESP32+ ESPHOME and L298M , i have both pieces here already ,missing the light , just ordered the Spider Farmer SF-4000 LED light with Mean Well Driver .
i have a friend that achieved it that way here with some other Chinese LED lights . he can also close the Light via PWM .
i have a AC infinity blower running with that same setup
cant wait to try it , thx for sharing
Post Reply