straight forward float valve control

Request new hardware or ideas for the controller
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

straight forward float valve control

Post by rossbryant1956 »

the utilities that provide code for the standard and single ATO are wonderful and work great if that is what you want to do...

And I did see that I could change something in one of the libraries to not allow the pump to timeout. The problem with that, as stated, is when libraries are updated, I'd have to change it back.

I, however, use gravity based ATO's and would like to request code\libraries that would allow me to use the float valves to just monitor water levels. I have a number of tanks running off various pumps and the desired action if a switch is flipped is to just turn off the pump. Sending an alert would be a welcome bonus.

Appreciate any input\thoughts from the board

Ross
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

You can do that :)
Simply use this:

Code: Select all

ReefAngel.Relay.Set(Port1,ReefAngel.LowATO.IsActive());
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

Thanks Roberto...
Added Relay.Set() function. This can help simplify some of the if/else statements in your custom code.
CODE: SELECT ALL
ReefAngel.Relay.Set(PORT, boolean Condition);
So as I read this line of code it seems to say "do a relay_set OF Port1 BASED ON status of LowATO being active.

So if I understand it will let this port stay on as long as this switch is not "firing" or active.

Additional questions:

1. Any way to add an alert to notify me when the float valve trips and turns off the pump,
2. Does the relay reset and turn the pump back on when the switch falls back to base.
3. How do I address multiple float valves based on the expansion box I recently bought.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

1. Yes, you can use the portal trigger on ATOLOW=1.
2. Yes
3. ReefAngel.Relay.Set(Box1_Port1,ReefAngel.LowATO.IsActive());
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

Sorry, misunderstood #3.
The answer would be:

Code: Select all

ReefAngel.Relay.Set(Port1,ReefAngel.IO.GetChannel(0));
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

So I am finally getting around to building brackets and wanted to verify my idea prior to actually mounting the valve. The first job I will do is set it as a overflow on my main tank. If the water level gets too high it should turn the port OFF.

If I understand I will mount the valve WIRES DOWN with the line of code:

ReefAngel.Relay.Set(Box1_Port1,ReefAngel.LowATO.IsActive());

Is this correct?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

Yeap.
If you want to mount the float switch in the opposite direction, you can change the function to this:

Code: Select all

ReefAngel.Relay.Set(Box1_Port1,!ReefAngel.LowATO.IsActive());
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

and it would do the same thing? Turn off that pump when the float valve got to the stop?

Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

yeah.
The ! sign means "not", so it would check for low ato not active
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

got my bracket built and my float valves wired. Started looking how to wire them up and saw this in the manual:
Wiring your Reef Angel I/O Expansion Module
1. Connect each channel to your float switch or sensor wires.
2. Make sure they all share the same ground reference by using the remaining GND terminal and connecting to the other input signal wire.
that would seem to say that I put one wire in the Channel 0 port and additional float valves wires in channel 1, channel 2, etc. I do not understand what they are saying about the ground however...run all the other wires from each float valve to the same ground channel?

And finally, from the looks of it, these are straight wire runs, they do not use the little plugs on the end of the standard issue float valves.

Thx in advance for all the help
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

One leg of the float switch to GND and one leg to a channel.
GND will be common for all float switches.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

the picture shows two grounds. use only one for all ground wires?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

You can use both. They are the same.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

There seems to be significant differences between the two code lines
rimai wrote:

Code: Select all

ReefAngel.Relay.Set(Port1,ReefAngel.IO.GetChannel(0));
and

Code: Select all

ReefAngel.Relay.Set(Port1,ReefAngel.LowATO.IsActive());
What I need it to do is read that float valve on Channel0 and then turn off that pump if tripped. Will it still do that or do I need a combination of both of those lines?

As always, Thanks for the help.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

The first one will turn Port1 based on Channel 0 of IO module
The second one will do the same, but based on the ATO Low port.
You only need the 1st.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

IT WORKS!! Thank you very much!
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

I noticed something today that isn't affecting anything but thought I'd ask...

Thru the help of this board we wrote the following two lines of code:

Code: Select all

    ReefAngel.Relay.Set(Box1_Port1,ReefAngel.IO.GetChannel(0));
    ReefAngel.Relay.Set(Box1_Port2,ReefAngel.IO.GetChannel(1));
It is for a refugium and is slowly moving water thru a 20 gal long exactly like I'd expect. What I noticed is that my status light is coming on and the only way to clear it is with the ATO clear button. Again, it is not stopping the pumps, nor hurting anything in any way but I wondered if there is a way to override that button from firing. Thx in advance.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

The flag is coming from the ATO function and not from the lines you posted above.
Do you have any ATO function in your code?
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

Not to my knowledge. However, been 3 hours since I posted originally and light has not come back on. I run the client software 24/7, is there a log there of events? Here is my code:

Code: Select all

// Autogenerated file by RAGen (v1.2.1.158), (02/17/2012 22:55)
// Current Prod Code
// This version designed for v0.9.0 or later

/* The following features are enabled for this File: 
#define wifi
#define SIMPLE_MENU
#define RelayExp
*/

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <IO.h>
#include <ReefAngel.h>

/*
Ports assignment:

Port1 - Reservoir Heater
Port2 - Standard Lights
Port3 - Moon Lights
Port4 - Refugium Pumps
Port5 - WaveMaker One
Port6 - WaveMaker Two 
Port7 - Heater
Port8 - Return Pump
*/

void setup()
{
    ReefAngel.Init();  //Initialize controller
    ReefAngel.FeedingModePorts = Port4Bit | Port5Bit | Port6Bit | Port8Bit; // Turn off Port4, Port 5, Port 6, Port8 when feeding mode is activated
    ReefAngel.WaterChangePorts = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit; // Turn off Port4, Port5, Port6, Port7 and Port8 when water change mode is activated
    ReefAngel.TempProbe = T2_PROBE;  // Set the 1st plug (which acts like the 2nd plug) 
    ReefAngel.OverheatProbe = T2_PROBE;  // to monitor the overheat and temperatures
    ReefAngel.Relay.On(Port8); // Turn on Pump
}

void loop()
{
    // Specific functions
    ReefAngel.StandardLights(Port2,8,00,23,00); // Regular Lights on at 8:00am and off at 11:00pm
    ReefAngel.StandardLights(Port3,00,30,03,30); // Moon Lights on at 12:30am and off at 3:30am
    ReefAngel.StandardLights(Port4,23,30,14,30);  //Refugium schedule 11:30pm - 2:30pm
    ReefAngel.Wavemaker1(Port5);
    ReefAngel.Wavemaker2(Port6);
    ReefAngel.StandardHeater(Port7);
    ReefAngel.Relay.Set(Box1_Port1,ReefAngel.IO.GetChannel(0));
    ReefAngel.Relay.Set(Box1_Port2,ReefAngel.IO.GetChannel(1));
    ReefAngel.WavemakerRandom(Port5,15,60); // Turn Port5 on/off random cycles that lasts from 15 to 60 secs
    ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5)); // Turn Port6 on/off on opposite cycle as Port 5
    // Port 5 and 6 are synchronized.
    // They work in opposing motion of each other at random times.
    // turn on port 7 when temp falls below 76.0 and turn off when temp gets above 80.0
    if (ReefAngel.Params.Temp[T2_PROBE] <= 780 && ReefAngel.Params.Temp[T2_PROBE] > 0) ReefAngel.Relay.On(Port7); 
    if (ReefAngel.Params.Temp[T2_PROBE] >= 791) ReefAngel.Relay.Off(Port7);
    if (ReefAngel.Params.Temp[T1_PROBE] <= 780 && ReefAngel.Params.Temp[T1_PROBE] > 0) ReefAngel.Relay.On(Port1);
    if (ReefAngel.Params.Temp[T1_PROBE] >= 791) ReefAngel.Relay.Off(Port1);
    ReefAngel.Portal("rossbryant1956");
    ReefAngel.ShowInterface();
}


Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

This has now happened twice; both times causing bunches of water to spill. I'd appreciate any ideas on how to trouble-shoot.

The code above works fine until I go into feeding mode with this line of code:

Code: Select all

ReefAngel.FeedingModePorts = Port4Bit | Port5Bit | Port6Bit | Port8Bit; // Turn off Port4, Port 5, Port 6, Port8 when feeding mode is activated
when I do that it turns off one of my water movement ports detailed here:

Code: Select all

ReefAngel.Relay.Set(Box1_Port1,ReefAngel.IO.GetChannel(0));
ReefAngel.Relay.Set(Box1_Port2,ReefAngel.IO.GetChannel(1));
Only does that on channel 0, which is the tank full sensor, the tank keeps fillin' and then spillin'

My full .ino is in the post above. I'd like some help finding the bug or determining whether I can add the GetChannel ports to the feeding mode command. I just need it consistent.

Oh and I just remembered...the first time it did is was when it went into feeding mode, tonite it did it when it came out of feeding mode. Thx in advance to all.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

Sorry, I didn't understand what is happening.
The feeding mode turns off RefugiumLight, both wavemakers and the main pump.
Then what happens with channel 0?
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

I just noticed I don't need port 4 in there, but at any rate...

It seems to be turning off box1_port1 either on the way into feeding mode or out of feeding mode. What is happening is that port is no longer active once that happens.

I thought about this after going to bed...is it something to do with relaystate?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

Roberto, any ideas?
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

Are you sure that it turns off box1_port1 because of the feeding mode?
Isn't it because the float on channel 0 gets tripped?
If it turns off, how do you get spill?
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

I cannot say FOR SURE that is the feeding mode that is causing it, however, both times it has happened has been when the system was going into or out of feeding mode.

Channel 0 monitors a float valve facing up, and when tripped (or all the way up), turns off the pump plugged into box1_port1 stopping incoming water. What happens is that this port doesn't turn off, even tho the float valve is up, and the water keeps coming in. Eventually the water spills over the side.

Up to now, my entire disaster recovery plan is unplugging the pump plugged into box one_port one.

I think I read somewhere that I cannot put any box1_port1 statements in the feeding mode command but I could rearrange some things and move these pumps to box 0.

LMK what you think. Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

I found the bug :)
Thanks so much for finding it.
Let me make the change.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

Thx, LMK how I get the change.
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

rimai wrote:I found the bug :)
Thanks so much for finding it.
Let me make the change.
Let me know how I can get the fix. It happened again today (even when I wasn't messing with the feedingMode.)

Why is it stuff has to break only when I am NOT sitting here??!??

:cry:
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: straight forward float valve control

Post by rimai »

Then you have another possible problem.
This behavior was supposed to happen only if you are in another screen other than the main screen.
The bug was in the I/O data gathering.
It was gathering data only when the controller was on the main screen and that's why is misbehaving when in feeding mode.
I moved it so it will start gathering data all the time now.
But if you are saying that it was doing it when unateended, we need to find out why.
Roberto.
rossbryant1956
Posts: 471
Joined: Sat Jan 14, 2012 2:08 pm
Location: Montgomery Village, MD

Re: straight forward float valve control

Post by rossbryant1956 »

rimai wrote: I moved it so it will start gathering data all the time now.
I still do not understand how I would get this code. Is this fix in the libraries, the portal, or something that would to be loaded to my controller? Be advised one time I selected feedingmode from my local menu, and one time (the second time) from the portal menu.

As to the other problem I will watch it this week, build a snail guard for the valve, etc. Thx
Roscoe's Reefs - Starting Over Again:

Building new 29g Nano after landlord went berserk over my 4 75 gallon tanks, Multiple RA's, Water mixing stations, etc. Your help welcomed in remembering all I've forgotten.
Post Reply