Robo-Tank DIY Aquarium Controller Forum
Fluval Pro LED Lights - PWM Walkthrough - Printable Version

+- Robo-Tank DIY Aquarium Controller Forum (https://www.robo-tank.ca/forum)
+-- Forum: Robo-Tank Arduino Based - NO LONGER AVAILABLE (https://www.robo-tank.ca/forum/forum-16.html)
+--- Forum: DIY Hardware Questions (https://www.robo-tank.ca/forum/forum-18.html)
+--- Thread: Fluval Pro LED Lights - PWM Walkthrough (/thread-306.html)

Pages: 1 2


Fluval Pro LED Lights - PWM Walkthrough - jlysaght3 - 06-27-2018

Hi everyone, this is my first post on the forums, so I thought I'd make it a good one.

A few notes:
  • This post/tutorial assumes you have a basic understanding of electrical/electronics and very basic knowledge of transistors. If you do not, Google and Youtube are your friends - I highly recommend researching transistor polarity (NPN transistors and PNP transistors, their differences, polarity, and usages), PWM equipment, etc.
  • DISCLAIMER: I am in no way an expert. I have no formal training, and I do this for my own entertainment and to suit my own needs. I claim no responsibility for any actions that you may take after reading my walkthrough, and this is strictly AT YOUR OWN RISK. The fact that I am willing to risk damage to my $400 in LED lighting does not in any way qualify me as an expert (if anything it qualifies me as reckless and an idiot) - so basically use my tutorial at your own risk. IF I have a failure in the future I will post it, and document as much as I can about it.


I have tried to do the best showing aquarium I can without spending ridiculous amounts of money on my equipment. I am very much a DIY kind of guy, which is why I went with Robo-Tank over any other tank management system. I have also looked for lower cost equipment that can do what I need and that can be modified to expand its usefulness. I am running an ~90 gallon total capacity saltwater Reef tank with a predator refugium (corals, clowns, angelfish, starfish, CUC emerald shrimp, anemones in my reef tank and two snowflake eels in my refugium) + a sump for all of my filtration and equipment. Due to the fact that I am currently running smaller tanks (55gal reef, 25gal fuge) and I plan on expanding in the future I could not justify spending high hundreds to low thousands on lighting, considering I will eventually transition these for a larger tank. I also needed full spectrum lighting to ensure proper coral/anemone growth, and to enhance fish coloration. Thus, the Fluval lights.

Anyone who has purchased the Fluval Pro series lights has probably considered the Fluval Wifi controller, which I purchased, and deemed lower than whale dung in quality and usability. Between a PTP-only wifi connection to control it, the fact that it gets HOT when operating, its $90 USD price, and that whenever power is lost to it the unit has no clock memory, I deemed it an utter piece of crap and terribly overpriced piece of garbage.

I decided to control my pair of Fluval Pro Reef lights with the Robo-Tank. In doing research, I learned that there was one small (major) issue with this - when the PWM signals are connected directly, OFF on the Robo-Tank PWM signal results in about 33% lighting, and FULL results in lights OFF. After some research I discovered why: The arduino boards do 0-5V PWM (for power feed control), while the Fluval Pro lights are wired for Ground Circuit control of the PWM (open circuit to grounded). In short, I needed to reverse the polarity of the PWM signal coming from the Arduino board inside of the Robo-Tank so that I can control my lights.


Spoiler alert: I figured it out. This will work on ANY LED lighting that is ground controlled PWM, just be aware that YMMV.

The below tutorial is designed for use with TWO Fluval Pro reef lights. Expand or reduce quantities as necessary to meet your needs

Parts list:
  • 2x Fluval Pro Full Spectrum Reef grade lights (though this will work for ALL PWM Fluval lights that are compatible with their Wifi controller) - Cost NC, already had them. If you are looking for a complete start-up, $220USD for the 36 inch, $180USD for the 24-inch, so $400USD total
  • Fluval Wifi Controller: I scrapped mine for this so as to not cut my power/light cords, however if you are comfortable cutting your cords and wiring a permanently attached module to your lights then you can save the money here - cost $90 USD
  • Robo-Tank or equivalent arduino-based controller (assuming you already have it, otherwise this tutorial does not apply) - price: NC
  • Generic breadboard, 5cmx7cm for my needs (you could use smaller or larger - I chose one that fit snug inside of the casing for the Fluval Wifi Controller) - Price: Came in a pack of about 36 pieces from Amazon for $10, so if you have them lying around, FREE, otherwise up to $10 for a pack of breadboards
  • 4X TIP122 transistors (any NPN transistors will do) - I chose these for their 5A/100V power rating since my power adapters for my lights are max 2A@24V - cost $11.20USD for 10, or $1.12/ea, so $4.50 for this project
  • 4X heatsinks, 10mmx10mm (you could use smaller or larger, and I am not convinced that these are completely necessary in the first place - I err on the side of caution) - 12 pcs for $9 on Amazon, so about $3USD total here
  • Soldering Iron, wire, solder, flux, etc - I already had all of this, so no calculated cost here
Technical talk:

The Arduino board PWM outputs are geared to go from supplying zero voltage at minimum to 5V at maximum, because the arduino utilizes a PNP transistor to manage PWM outputs (in short, it controls the positive side of the PWM circuit). The Fluval LED Lights are geared to receive an open circuit at minimum and a closed (grounded) circuit at maximum (in other words, it controls the GROUNDED side of the circuit). In other words: no connection = lights off, full connection = lights MAX. Thus, we need to convert 0-5V to Open-Closed from the arduino. The easiest way to reverse the control is to substitute an NPN transistor in each control circuit to effectively REVERSE the voltage. The TIP122 is a fairly common circuit, offers decent power/amperage capability, and is highly recommended for arduino based projects. Also, it is CHEAP. We will take the PNP signal output from the arduino (wihch gives a positive voltage output) and connect that to the control circuit side of an NPN transistor (which controls an open/grounded circuit) to basically reverse voltage and allow us to control the Fluval LED lights.

The problem:
Arduino and Robo-Tank outputs a POSITIVE PWM signal. Fluval Pro LED requires a GROUNDED PWM signal

Steps I took:
  1. I gutted my Fluval Wifi controller. As far as I am concerned, it is garbage and I could not justify charging someone else for that hunk of garbage, so I decided to repurpose the wiring terminal connectors and casing for my project. I did discover the wiring colors and pin-outs in the process:
    1. WHITE: power (24V) to the lights
    1. YELLOW: ground (0V) to the lights
    1. RED: PWM daylight signal to the lights
    1. BLACK: PWM moonlight signal to the lights
  2. I kept the electrical connectors, de-soldered them from the board and cleaned up the wire ends. I then took my 5cm x 7cm board and soldered two runner wires from one end to the other to act as primary power for the lights + I joined the E terminals for each light (1+2, 3+4) together and soldered these to the common grounds (yellow feed wires from the plugs)
  3. I soldered 4 TIP122 transistors in place at the output end of the board. I staggered them so I had room to run a power/ground wire between them for the CH1 and CH2 lights (1st Pro light and 2nd Pro light)
  4. I wired in the output connectors with ground and power hooked up, then connected the BLACK and RED wires of each plug to the C terminals of their respective TIP122 transistors
  5. I used an ethernet cable and wired the ORANGE/ORANGEWHITE and BROWN/BROWNWHITE wires to the ground (yellow) circuits of the connectors 1 + 2 respectively
  6. I wired:
    1. BLUE wire to the B terminal of transistor 1 (for LED 1 daylight control)
    1. BLUEWHITE to the B terminal of transistor 2 (for LED moonlight control)
    1. GREEN to the B terminal of transistor 3 (for LED 2 daylight control)
    1. GREENWHITE to the B terminal of transistor 4 (for LED 2 moonight control)
  7. These wires were then connected to the GROUND and PWM 1-4 outputs
  8. I then packaged the circuit board inside of the original Fluval Wifi controller, drilled a hole for the wire in one end, and connected it to the Robo-Tank and the LED lights through the original Fluval Wifi plugs. When I programmed the lights I had full range from full OFF to full ON, with the Robo-Tank level of LED intensity adjustments we have all come to expect.

When completed the result is a PWM controllable Fluval LED Pro lighting setup. I can dim and control the lights and the total power draw is well within the 5A capacity of the TIP122 transistors.


A few notes:
  1. I actually went through 8 TIP122 transistors and 2 breadboards, simply because I am terrible at left-right identification, especially when reversing the transistor orientation
  2. I gutted a perfectly good $90 Fluval Wifi controller to do this - you can cut your wires and save the $90 if you are willing to void your LED lighting or power brick warranty
  3. I have only had this running one day. It is still running way cooler than the original Fluval LED Wifi brick, but I still felt this worth mentioning.
If anyone has feedback please let me know. I am happy to discuss my experience and offer tips to those who need them. I am a hobbyist like everyone else here, and while I only run 90 gallons today, my end goal is around 500G across 2 200+G tanks plus a sump with a predator tank and reef tank plumbed together (running top and bottom down one wall). I am happy to discuss ideas, concerns, and questions in open forum or via PM.

More pictures of my setup available upon request


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 06-28-2018

Wow this is great, thanks and well done! Definitely want to see pictures of your setup. :)

One thing I have is the LED channels aren't coming from the Arduino DUE, the board has a PCA9685 mounted which gives the 16 12-bit channels, this communicates with Arduino using the I2C bus, but yeah obviously they're similar.

Here's a video explaining how to calculate if the NPN will get hot and require a heatsink. I tried to check for TIP122 but the datasheet doesn't have the RDSon.

https://www.youtube.com/watch?v=GrvvkYTW_0k

What kind of connectors does the light have? If they're available maybe I can offer a conversion box for users to plug into.

Well great job and thanks for the details.


RE: Fluval Pro LED Lights - PWM Walkthrough - jlysaght3 - 06-28-2018

Okay so I had trouble uploading photos last night when I wrote up this walkthrough and my experience. I have since made the files shareable and public in my Google Drive, so I am inserting links to the photos here.

First off, Rob, for the connectors they appear to be a standard 4-pin water resistant screw lock connector. From my research it is a standard connector type, however the size is somewhat debated, so I cannot provide an exact description / link to a matching set. Below is an image which sort of highlights the way they are built. Please note - this was an early rendition of the PWM signal reversing board that I built (which I wired completely backwards, so please disregard the board in this one). I actually decided to stay away from this board arrangement because I thought that my new setup looked cleaner and offers some potential expandability for the future in the event I decide to add more functionality inside of this module.
https://drive.google.com/file/d/19l8JnaLDQ1v6_ecWW980VE-mOiweeqyZ/view?usp=sharing

Next is my pre-wiring on the back of the breadboard. This is the ground wiring and the power wiring as seen from the bottom of the finished project. The bottom of the image would be the power IN side, while the top would be the power OUT side. From left to right my wires would be connected to +24V light 1, Ground light 1, +24V light 2, ground light 2. The black junction wires at the top of the image are to connect the Emitter of each transistor. You will notice that I kept the two light plugs electrically independent of each other so that if one power brick dies it does not risk overheating/overdrawing the other light.
https://drive.google.com/file/d/1ucj0Jlh3_gQ2Pw7EqdcWSJOKJSawSB5x/view?usp=sharing

This is the top of the board with the transistors soldered on to the top and the pins for ground at the Emitter terminals soldered to the wiring. I did leave about a quarter inch of transistor electrode terminal above the board when I soldered them so I could bend the transistors over to maintain a low profile on the board.
https://drive.google.com/file/d/1bHUYAp4MGSoyMfkW2Q0HaVKBFgU5qa82/view?usp=sharing

I then soldered my input and output plugs onto the board and also soldered on my power signal wires from the Robo-Tank to the light control interface. As a reminder: RED is for the white light channel, BLACK is for the moonlight channel.
For the control circuits, I used standard CAT5e cable. I soldered the orange/orangewhite and brown/brownwhite circuits to each independent light circuit ground, and then soldered the blue to light 1 WHITE, bluewhite to light 1 MOON, green to light 2 WHITE, greenwhite to light 2 MOON.
https://drive.google.com/file/d/1XbOG3ZEye1qi_tzd5UyneKmhopax3Am7/view?usp=sharing

Fully mounted in the original Fluval Pro Wifi controller case the plug ends hold the circuit board in snugly without any additional fastening. The case snaps back together, but for the sake of showing the fully assembled and functioning board in the case I have this photo with the case open.
https://drive.google.com/file/d/1bhbNjPtuHwhxtwowBRWWQAaQFHxrILD6/view?usp=sharing

The entire board / lighting setup has been running for 24 hours now and the light controller board operates at room temperature, which is alone a massive improvement over the original Wifi module which got too warm for comfort, especially if it sits on carpet / other potentially combustible materials.

I hope this helps others and I will continue to share other projects that I tackle along the way.


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 06-29-2018

Looks good, that board fits nice in the case and give it factory finish. :)


RE: Fluval Pro LED Lights - PWM Walkthrough - rott - 07-10-2018

very nicely done


RE: Fluval Pro LED Lights - PWM Walkthrough - jlysaght3 - 07-11-2018

Update:

I have found that running my lights under 50% intensity has been fine on my schedule. When I try and turn the lights up to max (especially on the white channel) something messes up and the lights go dim until I reboot the Robo Tank and power cycle the lights.

I suspect it might be an overcurrent issue so I have some testing to do. The transistors are rated at 5A, and my lights are powered by a 3A and a 2A power brick, each of which powers two channels (a blue and a white light channel) so I should be within operating range of the transistor. I'll have to check temperatures to see if the transistors are overheating.

Rob, what are the current and resistance limitations of the PWM channels on the robo tank board? I'm wondering if it is possible that I am overloading something in the circuitry there instead.


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 07-11-2018

Hi jlysaght3, sorry I don't have any suggestions. The controller uses the PCA9685 for the LED channels, each channel is good for 25ma and I'm not sure about resistance, here's a link to the datasheet.

I did notice in the datasheet it talks about ground bounce which might have something to do with it.

https://www-users.cs.york.ac.uk/~pcc/Circuits/dome/datasheet/PCA9685_2.pdf


Quote:Ground bounce is a possibility, especially if all 16 outputs are changed at full current (25 mA each). There is a fair amount of decoupling capacitance on chip (~50 pF), which is intended to suppress some of the ground bounce. The customer will need to determine if additional decoupling capacitance externally placed as close as physically possible to the device is required.

Hope you're able to solve it.


RE: Fluval Pro LED Lights - PWM Walkthrough - fietsenrex - 07-14-2018

I would suggest oversizing the transistor.
Due to the PWM you are using it heats up quite a lot, the continous switching of 5A at 1KHz is quite intense for a resistor..
Blew 2 transistors that way with PWM speed control on my fans, oversized the transistor and added a heatsink to it and it works like a charm now


RE: Fluval Pro LED Lights - PWM Walkthrough - jlysaght3 - 07-16-2018

So I did some research and did some testing.. here are the results:

When driving the LED lights at full power the transistors do not heat up beyond lukewarm - in other words, I can easily place my hand (or finger) against them and not feel uncomfortable, so I am ruling out the over-current idea (for now)

What I have found in research is that most wiring diagrams and recommendations for the TIP122 and Arduino environments is to put a resistor in between the collector on the transistor and the control side (arduino/PCA9685 board). This is most commonly found when driving a motor off of the 5V controller, however it is also recommended for driving any load as a shield to the controller.

My next step is to get a few 1kOhm resistors and wire them in and test it out.

As a safe measure I will also be adding my heat syncs to the transistors to ensure proper heat dissipation. As a side note, I also have the box that the transistors and board are in located directly in the path of my HVAC vent, and this time of year in NJ we are seeing regular 90 degree weather, so my central air runs throughout the day when the daylight LEDs are on - I consider this a lazy form of passive cooling.

My next post will include pictures and results as described here. If I can get this working reliably at full power then this is definitely something that I think others could use, and something I will continue to use moving forward - especially when I upgrade to a larger tank considering that I am only using 4 channels of the LED controller, and I would assume with matched transistors/lights I should be able to run certain channels in parallel on a much larger setup (testing to come later, after I win the lottery LOL)


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 07-16-2018

There is a 1k resistor inline on each channel, I also add those for other pump ports so I don't know if another would help. Does the PCA9685 heat up? On the lottery I can help because I have the winning numbers, you buy the tickets and we split it lol...


RE: Fluval Pro LED Lights - PWM Walkthrough - fred73 - 09-20-2018

Hi Everyone

I have the Fluval 3.0 Bluetooth version. Any chance to do the same mods ??

It would be great to be able to use Robo tank o control the lights


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 09-20-2018

Hi Fred, sorry I don't have the answer but I have a feeling it's setup the same, the only way I would know is opening it and measuring voltages to see if the PWM is ground controlled. You should be able to get those from contacts coming off the drivers. Sorry I can't be of more help at this time.


RE: Fluval Pro LED Lights - PWM Walkthrough - fred73 - 09-20-2018

(09-20-2018, 10:37 PM)Rob F Wrote: Hi Fred, sorry I don't have the answer but I have a feeling it's setup the same, the only way I would know is opening it and measuring voltages to see if the PWM is ground controlled. You should be able to get those from contacts coming off the drivers. Sorry I can't be of more help at this time.

Hi Rob

I will try opening the Lights and see what inside lol and take pictures


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 09-20-2018

Sounds good, post the pics and maybe we can figure out.


RE: Fluval Pro LED Lights - PWM Walkthrough - fred73 - 09-23-2018

Hi Rob

See few pictures i guess i will need to remove all the glue and get to the electronic parts

[attachment=354][attachment=355][attachment=356][attachment=357]


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 09-23-2018

Hi Fred, I started by searching the part numbers on the 3 large IC's, in 2nd image the top brown one appears to be the bluetooth but all datasheets were Chinese so not certain but think so. The 20 pin IC under it appears to be the MCU and reading the datasheet it does have 2, 10-bit PWM channels however I couldn't find anything saying which pins on the IC are for that purpose. Also I'm a little confused, if the PWM is coming from the MCU where is driver for the LED's? Do you see anything else in the light or just that board and board with LED's?

This is the datasheet I'm looking at.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001795E.pdf

The 3rd 8pin IC at bottom on image 2 appears to be a LP2951, in the datasheet it says the device markings is KY5133 so I think it's the same. The datasheet says this is an adjustable voltage regulator so can't see that being used for the LEDs.
http://www.ti.com/lit/ds/symlink/lp2951.pdf


RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 09-23-2018

One thing you could do to start, use your volt meter and see if you get DC voltage on the 2 contacts in the first image. I'm guessing that's the power fed to the LED's. Check the voltage when the lights are full power and check again when lights are set to 50% brightness.

If you do get a DC voltage on those contacts, leave the GND probe from your meter on the black terminal in image 1 and then with positive terminal touch each of the 7 contacts from the "processor" board to the LED board. Mark down any voltages you might see on the different pins and then change brightness of light and test them all again to see if any changed.


RE: Fluval Pro LED Lights - PWM Walkthrough - fred73 - 09-23-2018

(09-23-2018, 07:20 PM)Rob F Wrote: One thing you could do to start, use your volt meter and see if you get DC voltage on the 2 contacts in the first image. I'm guessing that's the power fed to the LED's. Check the voltage when the lights are full power and check again when lights are set to 50% brightness.

If you do get a DC voltage on those contacts, leave the GND probe from your meter on the black terminal in image 1 and then with positive terminal touch each of the 7 contacts from the "processor" board to the LED board. Mark down any voltages you might see on the different pins and then change brightness of light and test them all again to see if any changed.

Hi Rob 

Thanks for all your help, really appreciate

I will try to remove the black  silicone and crack it open this afternoon

 I saw that on planted tank some one did the same but with the version 2.0

https://www.plantedtank.net/forums/20-diy/1009705-hacking-fluval-fresh-plant-2-0-led-light.html


RE: Fluval Pro LED Lights - PWM Walkthrough - fred73 - 09-24-2018

(09-23-2018, 07:13 PM)Rob F Wrote: Hi Fred, I started by searching the part numbers on the 3 large IC's, in 2nd image the top brown one appears to be the bluetooth but all datasheets were Chinese so not certain but think so. The 20 pin IC under it appears to be the MCU and reading the datasheet it does have 2, 10-bit PWM channels however I couldn't find anything saying which pins on the IC are for that purpose. Also I'm a little confused, if the PWM is coming from the MCU where is driver for the LED's? Do you see anything else in the light or just that board and board with LED's?

This is the datasheet I'm looking at.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001795E.pdf

The 3rd 8pin IC at bottom on image 2 appears to be a LP2951, in the datasheet it says the device markings is KY5133 so I think it's the same. The datasheet says this is an adjustable voltage regulator so can't see that being used for the LEDs.
http://www.ti.com/lit/ds/symlink/lp2951.pdf

Hi rob

Some info on the Bluetooth Module

https://fccid.io/CCT-DPV70-01/User-Manual/User-Manual-3442011
http://blmworld.com/e_productshow/?103-CC2541-BT40-HY254104-V7-103.html

Another avenue i was thinking is if we add a Bluetooth shield to the arduino. Can we then modify the robot tank sketch to talk to the Bluetooth Fluval lights :) 

https://www.freetronics.com.au/products/btsh-bluetooth-shield#.W6nHiugzaUk

(09-24-2018, 11:30 PM)fred73 Wrote:
(09-23-2018, 07:13 PM)Rob F Wrote: Hi Fred, I started by searching the part numbers on the 3 large IC's, in 2nd image the top brown one appears to be the bluetooth but all datasheets were Chinese so not certain but think so. The 20 pin IC under it appears to be the MCU and reading the datasheet it does have 2, 10-bit PWM channels however I couldn't find anything saying which pins on the IC are for that purpose. Also I'm a little confused, if the PWM is coming from the MCU where is driver for the LED's? Do you see anything else in the light or just that board and board with LED's?

This is the datasheet I'm looking at.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001795E.pdf

The 3rd 8pin IC at bottom on image 2 appears to be a LP2951, in the datasheet it says the device markings is KY5133 so I think it's the same. The datasheet says this is an adjustable voltage regulator so can't see that being used for the LEDs.
http://www.ti.com/lit/ds/symlink/lp2951.pdf

Hi rob

Some info on the Bluetooth Module

https://fccid.io/CCT-DPV70-01/User-Manual/User-Manual-3442011
http://blmworld.com/e_productshow/?103-CC2541-BT40-HY254104-V7-103.html

Another avenue i was thinking is if we add a Bluetooth shield to the arduino. Can we then modify the robot tank sketch to talk to the Bluetooth Fluval lights :) 

https://www.freetronics.com.au/products/btsh-bluetooth-shield#.W6nHiugzaUk


You can find more details here lol 

https://fccid.io/2ANPT14531/Internal-Photos/Internal-Photos-3902477

For sure the schematic is protected lol

https://fccid.io/2ANPT14531



RE: Fluval Pro LED Lights - PWM Walkthrough - Rob F - 09-25-2018

Hi Fred, sorry about the delay, something came up and i have to leave for night.

That bluetooth module info looks interesting, the module has PWM channels of its own, those could be what's actually driving the lights as well. I would love to add a bluetooth module so we could communicate directly however I wouldn't know the commands the light response to. I know with lights using IR for a remote there are different commands sent so I'm guessing it's the same with bluetooth. If you could find that info then we would be talking. It wouldn't be too difficult to add the module to the controller but need to know commands to turn lights on/off and change the brightness.



I just sent a message to Fluval to see if they would send me the commands the light respond to.