Page 1 of 1
Add a Push Button
Posted: Fri Feb 08, 2013 10:04 pm
by JoelIreland
Hi everyone, new to The ReefAngel setup, it arrived on Thursday thanks to help from Roberto ( great guy )
I have the wireless setup, various alarms for things like high and low water, power failure + it shuts off additional ports on power failure, ATO monitor etc.
I would like to add a push button to toggle feeding / water change mode so when i push the button it shuts off port#...
Anyone have any ideas?
I am using both High & Low ATOs
Re: Add a Push Button
Posted: Fri Feb 08, 2013 11:07 pm
by 00Warpig00
If you dont want to do this with the joystick on the controller off of the menu you can do this with an IO module.
Hook up switch(es) to IO module
feeding to port 0 on IO module water change switch to port 1
put code into your loop looking for either switch to be "active" (pressed). Only drawback I can think of is depending on how your controller is coded you *may* have to hold the switch in for a second or two before it registers. (all depends on your code)
If switch 0 is active
do stuff (go into feeding mode)
If switch 1 is active
do other stuff (go into water change mode)
else
do everything else
I cant remember if it's in the default menu's or advanced\custom menu's (I have a completely custom menu)
but this is doable using the joystick and menu coding in the reef angel without an IO module if you don't have an issue with clicking the joystick, choosing your option, and clicking it again... essentially using your joystick as a multi pushbutton.
Nick
Re: Add a Push Button
Posted: Fri Feb 08, 2013 11:42 pm
by JoelIreland
Thanks, my main reason is i want to push it without having to go into tank and reaching the Controller which will be near the back. This way there is a button ( or 2) and also some status LEDs green orange and red that notify me of specific errors
green: all good
red flashing once a second: low sump
red 3 seconds: high sump level
red 5 sec: ato needs fill up
red constant is for more urgent things ( buzzer ) such as power issues, temperature issues etc.
orange is for more things that will need attention.
all of this will be seen without having to go into cabinet.
Ill have to get an I/O has i haven got one (the one thing i forgot to get sent to Aus.
Re: Add a Push Button
Posted: Sat Feb 09, 2013 3:28 pm
by 00Warpig00
If your RA has the wifi module or an ehternet solution and you have an android you can also launch both waterchange and feeding modes from the android device using Curt's RA Android app. If you are mounting the RA where it will be tough to get at the IO module/switch idea sounds decent. I follow you on your LED idea. I like it. Not sure the best method to implement that as it sounds like you want multicolored LED's and you would need to drive each LED from a separate output on the controller. Driving the LED's could probably be done from an analog Dimming module without too much trouble. I have a buzzer on my system currently to give me both a non critical warning (short low/medium volume beep once every couple of minutes) to warn me to turn off my RO feed and that my ATO/Saltwater Brute cans are empty. I also have a Critical alarm (Loud beep every couple of seconds) to inform me of things like my sump being empty or full etc. It works out nicely when my sump empty float switch doesn't get stuck in the active position and freak me out with false critical alarms.
Nick
Re: Add a Push Button
Posted: Sat Feb 09, 2013 8:34 pm
by JoelIreland
Thanks nick.
I currently just have the Red LED for various statuses. I don't know much about c++ but as I'm a web developer I'm picking it up quick. I was going to post separate topic but you might be able to help. What is the difference between mask on and on with a relay? I'm also looking at developing a website that will display and control RA unit from any pc tablet or mobile with various styling options. This will do away with need for multiple OS apps.
Re: Add a Push Button
Posted: Sun Feb 10, 2013 12:39 am
by 00Warpig00
Your plans for your website sound pretty cool. I'm a computer nerd too but I am more into IT hardware than software, building servers\server racks\data racks migrating LAN's into corporate WAN's etc. so my c++ skills suffer too. The closest I get to writing actual programs outside my RA is VBS scripting for my servers etc. and most of that I cut\paste\modify. I'm not really one to invent my own code for too much

I really don't know too much about ANY programming language, particularly c++ but I can generally recognize what a line of code does and copy/paste with the best of them I guess lol.
As for the LED's there are probably different ways to do it. My first though as I mentioned was an analog dimming module because you can tell it to turn an output on to a set voltage ranging from 1-10V and each port should have no trouble supplying the current needed to drive regular/medium brightness LED's directly. Turn the ports on/off in a pattern to blink your status codes and even drive a multi colored LED using multiple channels and switching them on/off to create the desired colors all sounds easily workable with the dimming module. I suppose if you really wanted to get fancy you could even use the I2C bus and send data to an arduino board and use the arduino for remote status display of some sort. The possibilities are limited mostly only by imagination which is the strong suit of Reef Angel and arduino.
As for "masking" with the RA. Think of it like this. If your RA code runs a certain program and in that program relay #1 for example is normally on (like a skimmer AC outlet in my case) and you were to "mask" that relay you are telling it "I don't care what state the normal code says the relay should be in right now I want it ON/OFF until I remove the mask" It's an override. Override the normal behavior of the running program until the mask is removed. When you mask "ON" you are saying I don't care what state the program says the relay should be in right now... turn it ON and with a mask OFF you are saying I don't care what state the program says the relay should be in, turn it OFF. For example. My skimmer is normally always on. I have a mask set in my code that states that if my ATO fails and times out I should assume there is a bit too much water in my sump and the water level has risen and to purposely shut off my skimmer to prevent my skimmer from overflowing. When I see the skimmer is masked off and my sump has a higher water level I can leave my skimmer masked off until I feel the water level has decreased enough to prevent overflow, then I will manually remove the mask with my android app and the skimmer will automatically turn back on because my running code says thats how it should be if it is not masked.
Nick
Re: Add a Push Button
Posted: Sun Feb 10, 2013 1:00 am
by JoelIreland
Great mate thats perfect.
Yeah i actually run an IT Company
http://theitpros.com.au
So i'm in the same boat, we just have a web design side to the company too.
Ill keep you posted. Just trying to figure out the 8bit XML info, never dealt with that before. Apparently 9 = relay 1 & 4 just not sure how

Roberto been very helpful.