Water Level's Limitation

Expansion modules and attachments
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

Just look inside the file.
It should be only in one place.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

lnevo wrote:Cool!!! I was a bit worried because I'd like to be able to measure the water level in my brute containers one day. If you can, are you able to see how high we can measure with the gain turned up now?
Agreed. I'm planning on doing this with 2 20 gallon Brute trash cans, 1 for RO/DI and 1 for SW.

Glad to see this will work.

Is this going to be incorporated into the libraries or will we need to make the change on our own in the future.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

Roberto

This is my WaterLevel.cpp:

/*
* Copyright 2010 Reef Angel / Roberto Imai
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* Updated by: Curt Binder
* Updates Released under Apache License, Version 2.0
*/

#include "WaterLevel.h"
#include <Globals.h>
#include <Wire.h>
#include <InternalEEPROM.h>


WaterLevelClass::WaterLevelClass()
{
level=0;
}

int WaterLevelClass::Read()
{
int iWaterLevel=0;
Wire.requestFrom(I2CWaterLevel, 2);
if (Wire.available())
{
iWaterLevel = Wire.read();
iWaterLevel = iWaterLevel<<8;
iWaterLevel += Wire.read();
}
return iWaterLevel;
}

void WaterLevelClass::Convert()
{
unsigned long t=0;
for (int a=0;a<20;a++) t+=Read();
t/=20;
if (t!=0)
{
t=map(t, InternalMemory.WaterLevelMin_read(), InternalMemory.WaterLevelMax_read(), 0, 100); // apply the calibration to the sensor reading
t=constrain(t,0,200);
}
level = t;
}



I couldnt find the instruction "addr+=0x03; // Programmable Gain" on line 55.

Am I doing anything wrong?

Rafa
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

That looks to be a really old library.
Did you install the Reef Angel Installer that you recently download from the website?
Roberto.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

Roberto

No.. I did noooooot. :oops: Shame on me

I used an old post teaching how to install on linux.

Totally newbie

Best regards
Rafa
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

So 1/2" pipe do we know the limitation yet? I have a 20 and a 30 brute. I'm about to redo my mixing station and get my AWC and RO feed to my reservoir upstairs setup.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

Try with a half inch pipe and let me know if you reach the limit
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

Lee;

I believe that is you do what Roberto said below there is not limit. I think I have seem people with 1/2" pipes over 20".
rimai wrote:I still have not had the time to test it, but by looking at the libraries, you can try changing the gain.
Line 55 of WaterLevel.cpp
Change this:

Code: Select all

	addr+=0x03; // Programmable Gain
To this:

Code: Select all

	addr+=0x01; // Programmable Gain
Let me know if this helps.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

Ok I ordered the multi level sensor. Roberto is it worth adding code to make the gain increase per channel or to active the change in code?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

Just a tip, I put a tee on the bottom of the pipe to keep it off the edge and also help keep it upright.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

I've done that too.
The difference is I drilled out the stop in the T so the pipe sides all the way thru and I glued the T a little off the bottom of the bin.

I think when you calibrate the WL sendor, do it with the T on so you get true 0.

Sent from my SM-G928P using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

I'm ok with it not all the way down. Will most likely have my rigid feed tubing go below the water level sensor opening. This way when I hit 0 there will still he water to draw
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

Lee,
How long are your WL tubes?
I saw on FB that you have your setup, up and running and i wanted to know if you had to change that line off code in the WaterLevel. Cpp.

Sent from my SM-G928P using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

Yes I changed that line of code. The Brutes are less than 36" I didn't measure but I can get some measurements later. It seems that there is plenty of headroom though.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

I'm using a 20 gallon Brute.
The WLS is only about 24".
I would like to know what length yours is so when I redo my water container it will be about 30".

Sent from my SM-G928P using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

So on the 20 gallon brute, it's working fine. On the 30g brute, there seems to be a cap on the water depth that it's able to manage. At some point it reaches the cap (~1500 on the sensor reading) and doesn't read higher at a certain depth. I'm currently filling to a bit under the lip where it expands (~22g). It seems that the first few inches before that lip all read at 1500.

On the 20g brute, I fill to around 16g and it reads fine as the water is drawn out. The only wierd thing is that the percentage seems off, but the rate of change seems the same, although I'm only looking at a 7 day windows. I just started monitoring the levels on reeftronics so I should be able to get a reading later this month to see if the rate is consistent or curved. Either way, it's good and i can rely on it for usage. Not sure if I'll hit the same cap if I overfill. I am at the same sensor reading for 100% (1520)

Roberto, any thoughts on being able to raise the sensitivity further?
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Water Level's Limitation

Post by Sacohen »

You added that 1 line of code yhat Roberto gave a while back?

What is the length of the pipe in the 30g?

Sent from my SM-G928P using Tapatalk
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

I would have to test the sensor.
It seems you are hitting the end of the sensor and not the end of the chip scale.
The chip is a 12bit ADC, which means 4096 steps. 2048 positive and 2048 negative.
If your readings are stopping at around 1500, it seems the chip can read further, but the sensor can't.
That means you would only be able to do that if the sensor was replaced with one with higher PSI reading.
The current sensor is for .52PSI
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

So it seems then that the limit is around the 18" mark.
User avatar
arch
Posts: 20
Joined: Sun Mar 10, 2013 12:22 am

Re: Water Level's Limitation

Post by arch »

I'm not sure about the multi-channel water level expansion, but according to the eagle files, the water level expansion (v1.2) uses a Freescale MPVZ5004GW7U pressure sensor.

The spec sheet for the sensor quotes a pressure range of 3.92kPa - or about 400mm.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Water Level's Limitation

Post by lnevo »

rimai wrote:I would have to test the sensor.
It seems you are hitting the end of the sensor and not the end of the chip scale.
The chip is a 12bit ADC, which means 4096 steps. 2048 positive and 2048 negative.
If your readings are stopping at around 1500, it seems the chip can read further, but the sensor can't.
That means you would only be able to do that if the sensor was replaced with one with higher PSI reading.
The current sensor is for .52PSI
Would the sensor we were talking about for co2 tank work in this application or we'd need something in the between somewhere?
arch wrote:I'm not sure about the multi-channel water level expansion, but according to the eagle files, the water level expansion (v1.2) uses a Freescale MPVZ5004GW7U pressure sensor.

The spec sheet for the sensor quotes a pressure range of 3.92kPa - or about 400mm.
400mm = 15.7 inches which is probably pretty close enough to what I'm seeing.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

Roberto

Using webwizard and RA*, how can I change the programmable gain?

Code: Select all

addr+=0x01; // Programmable Gain
Best regards
Rafa
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

Can't :(
Roberto.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

So..no alternative? The pipe is limited to aprox. 18 inches tall?

It's seems that cloud hub has a solution implemented

http://forum.reefangel.com/viewtopic.ph ... ain#p55404

Can't we just use "WaterLevelMax_write" function (or any other) to set the maximun value manually?

I use "roberto flow", and this is very important..
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

You would need to use Arduino IDE instead of webwizard.
That way you can manually change the libraries
Roberto.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

How can I do that?
Image
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

Ok.. just download the arduino software and upload using the RA+ option. Worked.. will try to change the gain.
Image
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

Something is wrong....

Installed the Arduino IDE, changed the gain, uploaded the code. But the calibration does not ends.... keeps running...

Image
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Water Level's Limitation

Post by rimai »

Did you download and used the latest dev branch of the libraries?
https://github.com/reefangel/Libraries/tree/dev
Roberto.
rrodriguess
Posts: 133
Joined: Sun Mar 09, 2014 11:01 am
Location: Santos - Brazil

Re: Water Level's Limitation

Post by rrodriguess »

No.. Just the Arduino software from the Download section. Gonna try and get back..
Image
Post Reply