Page 2 of 3

Re: 2 RAs in tandem + H2O Automation

Posted: Fri Mar 21, 2014 8:22 pm
by lnevo
Hooked up the relays tonight. Connected to the RA. Left it on high trigger. Working perfectly. PWM controller for the pump is hooked up as well. All electronics components are now in place. Oh, minus one more float switch. Plumbing, mounting, cabling still to come..

Re: 2 RAs in tandem + H2O Automation

Posted: Fri Mar 21, 2014 8:22 pm
by Sacohen
Good going.

Sent from my HTC One VX using Tapatalk

Re: 2 RAs in tandem + H2O Automation

Posted: Fri Mar 21, 2014 8:33 pm
by lnevo
Ok I spoke to soon.. I went to hook it up again to the RA to take a video and nothing was working. I measured the output now from the PWM and I'm getting 0. Not sure what happened... :(

Relays are working fine however...

Re: 2 RAs in tandem + H2O Automation

Posted: Fri Mar 21, 2014 8:47 pm
by Sacohen
That sucks.

Sent from my HTC One VX using Tapatalk

Re: 2 RAs in tandem + H2O Automation

Posted: Sat Mar 22, 2014 5:03 am
by howaboutme
lnevo wrote:Got the replacement relays last night. Probably won't have time to connect and test them for a little while. Also received a delivery from Roberto. My dimming module.. so I can hack my D-120s and a salinity module so i can automate salt mixing :) I need to start working on the code for all of this soon...
Hey Lee...When you do the D120 hack, can you document w/ a lot of photos? The official thread is short on photos detailing each individual steps making it hard for non-electronics people to follow along. I can only read so much short this, short that jargon. :D

Re: 2 RAs in tandem + H2O Automation

Posted: Sat Mar 22, 2014 5:12 am
by lnevo
Will do...not rushing into that...especially after this right now...

Re: 2 RAs in tandem + H2O Automation

Posted: Sun Mar 23, 2014 2:29 pm
by lnevo
Can the salinity module be plugged in to the relay box or does it need to be isolated?

Re: 2 RAs in tandem + H2O Automation

Posted: Sun Mar 23, 2014 3:12 pm
by rimai
Yes it can

Re: 2 RAs in tandem + H2O Automation

Posted: Wed Mar 26, 2014 8:33 pm
by lnevo
Ok temp probe received today. Will be mixing up some salt with my RA soon :)

I have my float switches ready to go. I need to setup the pump for the RO and install the float switches. Oh and need to setup the wifi so I can monitor the change in salinity.

Once I can monitor the salinity over time I'll be able to see how quickly the salinity changes when i add salt manually and when i add water manually. This way I can figure out what the routine will look like.

I'll use 1/2 the usual salt I use to mix up 1/2 my container of SW to 35ppt. Then I'll add 1/2 of the salt remaining and monitor the salinity. I'll then add RO in increments and watch the change in salinity until I'm back to 35ppt. That should get my barrel to 3/4 full. If the high level float switch gets triggered before we get to 35ppt, i will obviously stop adding RO and send an alert. At that point, I would just need to drain some water out so it can finish up or figure out what went wrong...

I'll fine-tune the fill amounts and timing based on how quickly the salinity reacts. Add a specified amount of real mixing time and signal the AWC to resume. Then the routine will just be to add a few cups of salt every week.

BTW, this process will only happen if I trigger WC mode :) This way the salinity isn't being constantly adjusted all week long.

Sorry if I've described the process multiple times already, but talking it out in my head is helping the overall thought process.

Re: 2 RAs in tandem + H2O Automation

Posted: Tue Apr 08, 2014 5:45 am
by lnevo
So I think I finally finished the first set of code and getting ready to load it up this weekend. In order to do what I want I've created a TimedPort class.

This is a wrapper for a relay port. You can do all the things you can do with a normal relay, but you can do a few extra things to it. You can set it up like a dosing pump by setting the Time, Offset, Repeat and then use the Run() function. What this adds over a normal DosingPumpRepeat function is built in state tracking, Pause() Resume() Start() Stop()

It has an Osc function that is similar to the APEX OSC call so if you just want a port that is on for 20 minutes and off for an hour and 40 you can do that too.

For me what I wanted was the ability to have the running schedule but be able to trigger a run or a stop when I want. I didn't want to have to do the timer in my loop or separate function every time. For instance, every time I come home and turn my fuge light on to take a look at my tank, i end up leaving the override on and then realize the next day my fuge light has been on for 24 hours...so now I can change my fuge light on to a Start(3600) and the override will be timed for one hour. Another example is my skimmer. I dose reefbooster and it needs the skimmer off for like 12 hours...i mask it off, but then I gotta remember to turn it back on. With this i can issue a call to Stop(12*SECS_PER_HOUR); and the Skimmer will now be off for that much time.

Anyway, it may sound complex but its quite easy, once I can post it, I'll write up some documentation. I haven't even tested the compile yet :)

I will also be adding a Scale function so you can specify the times in seconds, minutes, hours, or days.

The next class will be the dosing pump one. This will add calibration values, logging, and maybe millisecond scaling...have to do some more research on that one before I commit to that.

Anyway, when I'm ready to post it, I'll put up a few more use cases. If you want to help test or develop this, let me know and I'll be happy to give you an early version :)

Re: 2 RAs in tandem + H2O Automation

Posted: Tue Apr 08, 2014 6:02 am
by Sacohen
Awesome.

This sounds like it might be what I want to disable the Auto-Feeder if I do a manual feed, like I was asking about over the weekend and you said to just override it.

I was afraid if I override it I would forget to remove the override and the fish would not get feed for a couple of days.

Re: 2 RAs in tandem + H2O Automation

Posted: Tue Apr 08, 2014 6:50 am
by lnevo
You need to disable the StartFeedMode() though...not the Feeder, but yes it can be used to Stop() the feeder for X amount of time :)

Re: 2 RAs in tandem + H2O Automation

Posted: Tue Apr 08, 2014 6:58 am
by Sacohen
Cool I'll look into it when you have more info up about it.
It's nothing earth shattering right now.
I can do an override if I do a manual feed.

Re: 2 RAs in tandem + H2O Automation

Posted: Fri Apr 18, 2014 10:21 am
by lnevo
The code for my mixing station is pretty complete at this point. Want to do some cleanup and commenting so it's clearer to read. Right now it's a bit on the convoluted side. I also want to clean up the use-case for the TimedPort class so I can use as an example in the documentation.

In any event, the cool part is that salt mixing is now fully automated. As my salt water bin gets low, I put the RA into waterchange mode which kicks off the mixing pump for 12 hours. Normally it's running every for an hour every other hour. Then I turn on an unused port which then starts adding water slowly (3 seconds on / 30 seconds off) until the "average" salinity drops below 35ppt. I've only tested so far with adding 5 gallons of water to the barrel, but after I do my water change this weekend, I'll try from a full bin of fresh water. By the way, if the barrel has been emptied below the low ato switch, then it will first pump in X amount of water. I've set this for 30 seconds but I have to see how much water that actually is :) Either way, I'll get some testing in this weekend.

Hopefully I can start doing some calibration testing soon on the auto water change pump so I can move forward on that piece.

Also, I haven't added this to the libraries yet, but I registered an issue so I can make a pull request. I added a function Auto to ReefAngel.Relay which will remove the masks from a port. We already had this with Override, but I think it reads cleaner without using Override. So soon we'll have On(), Off(), and Auto().

Re: 2 RAs in tandem + H2O Automation

Posted: Sat Mar 14, 2015 8:55 pm
by ewaldsreef
I am getting in on this conversation late but going back to the first part. Why not run the whole thing off of one RA? Would the r e be enough memory in one controller to do all of it?

Re: 2 RAs in tandem + H2O Automation

Posted: Sun Mar 15, 2015 8:13 am
by lnevo
This was before RANet existed. It still may be too much distance. The mixing station is in the basement on opposite end of the house.

Re: 2 RAs in tandem + H2O Automation

Posted: Mon Mar 16, 2015 8:44 am
by ewaldsreef
If this wasnt an issue then would using on controller have enough memory? Is there anyway to boost the signal on RANet?

Re: 2 RAs in tandem + H2O Automation

Posted: Mon Mar 16, 2015 10:49 am
by lnevo
Yeah, plenty of memory. That's not the issue, just the distance.

Re: 2 RAs in tandem + H2O Automation

Posted: Tue Mar 17, 2015 2:04 pm
by cosmith71
You can replace the XBee's with the pro models (series 1) and get more distance. They have to be reprogrammed, but it works.

--Colin