Page 1 of 1

Water Level Sensor Calibration Problem

Posted: Tue Apr 08, 2014 6:52 pm
by ebbtide
I tied in my single water level sensor control. The 0% level calibration shows a reading of 0. If I accept this the 100% level also shows 0. There's no reading any where throughout the length of the pvc when calibrated in water. This module is connected to a expansion which also has a wifi connected to the expansion hub and the wifi works fine. I tried a different USB port but got the same results. Not sure what to try next.
TIA

Re: Water Level Sensor Calibration Problem

Posted: Tue Apr 08, 2014 8:50 pm
by rimai
0 is not normal.
What happens when you connect it directly to the relay box?

Re: Water Level Sensor Calibration Problem

Posted: Wed Apr 09, 2014 9:30 am
by ebbtide
Ok so I must have been tired last night when I wrote the post. I do have my wifi connected but not into the usb expansion. I do have a green light on the expansion when plugged into the relay box. I have tried plugging the water sensor into the relay box with the same results. Yet when plugged into the relay box the usb connector does not seem to insert all the way. I thought it should be ok cause I received power to the expansion module. Should the usb insert completely into the relay box connection?
When the sensor is calibrated and running is the output a linear slope from 0-100%
Is the 100% calibration done at the top of the pvc cap where the airline tube connects?
Thanks,

Re: Water Level Sensor Calibration Problem

Posted: Wed Apr 09, 2014 9:44 am
by rimai
Yes, it is a linear slope.
You can choose the 100% to be wherever you want.
That's why you calibrate it. To mark where you want the 100% to be at.
I use only 6 inches of the total length of the pipe, so my 100% is not at the top of the pipe where the cap is located.
Did you try another usb cable? This definitely seems wrong if you can't get any reading even with the module connected directly to the relay box.

Re: Water Level Sensor Calibration Problem

Posted: Wed Apr 09, 2014 5:05 pm
by ebbtide
I stopped at Best Buy and picked up another cable. That was the problem. Sensor calibrated fine and is now running my ATO. My sump and controls are downstairs and the DT is upstairs in the living room. I want to add another relay box for the DT. Is it the same as the one I received in the package? I just want to ensure that I can run my DayLight and Atinic's with dimming off the upstairs relay pack.
Thanks much for the help.

Re: Water Level Sensor Calibration Problem

Posted: Wed Apr 09, 2014 6:17 pm
by rimai
Cool.
No, the expansion box will not have functional dimming ports.

Re: Water Level Sensor Calibration Problem

Posted: Wed Apr 09, 2014 6:40 pm
by lnevo
If you have a plus you can use the ato switch ports into 5v pwm and extend the signal from those to upstairs now that you have the water level sensor working.

Re: Water Level Sensor Calibration Problem

Posted: Thu Apr 10, 2014 11:02 am
by ebbtide
Thanks for the info. I'm a little unsure how I would reconfigure my ATO inputs over to PWM outputs. My coding ability with C is lacking. I'm becoming more acquainted with the language and structure so hopefully in time I'll have a better understanding. I got to say the Forum is amazing. Full of knowledgeable members and thanks to Roberto for what may be the "Best" customer support around.

Re: Water Level Sensor Calibration Problem

Posted: Thu Apr 10, 2014 11:20 am
by lnevo
pinMode(lowATOPin,OUTPUT);
analogWrite(lowATOPin,X*2.55);

Change X to the % you want the pump to be. This is also built into the DCPump for LowATO in the dev branch of the libraries... we'd have to add the channel support into the libraries for HighATO. The standard only could do PWM on the Low...

ReefAngel.DCPump.LowATOChannel

You will also need a special jaebo cable to support 5V PWM I believe. Roberto can confirm

Re: Water Level Sensor Calibration Problem

Posted: Thu Apr 10, 2014 11:25 am
by rimai
I'm a little confused.
Are you using the standard dimming ports in the main relay box?

Re: Water Level Sensor Calibration Problem

Posted: Thu Apr 10, 2014 11:46 am
by ebbtide
Ok. So this changes the pin assignment to an output
pinMode(lowATOPin,OUTPUT);
This writes to that pin "X" *2.55
analogWrite(lowATOPin,X*2.55);
The 2.55 is milliseconds?
Can you point me in the direction where I can find a listing of the libraries, functions, and their arguments.
Thanks again

Re: Water Level Sensor Calibration Problem

Posted: Thu Apr 10, 2014 12:21 pm
by lnevo
http://www.easte.net/RA/html

the 2.55 is a scaling factor. Since we normally use 0-100 to represent %, the RA uses 0-255 for the amount of power to send to the output. So if you passed 0-100 you wouldn't get the full 5V output when you want 100%.

Re: Water Level Sensor Calibration Problem

Posted: Fri Apr 11, 2014 10:02 am
by ebbtide
Thanks Inevo for the information. I'm going to mess around this weekend with the code. Oh and backup my current code. i know that's working fine. A lot to learn but this stuff is sweet.