Hacking the Fluval Fresh & Plant 2.0 LED light - The Planted Tank Forum
 7Likes
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 55 (permalink) Old 02-28-2016, 08:26 PM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
Hacking the Fluval Fresh & Plant 2.0 LED light

Hi everyone,

i am big into Arduino hacking these days, and I wanted, like so many others, to write my own aquarium controller.

Lighting is obviously a big part of it, and I was looking to control the Fluval 2.0 LED ramp.

What first got me into this idea is the fact that the LED fixture can be controlled by a (crappy) touch-sensitive button, OR by a wifi gizmo that plugs between the wall wart and the fixture.

The Led 2.0 is a 2-channel light. It has white and blue. When you press the touch sensitive button on the fixture, it goes from WHITE, BLUE, OFF. Touch-holding the button will slowly dim, then slowly brigthen the LEDs.

Apparently, when you plug the wifi controller, the light needs to be in its OFF state for the controller to work.

The connector from from the wall wart to the fixture is some sort of 4-pin DIN connector. With a multimeter, I have easily identified +24V and 0V.

The two other pins are more complicated to figure out. Because the Wifi gizmo plugs directly into the wiring that has those 4 pins, I figured they could be PWM signal.


Without an oscilloscope, I used an Arduino to peek at the voltage signal coming from the 5V lines. Turns out the 5v turns on-and-off at not-so-steady rate that can range anywhere from 60 to 150 Hz, averaging at a pretty constant 87 hz over consecutive 10 second intervals of measurement.

Voltage on-off cycles typicall range from 6-8 milliseconds at 5v followed by 6-8 milliseconds at 0v, about 46% duty cycle. But a typical PWM should be at around 1000 Hz.

I don't have an oscilloscope here, but I don't think it's PWM. The wave is just too darned inconsistent and nowhere near the frequency of a typical PWM.

Maybe some sort of square or sine wave, though the voltage drops go from 5V to 0V quite quickly.

Going back to the WIFI gizmo that sits between the wall wart and the fixture, I'm guessing it's a self-sustained microcontroller that talks to the iPhone application, downloads the settings, and then drives the lights from the 5v signals of the connector.

So what I want is basically to reproduce the control of the WIFI gizmo has over the light, but I want to control the light depending on conditions other than just a schedule.

And besides, reverse-engineering stuff is just so much fun.

Anyone has suggestions on where to go from here?


For reference: you can look at the 4-pin plug and the wifi gizmo thing here:

https://www.youtube.com/watch?v=0UFszuRE30M
Attached Thumbnails
Click image for larger version

Name:	fluval-wifi.jpg
Views:	687
Size:	34.0 KB
ID:	598153  

Click image for larger version

Name:	24v-5v.jpg
Views:	666
Size:	39.1 KB
ID:	598161  


Last edited by drjustice; 03-01-2016 at 01:08 PM. Reason: fixed title
drjustice is offline  
Sponsored Links
Advertisement
 
post #2 of 55 (permalink) Old 02-28-2016, 09:13 PM
Algae Grower
 
Join Date: Feb 2016
Location: NE Florida
Posts: 7
Have you considered the possibility that the Arduino input may not be fast enough to capture a pwm signal? In other words, only capturing some of the pulses? That may explain the inconsistent measurements.
TimR@nefl is offline  
post #3 of 55 (permalink) Old 02-28-2016, 09:21 PM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
Quote:
Originally Posted by TimR@nefl View Post
Have you considered the possibility that the Arduino input may not be fast enough to capture a pwm signal? In other words, only capturing some of the pulses? That may explain the inconsistent measurements.
Yes. So I did a test. I hooked up a wire from PWM pin 3 and fed it directly into analog pin 0 (A0) which reads 5V voltage levels as 0 to 1023.

When I do this, I get a rock solid reading from the arduino.

But using the same code on the 5V signal of the Fluval, I get a lot of variability in the signal.

I used the code at the link below to do my test. It's an interrupt-driven approach to querying the signal, not polling, so should not miss pulses.

Three Ways To Read A PWM Signal With Arduino


I also did tests with the arduino pulseIn() function -- all yield similar results.


At some point I might bite the bullet and buy the wifi controller, spy on the output, try to replicate what it's doing.

But that would be a waste of 150$ and I'm like, ugh.
aubie98 likes this.
drjustice is offline  
 
post #4 of 55 (permalink) Old 02-29-2016, 12:36 AM
Planted Tank Guru
 
Join Date: Dec 2005
Location: Sacramento, CA
Posts: 21,015
Doesn't pulse width power control work by chopping the tail end off of each sine wave, so you get a sine wave start, followed by an abrupt drop to zero? That would show up as a weird wave shape, with the length of the off time being what determines how much the power is reduced.
Brian Rodgers likes this.

Hoppy
Hoppy is offline  
post #5 of 55 (permalink) Old 02-29-2016, 12:56 AM
Wannabe Guru
 
Join Date: Jun 2014
Location: rochester ny
Posts: 1,302
Quote:
Originally Posted by drjustice View Post
Yes. So I did a test. I hooked up a wire from PWM pin 3 and fed it directly into analog pin 0 (A0) which reads 5V voltage levels as 0 to 1023.

When I do this, I get a rock solid reading from the arduino.

But using the same code on the 5V signal of the Fluval, I get a lot of variability in the signal.

I used the code at the link below to do my test. It's an interrupt-driven approach to querying the signal, not polling, so should not miss pulses.

Three Ways To Read A PWM Signal With Arduino


I also did tests with the arduino pulseIn() function -- all yield similar results.


At some point I might bite the bullet and buy the wifi controller, spy on the output, try to replicate what it's doing.

But that would be a waste of 150$ and I'm like, ugh.
I don't remember all the details, but arginine pwm operates around 1000hz and other pwm operates up to 60000hz (again the details are fuzzy in my memory) but look into controlling pwm PC fans with an arduino fit more details
theatermusic87 is offline  
post #6 of 55 (permalink) Old 02-29-2016, 02:40 AM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
So I'm in front of an oscilloscope right now, and I feel like a bit of an idiot.

Keep in mind I'm a total noob here and until about 3 hours ago I knew nothing about oscilloscopes other than there was one at work. After a couple of youtube videos about how to use them, I was good to go.

So, the first thing is that I just realized that I was making measurements of the supposedly 5V pins without them being grounded, and what I saw must have been... I have no clue. But when I just look at that signal (not connected to ground) it definitely looks like an AC wave and goes way beyond 5V. It has a frequency of 60 hz (1st picture). Sorry again for the noobiness.


Now, the next pictures show the signal of the two pins with the probe properly grounded.

On the pin on the right, I read an AC wave of 320 mV differential (+/- 180 mV peaks), and on the pin on the left, I read an AC wave of 640 mV (+/- 320 mV peaks). Both signals at 60 hz,

It appears there's hardly any voltage there at all.

Certainly, the signal does NOT look like a square wave like you might expect from a PWM signal.

And it's all the more surprising that what IS there looks like an AC signal.


I'm going to get the Wifi thing tomorrow and I'll see if I can get the Wifi adapter to spew anything of significance out of those pins.
Attached Thumbnails
Click image for larger version

Name:	IMG_0293.jpg
Views:	616
Size:	83.4 KB
ID:	598545  

Click image for larger version

Name:	IMG_0290.jpg
Views:	618
Size:	86.6 KB
ID:	598553  

Click image for larger version

Name:	IMG_0292.jpg
Views:	643
Size:	85.5 KB
ID:	598561  

BettaBettas likes this.
drjustice is offline  
post #7 of 55 (permalink) Old 02-29-2016, 06:04 AM
Planted Tank Guru
 
Join Date: Jun 2013
Location: WI
Posts: 7,292
Maybe the wrong ground..

"A man with a watch knows what time it is. A man with two watches is never sure."

Last edited by jeffkrol; 02-29-2016 at 06:15 AM. Reason: edit
jeffkrol is offline  
post #8 of 55 (permalink) Old 03-01-2016, 12:50 AM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
Discussing this with coworkers today, we basically concluded that the AC signal described in previous posts was probably the scope reading AC noise/leaks coming from the wall wart and that there was likely no signal coming off of those pins, and that those pins might not even be connected to anything in the wall wart (or, maybe, to ground), who knows.

So, previous posts = garbage.

Anyway, I went and got the wifi controller instead.

And aha! Now we're talking!

After setting up the device, loading up the application and making sure I could adjust the lighting levels, I disconnected the lamp and hooked up the scope to the 0V and the two mystery pins.

I adjusted the brightness via the application, and looked at how the signal changed on the scope. And now, it the waveform certainly looks like a PWM signal at 500 hz and at 3.3 VDC. The only weird thing about it is that it seems to be negative voltage, going from -3.3v (LOW state) to 0V (HIGH state). I'm not sure why at this point, but the scope doesn't lie, and I tried reversing the scope's ground/measurement tips to see if I'd get a different polarity, and the signals went all wonky on me.

I added pictures of what I saw.

On the first image, you can see the regularity at which the scope sees the many cycles of what appears to be a PWM (I set the light at 50%) going from -3.3v to 0V. The image tells of a frequency of 250 hz, but I think that's because of how "zoomed out" I was on the time scale. When zoomed in a little bit on the individual cycles, the scope clearly shows a solid and steady 500 hz.


The other images below show the scope's results based on the settings of the wifi module/app.

10% brightness, 50% brightness, 90% brightness.


You can see a very constant rising of the wave, then jumps to top voltage for the % of the duty cycle programmed by the app.


So, now that I know what to look for and what to replicate, my next steps are to try to come up with code and circuitry based on an arduino that reads similar wave forms on the scope at the same frequency. Then, hook up the arduino to the lamp and see what happens.

Wee!

Just tested a couple of things with an Arduino.

1) The good news is that the default PWM frequency is.... 500 Hz.
2) I can also convert a 5V PWM signal to 3.3v using a simple level shifter like 74AHC125.
3) I can use an ICL7660 to negate this voltage (which I don't have right now)

Looks more and more like a piece of cake, but I'm bothered by the fact that the scope is reading a negative voltage for those pins.

But I'm beginning to form an idea as to why that might be, but anyone cares to offer hypothesis?
Attached Thumbnails
Click image for larger version

Name:	zommed-out-time.jpg
Views:	619
Size:	103.3 KB
ID:	598953  

Click image for larger version

Name:	10pct.jpg
Views:	599
Size:	132.0 KB
ID:	598961  

Click image for larger version

Name:	50_pct.jpg
Views:	596
Size:	126.2 KB
ID:	598969  

Click image for larger version

Name:	90_pct.jpg
Views:	607
Size:	125.5 KB
ID:	598977  


Last edited by Darkblade48; 03-01-2016 at 08:06 AM. Reason: Please use the edit function for back to back posts
drjustice is offline  
post #9 of 55 (permalink) Old 03-06-2016, 10:27 PM
Algae Grower
 
Join Date: Mar 2016
Posts: 5
How is progress going on this? I have the fresh & plant 2.0 and I'm interested in trying myself but don't have any arduino experience. Is anything besides the board needed?
benw is offline  
post #10 of 55 (permalink) Old 03-08-2016, 04:45 AM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
Sorry folks, It's been a very busy week, and this coming week I'm traveling. Sorry for the delay.

I've actually opened the wifi box, and I've found that:

- From the wall-wart going into the Wifi controller, only +24V and 0V are connected. The two other wires are actually cut (!!)

- The 0V and 24V powers a small motherboard that transmits the 0V and 24V at the other end, plus two channels of PWM per light. There are actually markings on the motherboard labeled PWM1 (light 1 - white), PWM2 (light1 - blue), PWM3 (light 2 - white), PWM4 (light 2 - blue).

- On the board I see 3.3v voltage regulators, confirming the 3.3v pwm output, but I can't figure out, from looking at the board and the components, how they negate the voltage.


The main obstacle at this point is generating the negative PWM which seems simple but happens to not be, because I'm too new with electronics.


Anyway, I have help at work, so I'll post instructions (wiring and code) on how to make this work once I've figured out the negative voltage thing.


@benw: Arduinos are made for kids learning electronics. They are quite capable little beasts. You should check it out. If you have any programming experience at all it will help, but if not you can probably learn bit by bit by osmosis with all the samples that are available.




Patience, patience...
drjustice is offline  
post #11 of 55 (permalink) Old 03-11-2016, 03:41 PM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
Btw, figured out what needed to be done.
drjustice is offline  
post #12 of 55 (permalink) Old 03-11-2016, 04:17 PM
Planted Tank Guru
 
Join Date: Jun 2013
Location: WI
Posts: 7,292
Quote:
Originally Posted by drjustice View Post
Btw, figured out what needed to be done.
share...

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is offline  
post #13 of 55 (permalink) Old 03-11-2016, 05:09 PM Thread Starter
Algae Grower
 
Join Date: Feb 2016
Posts: 13
I am still away and responding on my phone but basically:

Take a wire from the arduino pinout to the +leg of a capacitor.

Connect -leg of the capacitor to a diode going to ground and

Connect same -leg of the capacitor to voltage out.

You end up with pwm going from 0 to +5v from the pin, converted to -5v to 0v to Vout.

It's half of the standard circuit to convert positive pwm voltage to a sustained negative voltage.

http://www.eevblog.com/forum/blog/ee...rter-tutorial/

Now I just have to get back home from my week of travel and go ahead and do it.
drjustice is offline  
post #14 of 55 (permalink) Old 03-11-2016, 06:26 PM
Planted Tank Guru
 
Join Date: Jun 2013
Location: WI
Posts: 7,292
to be honest, I'm more intrigued by pictures of the inside than how you are modding it...

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is offline  
post #15 of 55 (permalink) Old 03-11-2016, 09:05 PM
Algae Grower
 
Join Date: Mar 2016
Posts: 5
Great info, thanks! I'm new to micro controllers, but have a decade or so of coding (mainly java & .Net). Haven't done anything with physical electronics in a long time. Interested to learning though.

A buddy of mine gave me his seeeduino along with his working code, luckily it has a 3.3v setting, though unfortunately no real time clock, will have to get the shield.

I have a guy at work to consult with, he seems dubious of the -3.3v. Are you sure that's correct? I agree with you that the pictures look like it is, but it just seems so strange. Any idea why it would be?

edit: didn't see the video post before, I get it now.
orig: If you were to flip the voltage on it wouldn't mirrored across 0v instead of translated down? I'm just speculating, don't know how that's supposed to work.

Last edited by benw; 03-11-2016 at 10:45 PM. Reason: watched video
benw is offline  
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in









Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.



Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome