Monitoring reef tanks with SMS alerts with Arduino, for under $100

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
This is an open source project I'm working on for a while, it's available here : https://github.com/reivaxy/aquaMonitor

I still have to write a "How-To" and some documentation for this project, but if you are interested don't hesitate to drop me a line :)

Its goal is to monitor a reef tank to check if the light level, temperature and water level are ok.
If they are not, it sends SMS alerts to registered mobile phones.

A lot of parameters are configurable by sending clear text SMS to the device, and you can also register or unregister more phone numbers to get the alerts.

I hope to avoid the lost of fishes, shrimps, and many corals I suffered one year ago when the power went out in my apartment while I was away. If I had been warned, I could have sent someone fix that.

Although I have already built two of these devices which are running right now monitoring two different tanks, it's still a work in progress with more ideas waiting to be implemented.
The main two are:
- check that the powerhead pumps are working. I need to design a sensor for that.
- wifi connection to share the GSM shield between several modules to lower costs and SIM card needs, and may be log measures to a webserver.

The cost is under $100, everything included. Of course you also need a SIM card, which in France is available for 2€/month with unlimited SMS plan, I don't know plans available otherwhere.
You don't need to have a 3D printer, you can obviously buy and use any case big enough, and set the sensor your own way.

The early prototype:
aquaMonitor-1024.jpg


The device in its open case:
20160702_134904-1024.jpg


The device in action:
installed.jpg


And another one:
20160901_210044-1024.jpg


Examples of SMS discussion with the device (Messages I sent are yellow, answers are blue):

smssmall.png
 
Last edited:

Rob Lion

Active Member
View Badges
Joined
Apr 8, 2016
Messages
305
Reaction score
539
Location
UK
Rating - 0%
0   0   0
that's great!!! if only there was a Raspberry Pi version ..... ;)
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Thanks :)

Well, when I started the project, the target was an Arduino UNO, that cost under $2...
But due to poor memory on the UNO, it needs a Mega that costs about $7.
A Raspberry would be a little overkill and more expensive ;)
 

Rob Lion

Active Member
View Badges
Joined
Apr 8, 2016
Messages
305
Reaction score
539
Location
UK
Rating - 0%
0   0   0
yes, but with a Pi..... then we can add on many more features, from other developers/ourselves to create a full aquarium monitoring/control system :)
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
And who says you can't do that with the Mega ? Many IO still available.
I'm working on adding a wifi component so that several modules can communicate and share one GSM card.

Many developers work on Arduino and are welcome to help :)
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Hey, if you want to be involved, why not develop a Raspberry PI version ?
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Awesome ! I hope you'll open source it !
 

Rob Lion

Active Member
View Badges
Joined
Apr 8, 2016
Messages
305
Reaction score
539
Location
UK
Rating - 0%
0   0   0
yes ofcourse, i'll probably start by back engineering my Jeboa DP4 dosing pump so that I can have full control from the Pi instead.
 

clownfish chris

Active Member
View Badges
Joined
Dec 25, 2015
Messages
284
Reaction score
254
Rating - 0%
0   0   0
I have been tinkering with Arduino for a few months now. I have a set of dosing pumps and now am waiting on a temp sensor to build a temperature controller. I am going to use a mini fridge as a chiller. After a while, I will combine that, led lighting, and everything else into one controller/power center with its own 20 amp circuit. I will open source it for sure!

Step aside Apex.
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
I have been tinkering with Arduino for a few months now. I have a set of dosing pumps and now am waiting on a temp sensor to build a temperature controller. I am going to use a mini fridge as a chiller. After a while, I will combine that, led lighting, and everything else into one controller/power center with its own 20 amp circuit. I will open source it for sure!

Step aside Apex.

Cool project !
What temperature sensor did you order ?
I'm using a DS18B20, which is rather nice, except it comes in a waterproof casing which is not saltwater proof.
For now, I've insulated with some "home made" ABS coating, but I'll eventually switch to epoxy resin.

With your feature packed module, you may need a rather elaborate control interface? Yesterday I got an ESP8266 (less than $3) module working: it looks very promising, I recommend it if you need a web interface for your project.
 

clownfish chris

Active Member
View Badges
Joined
Dec 25, 2015
Messages
284
Reaction score
254
Rating - 0%
0   0   0
I ordered the ds18b20. I will use epoxy to waterproof it. I will put it through a month of monitoring and recording before I trust it to controll a heater.

I'm sure it will eventually use a web interface as well as a Bluetooth.

For now, I'm having trouble with the lcd screen so it will be a while.

Thanks for the recommendation!
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Is it the same kind you can see on my picture ? Let me know in case I can help.
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Oh, and how will you handle the date and time ? Do you plan to add an RTC circuit ?
It's what I've done, and although the prototype was working very fine, when I built my second device, two of the RTC I had were freezing as soon as I inserted their button battery.
I looked this issue up and found other people with the same issue :
http://forum.arduino.cc/index.php?topic=411697
So watch out which kind of RTC your are using. Mine is crappy. But I don't really care and removed the battery, since the whole arduino had its own battery. Still, I don't like it when all does not come together ;)
 

clownfish chris

Active Member
View Badges
Joined
Dec 25, 2015
Messages
284
Reaction score
254
Rating - 0%
0   0   0
It is the same lcd but I have the 4pin backpack on it.

For the RTC, I have a ds3231 on my dosing pumps. I have had no trouble at all with it.
 
OP
OP
Reivax

Reivax

Community Member
View Badges
Joined
Sep 3, 2016
Messages
29
Reaction score
18
Rating - 0%
0   0   0
Hi again !

It's been a few months, and the two devices are still monitoring two reef tanks successfully !
Two weeks ago, mine alerted me of low water level: my purified water (to compensate for evaporation) tank was empty.
From times to times I get level alerts because an urchin is wandering on the sensor, though... But that's kind of cute.

However, one day one of them suddenly stopped responding to sms (either status request or settings).
I found out it had received a commercial (spam, that is) SMS, which it did not understand, a situation in which I programmed it to respond with an sms saying "What ??" so that I knew I sent it a bad message...
The commercial spammer had a similar function. Receiving "what ??" it answered it did not understand...
It took me about 20 days to discover this, since I don't send requests every day. In that time, more than 1300 messages were sent back and forth. Good thing the sim I use is on unlimited plan!
Another issue was that an SMS could not be removed from the incoming queue if each one of its characters had not been read. The spam message was rather longish, whereas the requests messages were short, so I didn't bother reading more than say 30 characters. As a result, spam incoming message was not deleted, but read again and again. So even if the spammer had not been replying, I would have had the outbound sms traffic...
So be careful when you play with GSM boards :)

Anyway, since then, I've built the prototype with the Wifi connection.
It can automatically (and optionally) connect to a home wifi access point that allows it to periodically send statistics (light, temperature...) to an external server I created (on a cheap hosting, a few € each year) that collects data and provides graphs.
The server hosts a database whose structure is intended to store data for many different users and tanks.
There is no authentication yet, it's a very early prototype:

chartsmall.png

(do not worry, these graphs show data from the prototype board, not from tank measures :) )


It also creates a local wifi network on which it exposes a webApp to access all settings, expose alerts... etc.
The webApp is already designed to handle several tanks and will display each one of them (and can also be reached through the device's IP on the home network)
The 'pen' icons allow to edit each setting:

webAppsmall.png


All the code for the statistics server, DB and webApp was added to the open source repository.

In case you wonder why keep the SMS module to access data and settings since all is available from a webApp, here are the main two reasons:
- The device needs to be able to send alerts in case of power outage. It has a backup 9V battery for that. A home wifi network from an adsl (or cable) box would not be available in case of main power outage.
- You may not want to expose the webApp to the outside of your home network. Reducing exposition is a security principle.

One more reason is that exchanging SMS would be a pretty secure way of setting parameters to connect to local home wifi networks (ssid and password) rather than hard coding them within the software.
The local wifi network is created with default ssid and password so that all slaves can connect to it, and if these settings are changed the master notifies the slaves before applying them (That remains to be done)

What should come next :

The local wifi network will be the one on which more modules will be able to connect, in order to use the gsm board of the 'master' module. This allows to reduce module costs to monitor many tanks (a friend of mine now has 8 tanks).
The master module will periodically collect data from all slave modules, send alert SMS if any, expose them in the webApp (along with each module settings), and send them to the statistic web server.
It will also dispatch received SMS and webApp setting changes to the targeted slave.

For now, there is no authentication between the master module and the statistic website which makes it pretty fragile since anyone can inject any data, which is an issue that needs to be addressed.

Although the webApp is served from the arduino wifi module, most files composing it are hosted on the statistic server (can actually be from any other web server), since this allows to not need to flash again the wifi module each time you make a change to the webApp, and allows using images much much easier, with no size limit, etc. The only part flashed in the wifi module is a loader for the webApp.
It also greatly improves loading times, since the wifi module bandwidth it limited.
(and I'm pretty proud of this solution haha)
So there should be some kind of versioning handling, in order to handle several modules with different software versions, that would need to show the webApp appropriate to their version.

The circuit board needs to be redesigned to host the small wifi module, allowing it to have firmware upgrades, and may be a different RTC since the current one is rather buggy as described before.
The electrical schematic needs to be updated to show the wifi module connections.
The 3D printed case might need to be adjusted (or not). I have started redesigning it using openSCAD (It's almost done, but not tested yet. The sensor bracket openSCAD file is already available)
I haven't progressed at all on a water flow sensor design.

So, there is still a lot of work !

I haven't touched the project for a while per lack of time, but just writing about it makes me want to resume working on it!

Of course anyone is welcome to join, for ideas or actual programming or designing! Let me know
 
Last edited:

Making themselves at home: Have you intentionally done anything in your aquarium to enhance the natural behavior of your fish?

  • I planned my tank to encourage natural fish behavior.

    Votes: 26 28.0%
  • I did some things to encourage natural fish behavior.

    Votes: 31 33.3%
  • Anything that encourages natural fish behavior was a byproduct of the aquascaping.

    Votes: 16 17.2%
  • I did not do anything to encourage natural fish behavior.

    Votes: 17 18.3%
  • Other.

    Votes: 3 3.2%
Back
Top