Dosing Pump turned-on for no reason-Please Help!

Basic / Standard Reef Angel hardware
Post Reply
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

My kalk stirrer's dosing pump turned-on for no reason and ran longer than what is in memory. Luckily, I was by the tank and turned off. The dosing pump runs off a D/C powermodule. I don't know if these "stick", but I was able to turn-off via the Uapp. Initially, when I went back to "Auto" the button showed green and ran. I rebooted my controller and then re-saved my Internal Memory Dosing Pump parameters. After that, selecting the "Auto" button made it turn green, but the dosing pump didn't run (it did run in the "On" position). I synched the time and refreshed my Uapp page and then selecting "Auto" resulted in a red button with no pump running. Needless to say, this has me terrified as there is no "timeout" failsafe like with my ATO pump. Here is my code (the kalk stirrer dosing pump is Box 3_Port1 --see: if (hour() <=12 || hour() >= 19 ) ReefAngel.DosingPumpRepeat1( Box3_Port1 ). Please Help!

Code: Select all

#include <ReefAngel_Features.h>
#include <Salinity.h>
#include <Globals.h>
#include <RA_TS.h>
#include <RA_TouchLCD.h>
#include <RA_TFT.h>
#include <RA_TS.h>
#include <Font.h>
#include <RA_Wifi.h>
#include <RA_Wiznet5100.h>
#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetDHCP.h>
#include <PubSubClient.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_ATO.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <RA_CustomLabels.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <PAR.h>
#include <DCPump.h>
#include <ReefAngel.h>
#include <SoftwareSerial.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.Star();
    ReefAngel.AddMultiChannelWaterLevelExpansion();  // Multi-Channel Water Level Expanion Module
    ReefAngel.AddPHExpansion();  // pH Expansion Module
    
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    ReefAngel.FeedingModePortsE[0] = Port7Bit | Port8Bit;  //UV and UV Pump-off.
    ReefAngel.FeedingModePortsE[1] = Port7Bit;  //Skimmer-off.
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = 0;
    ReefAngel.WaterChangePortsE[0] = Port1Bit | Port2Bit | Port3Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[1] = Port4Bit | Port5Bit | Port6Bit | Port7Bit | Port8Bit;  
    ReefAngel.WaterChangePortsE[2] = Port1Bit | Port2Bit; 
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = 0;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit | Port2Bit | Port6Bit | Port7Bit | Port8Bit;
    ReefAngel.OverheatShutoffPortsE[1] = Port1Bit | Port3Bit | Port5Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[1] = Port1Bit;  // Powermodule Fixture On.
    // Use T2 probe as temperature and overheat functions
    ReefAngel.TempProbe = T2_PROBE;
    ReefAngel.OverheatProbe = T2_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_read();  // trying this code to see if it pulls internal memory overheat temp.

    // Ports that are always on
    
    ReefAngel.Relay.On( Box1_Port3 );  // Gyres always on.
    ReefAngel.Relay.On( Box1_Port8 );  // UV Pump always on.
    ReefAngel.Relay.On( Box2_Port1 );  // Powermodule Lights/Fans always on.
    ReefAngel.Relay.On( Box2_Port4 );  // Return Pump always on.
    
    ////// Place additional initialization code below here

    InternalMemory.FeedingTimer_write(7200);  // sets feeding mode to 2 hours (only used for coral feeding)... shuts down UV bulb, UV pump, and skimmer.
    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardLights( Box2_Port3 ); //Using Internal Memory Standard Lights to run Refugium Light.
    ReefAngel.StandardHeater2( Box1_Port2 );
    ReefAngel.StandardHeater2( Box2_Port5 );
    ReefAngel.StandardFan2( Box2_Port6 );  //Sump Fans
    ReefAngel.Relay.DelayedOn( Box2_Port7 ); //Skimmer
    ReefAngel.WaterLevelATO( 1,Box3_Port2 ); //ATO pump-DC relay box.    
    ReefAngel.StandardHeater( Box1_Port7,789,800 ); //Manages UV bulb on/off based on tank temp.  
    if (hour() <=12 || hour() >= 19 ) ReefAngel.DosingPumpRepeat1( Box3_Port1 ); // Run kalk stirrer dosing pump if <=12:00 pm OR >=7:00 pm.
    //ReefAngel.DosingPumpRepeat1( Box3_Port1 );  // Pump dosing kalk-DC Relay Box.- old code.
    ReefAngel.DosingPumpRepeat( Box1_Port4,20,30,900 );  // Stirrer on/off-- 20 min offset, starts every 30 minutes, 15 minute run time (60 seconds * 15 minutes = 900).
    if ( ReefAngel.Params.PHExp >= 100 && ReefAngel.Params.PHExp<= 620 ) ReefAngel.Relay.Off( Box1_Port1 ); //*** This line must occur BEFORE the CO2Control line*** Keeps Failsafe to shut-off Carbondoser at low Ca reactor pH, while keeping Carbondoser 'on' in the event pH Expansion value is lost or crazy reading <= 1.00.    
    ReefAngel.CO2Control( Box1_Port1, InternalMemory.CO2ControlOff_read(), InternalMemory.CO2ControlOn_read(), true ); //Turns on/off Carbon Doser (CaR CO2 Doser) based on Internal Memory values using pH Expansion probe's readings.
    ReefAngel.CO2Control( Box1_Port6,785,790 );  //FAILSAFE that turns off Ca Reactor Recirculation Pump (CaR Recirc Pump) if tank pH <= 7.85 and back on at 7.90.  NOTE: THIS IS THE ONLY REFERENCE TO Box1_Port6 and can't be REM'd out without adding a line for Box1_Port6.
    ReefAngel.CO2Control( Box2_Port8,785,790 );  //FAILSAFE that turns off Ca Reactor Fill Pump (CaR Fill Pump) if tank pH <= 7.85 and back on at 7.90.  NOTE: THIS IS THE ONLY REFERENCE TO Box2_Port8 and can't be REM'd out without adding a line for Box2_Port8.

   boolean buzzer=false;
   // if ( ReefAngel.isATOTimeOut() ) buzzer=true;
   if ( ReefAngel.isOverheat() ) buzzer=true;
   if ( buzzer ) ReefAngel.BuzzerOn(2); else ReefAngel.BuzzerOff();
   if ( ReefAngel.Params.PH > 851 ) ReefAngel.Relay.Off( Box3_Port1 );   //FAILSAFE that turns off Kalk Stirrer dosing if tank pH > 8.51.
   //if ( hour(now()) >= 15 && hour(now()) <= 18 ) ReefAngel.Relay.Off( Box3_Port1 );  //Turns kalk stirrer off from 3:00 pm - 6:00 pm to help balance daily pH (prevent late afternoon pH spikes). - don't want to use.
   //if ( hour(now()) >= 3 && hour(now()) <= 5 ) ReefAngel.Relay.Off( Box1_Port1 );  //Turns Carbondoser off from 3:00 am - 5:00 am to help balance daily alkalinity and to offset higher Ca reactor pH during daytime hours.
   if ( ReefAngel.Params.PH < 790 ) ReefAngel.Relay.Off( Box1_Port1 );   //FAILSAFE that turns off Carbon Doser if tank pH < 7.90.
   //if ( ReefAngel.WaterLevel.GetLevel(1) <= 63 ) ReefAngel.Relay.Off( Box1_Port1 );  //FAILSAFE that turns off Carbon Doser if sump water level <= 63.
   //if ( ReefAngel.WaterLevel.GetLevel(1) <= 63 ) ReefAngel.Relay.Off( Box1_Port6 );  //FAILSAFE that turnsoff Ca Reactor Recirculation Pump if sump water level <= 63.
   //if ( ReefAngel.WaterLevel.GetLevel(1) <= 63 ) ReefAngel.Relay.Off( Box2_Port8 );  //FAILSAFE that turnsoff Ca Reactor Fill Pump if sump water level <= 63.
 
    ////// Place your custom code below here
    
    
    ////// Place your custom code above here

    ReefAngel.Network.Cloud();
    // This should always be the last line
    ReefAngel.ShowTouchInterface();
}

   
// RA_STRING1=U2FsdGVkX1+BrIhUnNJiKHbFL6wohK41+33EQ2nHfFo=
// RA_STRING2=U2FsdGVkX1+EmuJjuPrMWBEHac9zWSjiW8ZytHk/q+M=
// RA_STRING3=Chloe's House-2.4
// RA_LABEL LABEL_ACTINIC=Actinic
// RA_LABEL LABEL_DAYLIGHT=Daylight
// RA_LABEL LABEL_PORT11=Main LEDs
// RA_LABEL LABEL_PORT12=Heater 2
// RA_LABEL LABEL_PORT13=Gyre Pumps
// RA_LABEL LABEL_PORT14=Kalk Stirrer
// RA_LABEL LABEL_PORT15=Salt Mix Tank
// RA_LABEL LABEL_PORT16=Co2 Control
// RA_LABEL LABEL_PORT17=Unused
// RA_LABEL LABEL_PORT18=Unused
// RA_LABEL LABEL_PORT21=Main T5s
// RA_LABEL LABEL_PORT22=Light Fans
// RA_LABEL LABEL_PORT23=Refugium LED
// RA_LABEL LABEL_PORT24=Return Pump
// RA_LABEL LABEL_PORT25=Heater 1
// RA_LABEL LABEL_PORT26=Sump Fans
// RA_LABEL LABEL_PORT27=Skimmer
// RA_LABEL LABEL_PORT28=ATO Pump
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

I use a time delay relay as a failsafe for any type of dosing especially if it's a concentrated solution. These will be independent of any controller to create a maximum time a relay can be switched on. Roberto pointed me to https://www.ebay.com/p/16012060306?iid=381936974053 previously but there are many versions that should fit your timing needs.

Tim
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

tngo wrote:I use a time delay relay as a failsafe for any type of dosing especially if it's a concentrated solution. These will be independent of any controller to create a maximum time a relay can be switched on. Roberto pointed me to https://www.ebay.com/p/16012060306?iid=381936974053 previously but there are many versions that should fit your timing needs.

Tim
Great idea, but the only thing I understand on that device is the knob. I would love to run some sort of relay timer for both my ATO and stirrer dosing pumps. I would prefer to run through the D/C Expansion as I run both dosing pumps from that. However again, I have no idea if it would work because I have no idea how to wire.

Any issues with my code?
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

Bump.
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

I'm not sure how your DC module works but if its reliant on the power expansion relays to power on and off at certain times then the time delay relay should work. The power expansion relay will supply power to the time delay relay which would supply power to your DC module. The time delay relay has its own timer and will shut off power even if power is still being supplied. The time relay will reset itself once the power cycles.

I was really afraid of something getting stuck and dumping all of the dosing solutions and crashing the tank. I think for timing redundancy you have to have a second clock running. The connections on the relay are pretty straight forward. I'll see if I can get a picture of my relay when I get a chance.

I'm no guru at looking at code so someone else could chime in.

Tim
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

tngo wrote:I'm not sure how your DC module works but if its reliant on the power expansion relays to power on and off at certain times then the time delay relay should work. The power expansion relay will supply power to the time delay relay which would supply power to your DC module. The time delay relay has its own timer and will shut off power even if power is still being supplied. The time relay will reset itself once the power cycles.

I was really afraid of something getting stuck and dumping all of the dosing solutions and crashing the tank. I think for timing redundancy you have to have a second clock running. The connections on the relay are pretty straight forward. I'll see if I can get a picture of my relay when I get a chance.

I'm no guru at looking at code so someone else could chime in.

Tim
I would love to see a picture.

The DC expansion is just a relay box but instead of 110v AC connections, it has 12v DC connections. I have mine plugged into a wall outlet not into a relay on one of my normal (AC) expansion boxes. I would rather just control individual DC connections instead of the whole DC expansion box if I could. However if I’m understanding correctly, the time delay relay can go off at any time; it will just run for the amount of time you set (for example 5 minutes). If that is the case, I could control the entire DC expansion box. If it works more like a timer where say every hour it turns on for five minutes and your device has to be set to run during those five minutes, then it wouldn't work because my ATO dosing pump also runs off the DC expansion and can go off at any time, and it would be too restrictive if limited to run at only certain times.

***Edited***

Ok, pardon my ignorance. Now I understand that the time delay relay just piggy-backs another relay. If that relay becomes stuck "on" the time delay relay shuts off after x amount of time. Once it detects no power, it recycles. For me, I would either have to use one of the normal 110v relays or find a way to run a time delay relay from my DC expansion box (e.g. running off of 12V DC). Both of my 110V relay boxes are about full, and I have no room for a 3rd so I would rather keep my dosing pumps running from the DC expansion if at all possible.
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

They should have 12V DC versions also if you go that route.
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

tngo wrote:They should have 12V DC versions also if you go that route.
That is exactly what I would want. However, I also have to be able to connect to it and have seen nothing that I would know how to connect male/female DC connectors to.
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

Pictures of my breakout relay delay box. For these time delay relay you will need the electrical connection adapter to mount the relay. An outlet from the RA Expansion runs through the top of the box an connects to pin 2&7. Pins 3&7 run down to a female plug adapter. Pin 1&2 are the trigger to start the timer.
relay_box-s.jpg
relay_box-s.jpg (26.56 KiB) Viewed 5771 times
relay_connection-s.jpg
relay_connection-s.jpg (36.67 KiB) Viewed 5771 times
Tim
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

Thanks for the pics. I can't really follow all of the wiring but at least I think I understand what I need to do. This isn’t an uncommon problem with controllers and programmable dosing pumps as a quick search will find all sorts of situations where dosing has gone amuck. In fact, I'm surprised someone hasn't created a simple device for this very reason. I can't imagine that anyone using a controller to manage dosing or anyone using an ATO wouldn’t want to purchase this failsafe. A simple time delay relay with (2) female DC connectors and either a potentiometer that allowed for adjustments up to five or 10 minutes or a series of dip switches that did the same thing, could service 120V with a simple 120VAC/12VDC converter, or it could connect directly to a 12VDC power source like I want to do. Unfortunately, I'm not the guy.
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

I think that the majority of aquarist prefer to dose by hand since a small error or equipment outage can destroy years of work put in a tank. Dosing pumps aren't the most accurate and need to be checked. So if you're only dosing a couple of chemicals once a day most would just do it all at once rather than having a dosing system to check every 3 months or so and the constant worry that the dosing pumps not turning off. The dedicated multi dosing units have emergency cutoff I would think, but they are so expensive. It's hard to make a all in one controller for a reasonable price so a big Thank You to Roberto and team!!! for bringing in the RA at a really nice price point. I guess if you could get 100-200 preorder of a failsafe relay for a reasonable price someone would set out to build it, but the demand probably isn't there; so we do the next best thing and mickey mouse something together. ;)

Tim
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

I disagree on the demand... most people, especially those that run controllers, do some sort of dosing (an ATO is a form of dosing). Also, manually dosing sodium bicarb or whatever one uses for alkalinity is risky business with high demand unless one is willing to dose multiple times per day. Look at the number of controllers, dosing pumps, dosing containers, ATO's, kalk stirrers, auto-water changers, etc. on the market. The only dosers this wouldn't help with are the programmable dosers. The only reason I would run programmable doser on a controller would be as a failsafe, and this would be a lot cheaper. Heck, anybody using their controller to fully-control their heaters could use the device if you could set it for long enough.
tngo
Posts: 139
Joined: Wed Apr 27, 2011 9:08 am

Re: Dosing Pump turned-on for no reason-Please Help!

Post by tngo »

True there a lot of different dosers out there. A controllable dosing expansion relay with it's own fail safe would be pretty cool. You can count me in for one.
jcjrogersstar
Posts: 43
Joined: Thu Jan 04, 2018 10:47 pm

Re: Dosing Pump turned-on for no reason-Please Help!

Post by jcjrogersstar »

tngo wrote:True there a lot of different dosers out there. A controllable dosing expansion relay with it's own fail safe would be pretty cool. You can count me in for one.
Now all I have to do is talk someone into mass producing one... :D ... :cry:
Post Reply