The Planted Tank Forum - View Single Post - Hacking the Fluval Fresh & Plant 2.0 LED light
View Single Post
post #3 of (permalink) Old 02-28-2016, 09:21 PM Thread Starter
Algae Grower
Join Date: Feb 2016
Posts: 13
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.
drjustice is offline  
For the best viewing experience please update your browser to Google Chrome