On/Off functin for meanwell HLG style drivers using dimming and arduino

VegasWinner

Well-Known Member
Nice job and thanks for sharing, I'm surprised this thread doesn't have hundreds of eager cob light growers all over it. The the ramp up/down option alone is worth it, something I expect will become default practice some day sooner than later. Not just for minutes or to avoid inrush, but boost to full intensity gradually during the first hours and start dimming hours before the end of the day, The start and end intensity should also be something like 20%, or a configurable min and max output setting. The best values would require testing for cannabis specifically but based on trials with other species the potential for additional energy savings is huge without negative effects. 15-20% is easily feasible.

I planned to dust off an arduino and build something myself inspired partly by a dutch cob grower but yours comes with display... It's probably not really functionally important in a good led light but in his setup it measures the temps of the cobs and shuts down the lights. Instead or additionally it could display the temp, or indicate with multi color diodes...
View attachment 3724994
...or, in the ramp up/down scenario, it could be used to turn on fans only when needed, and as fast as needed, 5v vs 12v, or with that pwm the fans individually as needed. Not passive, not active, but "adaptive cooling".
you are absolutely right, ramping up stops inrush current issues. i set ramp up to 15 minutes. and plants love the transitions. they show me with their love. I looked at the coralux and typhon controllers, and in fact bought both and found both of their strengths and weaknesses. I wrote code to attempt to bridge that gap. They have controllers fopr aquarium guys why not mmj guys?

I use a range of led colors, reds and blues and ramp em up and down with the CoB's and the plants love it. peace.
 

Sativied

Well-Known Member
.you code is private?
He already posted the links to the code in a previous post and also specifically mentioned it was free, in a post you 'liked'.

All the code you need is already available at numerous websites anyway, and for the led experts and engineers here it should be a piece of cake... took me 15 minutes to make a pwm dimmer, with remote control.
remotedimmer.jpg


This one: https://www.sparkfun.com/products/9570 (or a cheaper chinese version) would allow for something very similar to Dimlux's plant temp sensor that dims a HPS when the plants get too hot. Combined with IR leds, dim when it gets too hot, turn on or boost IR when they get too cold, i.e. measure and control leaf temp...
 

VegasWinner

Well-Known Member
I revised the code to not use a DHT11 temp/humidity sensor as it was causing some degrading of lcd screen. I focused on the basics, driving LED channels, six max. I do not mind sharing the code as it is a derivative of the typhon controller, which is public, as well. I am developing a rotary encoder version with a 20x4 lcd, which will not be free, but will be available as installed on an arduino uno rev 3, only. Further development of PWM channels over six channels will result in some fee, as it is harder work to get more than six pwm channels without running out memory, leading towards an arduino mega 2560, even with the spi 12 channel breakout boards. They still require code to set and control them. I am thinking of doing it in groups, regarding setting, but control will be independent.

The current and most stable code is available at the link on Github.

If we all kept secrets, we could not move forward as a group. If not for others sharing how to build LED lights, there would be no need for a controller. you can buy a Typhon controller, but it only has four channels. You can buy a coralux, but it only has on start and stop time for ALL channels. Both have shortcomings, so I figure I can help out and save some frustration. for others.
Karma and paying it forward.
Peace
Vegas
 

salmonetin

Well-Known Member
He already posted the links to the code in a previous post and also specifically mentioned it was free, in a post you 'liked'.

All the code you need is already available at numerous websites anyway, and for the led experts and engineers here it should be a piece of cake... took me 15 minutes to make a pwm dimmer, with remote control.
View attachment 3725691


This one: https://www.sparkfun.com/products/9570 (or a cheaper chinese version) would allow for something very similar to Dimlux's plant temp sensor that dims a HPS when the plants get too hot. Combined with IR leds, dim when it gets too hot, turn on or boost IR when they get too cold, i.e. measure and control leaf temp...
all the code you need is already available....some codes are missing to my eyes actually...:evil:
one example...

...robotank controller code its "private"... but its derivative of mraqua or mrman controllers both codes are public... just my pov... off course...
https://www.robo-tank.ca/en/Robo-Tank-Software-License-i17.html....... :wall:
http://www.plantedtank.net/forums/20-diy/677265-iaqua-my-touch-interface-aquarium-controller-arduino.html
http://www.reefcentral.com/forums/showpost.php?p=24458566&postcount=3377

...maybe with the time someone share this code... just a dream i know....

I revised the code to not use a DHT11 temp/humidity sensor as it was causing some degrading of lcd screen. I focused on the basics, driving LED channels, six max. I do not mind sharing the code as it is a derivative of the typhon controller, which is public, as well. I am developing a rotary encoder version with a 20x4 lcd, which will not be free, but will be available as installed on an arduino uno rev 3, only. Further development of PWM channels over six channels will result in some fee, as it is harder work to get more than six pwm channels without running out memory, leading towards an arduino mega 2560, even with the spi 12 channel breakout boards. They still require code to set and control them. I am thinking of doing it in groups, regarding setting, but control will be independent.

The current and most stable code is available at the link on Github.

If we all kept secrets, we could not move forward as a group. If not for others sharing how to build LED lights, there would be no need for a controller. you can buy a Typhon controller, but it only has four channels. You can buy a coralux, but it only has on start and stop time for ALL channels. Both have shortcomings, so I figure I can help out and save some frustration. for others.
Karma and paying it forward.
Peace
Vegas
...rotary encoder version with 20x4 lcd... derivative of coralux controller?... coralux code its public...

...and yeah mrman controller its the limit for megas...robotank uses megas but for me run better on arduino due
(he uses arduino due kit too)...just my inexpert pov...

...i prefer the code on public... but on these days... lot of info go on pay per view....on the past i can go on the university info for free... actually only paying.... for future students its a problem to my pov... but hey im too old ...

if the code its not public... its only pay per view... and there are a lot of controllers ways... we can replicate the professional controllers way too...
...again replicate the professional controllers ...or goin in the derivative way...are more expensive... but doable on diy way too...
...its only my old pov....:fire:


...peace...

Saludos
 
Last edited:

Sativied

Well-Known Member
the code you need is already available....some codes are missing to my eyes actually...:evil:
one example...
I was referring to the code one needs to create something like Vegas yourself, obviously not talking about every finished arduino based product out there. All the code you need is available is not the same as people giving away the complete source code of their finished products. Just as arduino sensors and outputs are building blocks, so is the available code for those. When using common sensors and other parts it is very unlikely that your project is so special and unique that you'd have to write code for those from scratch.

Take my remote pwm dimmer example, just a combination of code from:
https://arduino-info.wikispaces.com/IR-RemoteControl
https://www.arduino.cc/en/Tutorial/Fading

The code from robo tank specifically would be of little use without their specific hardware (robo tank isn't just software...). It would be much harder to change that into working software for something you create than to use the already available code to create something functionally similar yourself. I'm not saying you don't have to write any code at all, and robo tank does have a nice fancy touchscreen gui that would require some work (can be kept much simpler), but apart from the appliance itself it's mostly typical arduino diy stuff, measure temps, control dosage pumps, ph probe, possibly DO probe, controlling leds, all already done and tons of code examples and videos and schematics available.

Just have to glue them together sort of speak. And then you run into a shortage of pwm pins sooner or later... which is a classic really, which in arduino community means there are libraries and tons of example code available for it. For example (@VegasWinner) see http://www.sensorwiki.org/doku.php/tutorials/extending_pwm_output_pins_with_a_texas_instruments_tlc5940_led_driver
Or better:
http://tronixstuff.com/2013/10/21/tutorial-arduino-tlc5940-led-driver-ic/

Same driver as on the pwm shield. Takes more time to physically connect than code...
 

VegasWinner

Well-Known Member
I was referring to the code one needs to create something like Vegas yourself, obviously not talking about every finished arduino based product out there. All the code you need is available is not the same as people giving away the complete source code of their finished products. Just as arduino sensors and outputs are building blocks, so is the available code for those. When using common sensors and other parts it is very unlikely that your project is so special and unique that you'd have to write code for those from scratch.

Take my remote pwm dimmer example, just a combination of code from:
https://arduino-info.wikispaces.com/IR-RemoteControl
https://www.arduino.cc/en/Tutorial/Fading

The code from robo tank specifically would be of little use without their specific hardware (robo tank isn't just software...). It would be much harder to change that into working software for something you create than to use the already available code to create something functionally similar yourself. I'm not saying you don't have to write any code at all, and robo tank does have a nice fancy touchscreen gui that would require some work (can be kept much simpler), but apart from the appliance itself it's mostly typical arduino diy stuff, measure temps, control dosage pumps, ph probe, possibly DO probe, controlling leds, all already done and tons of code examples and videos and schematics available.

Just have to glue them together sort of speak. And then you run into a shortage of pwm pins sooner or later... which is a classic really, which in arduino community means there are libraries and tons of example code available for it. For example (@VegasWinner) see http://www.sensorwiki.org/doku.php/tutorials/extending_pwm_output_pins_with_a_texas_instruments_tlc5940_led_driver
Or better:
http://tronixstuff.com/2013/10/21/tutorial-arduino-tlc5940-led-driver-ic/

Same driver as on the pwm shield. Takes more time to physically connect than code...
The code is finished. If you use the components it was designed to use, it will work for you, just like it works for me. That is why I posted a list of components this sketch was designed to work with.

I am working on a rotary encoder with pushbutton version, similar to a coralux controller, using my current six channel driver software I am using with tweaks for speed and efficiency. this will be available as a complete unit with all components assembled and tested with burnin period. peace
Vegas
 

VegasWinner

Well-Known Member
I have tweaked the code and uploaded the revised version. it is called GrowGreen.ino It has six channels and the lcd screen corruption is resolved finally. I used a combination of sprintf and print buffer commands to resolve it. I am happy with the existing code now. All that is needed is to put it in the final unit. I have the lcd mounted on a mega case, with the rtc and the room for connecting the DHT if desired. I have no real need for a temp and humidity sensor as I have one in use, but folks may want one. All that is needed is to install the DHT11 and uncomment the DHTSetup and GetDHT data code lines in the setup and loop section.

I have made this publicly available as the original code I used was public domain as well from the well known typhon controller. I expanded the code to use six versus four PWM channels and there is room for at least two more PWM channels on he arduino through the efficiency of the design for cycle timers or CO2 sensors. The code can be modified by the community and shared to create a better product for all. You can use the controller remotely or mount it on your light fixture if you wish, using a couple of the beefcake opti-controllers as Growmau5 did on his new ten COB light, on the power side with a 5v PWM signal from the controller to turn the fixture on/off as I discovered. You can use the PWM controlled outlet, I posted earlier if you do not want to get into re-wiring your light fixture. Either way, I promised a better way to control the DIY LED lights we all built, and here it is. Six channels of PWM which can control 12 LED Drivers with a dual PWM pigtail. A single PWM signal can turn 2 LED drivers on/off easily with no inrush current issues whatsoever. You can assemble the unit yourself, I listed a parts list prior. I am working on a DIY kit that can be made available fr purchase. peace
Avid
 

VegasWinner

Well-Known Member
I am currently working on a revised version that uses a 20x4 lcd screen and only a rotary encoder with a push button for input while still fitting into the Uno footprint. peace
Avid
 

VegasWinner

Well-Known Member
:lol::weed::sleep:Hey everyone. been busy. I have been working on refining the code, and i did that. works great. I will update the code soon. I have also re-developed the GrowGreen Led Controller for a 20x4 lcd screen and a rotary dial with a push button as the input device. I have been testing for a week now, and this version works great. I wil post picks shortly. I had to write a code library to use the rotary encoder switch to work the way I needed for the controller.

On yeah the baseline is now an 8 channel controller. also have the code capacity to reprogram Coralux controllers with better code for running LED lights instead of aquarium lights. So there is now a six and eight channel Controller expandable to as many channels as wanted. The code has been rewritten to be modular for future expansion. peace
Vegas
 

sixstring2112

Well-Known Member
He already posted the links to the code in a previous post and also specifically mentioned it was free, in a post you 'liked'.

All the code you need is already available at numerous websites anyway, and for the led experts and engineers here it should be a piece of cake... took me 15 minutes to make a pwm dimmer, with remote control.
View attachment 3725691


This one: https://www.sparkfun.com/products/9570 (or a cheaper chinese version) would allow for something very similar to Dimlux's plant temp sensor that dims a HPS when the plants get too hot. Combined with IR leds, dim when it gets too hot, turn on or boost IR when they get too cold, i.e. measure and control leaf temp...
That last part...measure and control leaf temps...thats fuckin badass.but i need plug n.play.i sure as hell cant mess with coding stuff.how long before we see a packaged unit where all you do is plug in the sensors and change some parameters?
 

Sativied

Well-Known Member
Yeah I'm with you on that @sixstring2112. Hey I can code but rather have pnp. Would really want to control lighting, temps & r.h. mainly for pc/tablet & maybe smartphone.
https://punchthrough.com/bean/guides/getting-started/tech-specs/ basically a modified arduino with bluetooth support and smartphone apps. Recent kickstarter project. Not a whole lot of pins (ports, limited input and output), but would be enough for a small setup with just one or a few sensors. In addition to the lightblue bean, get:
http://www.icstation.com/channels-relay-module-arduino-msp430-p-1395.html
(Relay for light, heater/cooler, (de)humidifier)
And this one: http://www.icstation.com/dht22am2302-digi-temperature-humidity-sensor-p-1469.html
Not pnp but for someone who can code that's a very simple project. If you are familiar with game development, the arduino runs a loop as well. During that loop you check the input of pins to which sensors are connected, and use those values to determine which pins with outputs (relays or pwm connection for example) you want to turn off/on (or lower/higher). Lego for grownups... you can do what you describe with a few dozen of lines of code. Don't have to code the smartphone app either. Total about $50.
App example for ios: https://itunes.apple.com/us/app/handy-ble-simple-bluetooth/id985786496?mt=8
 

Sativied

Well-Known Member
That last part...measure and control leaf temps...thats fuckin badass.but i need plug n.play.i sure as hell cant mess with coding stuff.how long before we see a packaged unit where all you do is plug in the sensors and change some parameters?
I have no intention of packaging my unit or allowing custom sensors to be plugged in :eyesmoke: Would certainly be a nice optional touch to have the classic arduino 16x2 characters lcd in the lights some of the cob assemblers here sell, displaying some basic readings and dimmer+ timer. Like this one but orange backlight in robin's photons.

image.jpeg

That's the nice thing about custom arduino projects, they can easily be customized. The leaf temp feature would be easy to add to vegaswinner's project.

E.g.:
http://www.icstation.com/cjmcu-mlx90614esf-infrared-temperature-sensor-communication-module-p-6863.html (dci model has least interference but there are cheaper versions that would do). Also used for live stock and human body monitoring... might need lens or removal even but should work good enough. Code and wiring schematic: http://bildr.org/2011/02/mlx90614-arduino/
 

VegasWinner

Well-Known Member
That last part...measure and control leaf temps...thats fuckin badass.but i need plug n.play.i sure as hell cant mess with coding stuff.how long before we see a packaged unit where all you do is plug in the sensors and change some parameters?
That can be an available option. I an setup for a range sensors and have a menu setup to install the sensor and setup some use parameters. I have Cycle Timing as an option, but I focused on Lights On/ Lights Off first. My current model is an eight channel unit that can control a mix of LED's using both COB's and 3/5W led's.

For sensors I would have to add code for taking action to send a signal to an output pin meaning fewer LED channels, or go to a MEGA 2560 which has more output pins available or add a 12 channel pwm driver, there are plenty of options, but all cost something. peace
Vegas
 

Sativied

Well-Known Member
Here is an Update a little eye-candy, 8 channel PWM with independent Controls for On off, etc. Works great. making a few adjustments for the eight channel plug using an Uno 20x4 LCD, Rotary Dial and menu to change time or channel specifics.. peace
VegasView attachment 3776083
Looks great, love the rotary dial, much nicer than a bunch of typical arduino buttons and still effective. Looks much better with the 20x4 too, the 16x2 always screams it's arduino based.

Do you use a shift register for the lcd? If not, could free up some pins on the Uno. I use only 3 for the 16x2 using this:
http://www.instructables.com/id/Hookup-a-16-pin-HD44780-LCD-to-an-Arduino-in-6-sec/
Obviously a pain in the ass to create many times, but could print a bunch custom pcb for less than a $ each.
 
Top