Asked — Edited

Meet The Smart Saltwater Aquarium Powered By Ez Robot

Ez Robot community I wanted to introduce my latest application of this system. Some members hear already know I keep two salt water aquariums one coral which unfortunately died off and my predator tank. Sea life needs delicate balance maintained in their little ecosystem. Things like light spectrum , temperature, ph balance , current of water , nitrate and ammonia levels and calcium levels. These things take a practiced hand to maintain. I am building a new system and using ez b to monitor salinity, nitrates and ammonia, temp , water current flow and the ph. The ADC ports are useful for these and EZ board can control the current and switching to a backup power supply ( a apc for computers inside the cabinet to keep ezb and pumps powered). Also the ezb can turn on and off night , morning , day , and evening lighting settings. With a custom injection device im designing ezb can provide nutrients , calcium and even medicine if levels are out of wack. I started the build today and I am very excited!

User-inserted image


ARC Pro

Upgrade to ARC Pro

ARC Pro is your passport to a world of endless possibilities in robot programming, waiting for you to explore.

#226  

For reference D1 is actinic , D2 is Daylight 10000k and D3 is Cheato night light.

Note : Also as an update to the 1st ezb not connecting that I swapped in the video, I used a small screw driver to peel off the tape. , removed tape and pressed Bluetooth module down into the socket and this fixed both ezb with Bluetooth red light not activating. The two affected units were solarbotics pcb early models so maybe they just used double sided tape that was too thick and it was not connecting well to the main board.

Author Avatar
United Kingdom
#227  

The only problem I can see with the script is, what happens if you start it at 09:00? It'll wait until 08:00 to move to line 2, so 23 hours.

There is a global variable $time, I would look at using that and some IFs and ELSEIFs

I'd also use :labels for say :0800 SET(D1, On) SET(D3, On) Return()

:1000 SET (D2, On) Return()

etc.. and call those up with GOTOs, but it's not necessary.

Author Avatar
United Kingdom
#228  

Thanks to the bunch of newly added snippets in the scripts section there may be a lot of hints there for that script, if waiting until 0800 causes problems (it may not).


:begin
# Actinic
IF ($hour >= 8 and $hour < 20)
  SET(D1, On)
ELSEIF ($hour < 8 or $hour >= 20)
  SET(D1, Off)
ENDIF

# Daylight
IF ($hour >= 10 and $hour < 18)
  SET(D2, On)
ELSEIF ($hour < 10 or $hour >= 18)
  SET(D2, Off)
ENDIF

# Cheato
IF ($hour >= 20 or $hour < 8)
  SET(D3, On)
ELSEIF ($hour < 20 and $hour >= 8)
  SET(D3, Off)
ENDIF

GOTO(begin)

Note that where Cheato is on overnight and passes over from 24 to 0 the AND and OR are around the other way to Daylight and Antinic which don't.

This will just loop over and over again, you could add a SLEEP() in there if it uses too much resources on a constant loop, there is no need to check constantly, waiting for a minute or two, or even more wouldn't be the end of the world.

I've not tested it, I didn't even write it with ARC in front of me so check it. You can easily test it by replacing $hour with $test, running the script and then open the script console, enter

$test = 1

See what happens, do the same again and change $test to 2, 3, 4 etc.

Author Avatar
United Kingdom
#229  

Slightly altered script which allows easier alteration of the times.

I've assumed Antinic is the daytime light (8am until 8pm) and Cheato is the night time light (8pm until 8am).


# Set up Daytime, Night time and Daylight hours
$DaytimeHour = 8
$NighttimeHour = 20
$DaylightOnHour = 10
$DaylightOffHour = 18

#Start the loop
:begin
# Actinic and Cheato
IF ($hour >= $DaytimeHour and $hour < $NighttimeHour)
  # Turn on the Antinic and turn off the Cheato
  SET(D1, On)
  SET(D3, Off)
ELSEIF ($hour < $DaytimeHour or $hour >= $NighttimeHour)
  # Turn off the Antinic and turn on the Cheato
  SET(D1, Off)
  SET(D3, On)
ENDIF

# Daylight
IF ($hour >= $DaylightOnHour and $hour < $DaylightOffHour)
  # Turn on the Daylight
  SET(D2, On)
ELSEIF ($hour < $DaylightOnHour or $hour >= $DaylightOffHour)
  # Turn off the Daylight
  SET(D2, Off)
ENDIF

#Wait 1 minute to reduce load on CPU
SLEEP(60000)

#Return to the start of the loop
GOTO(begin)
#230  

Might need to make a script for daylight saving times right now it gets dark about 5pm to 6pm

Author Avatar
United Kingdom
#231  

Fetch the sunrise sunset times from the internet and have it totally automatic...

#232  

Lol I arrange the tanks "day" around my work schedule. I have a third light im adding in maybe tonight , it has a purple/uv color to it and I believe it would be ideal for dusk and dawn.