The Planted Tank Forum - View Single Post - Hacking the Fluval Fresh & Plant 2.0 LED light
View Single Post
post #5 of (permalink) Old 02-29-2016, 12:56 AM
theatermusic87
Wannabe Guru
 
Join Date: Jun 2014
Location: rochester ny
Posts: 1,270
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  
 
 
For the best viewing experience please update your browser to Google Chrome