[WIP] Automated Aquarium - Raspberry Pi (Web, Live Data, Data Log) - The Planted Tank Forum
 2Likes
  • 4 Post By N-Gen
 
LinkBack Thread Tools Display Modes
post #1 of 11 (permalink) Old 07-04-2016, 03:19 PM Thread Starter
Algae Grower
 
N-Gen's Avatar
 
PTrader: (0/0%)
Join Date: Jul 2016
Location: Malta, Europe
Posts: 20
[WIP] Automated Aquarium - Raspberry Pi (Web, Live Data, Data Log)

Hello everyone, first post and I figured I could start with some yummy stuff. This will be a long post and I do love to write in detail so buckle up.

First a little bit of background info, I'm a 25 year old software developer from a tiny island in the Mediterranean Sea called Malta. I've been fishkeeping since 2010 and while my planted tanks were nothing special I always enjoyed them. I currently have 5 tanks, a 180L community tank, a 40L shrimp tank, a 40L guppy tank, an 80L tank housing a Mississippi Map turtle and an ~80L tank which is the one this project is based on.

So let's get to it. The idea is to have a way to monitor and have historic data about the tank parameters while also having automation with the possibility of manually changing parameters.

Please note that this project is currently in progress and things might change every now and then. Some data/information might also be incomplete or missing for the time being. The code will be released once I'm happy with it and you will be able to do whatever you like with it although this project might take some time to be fully completed because of other priorities I have at the moment.

This tank will be housing plants (of course) and a variety of shrimp which will be rehomed into it from the 40L.

An obligatory picture of the initial stages follows (a bit messy for now):



The tank has a custom built hood made out of 6mm marine plywood (3 sheets for the base, 18mm) which wasn't as easy to plan since the tank footprint isn't so big. However, there should be enough space to house all the components required even the reservoirs and power supplies while having an empty space for the external filter pipes to pass through. At the bottom there is a perspex tray which can be pulled out from the side in order to expose the LED mountings should maintenance be required. The are 2 intake slots for 80mm fans, 1 exhaust slot for an 80mm fan as well as a slot on the bottom for a 120mm fan to be mounted to push air into the light section as well as to the water via holes in the perspex sheet.

While displaying real time data is cool and does not require space it's quite easy to do. However, this prevents us from having any historic data about the tank which to me is quite a big deal. In IT terms, what's going to be used to store data is a denormalized table within SQL. For the non-tech savvy people, this means all data for a specific point in time is represented in 1 single row. This way it's easier and faster to retrieve historic data since everything is in order by time right as the data is requested.

I'm currently not decided on what interval the data would be recorded at. I could be quite accurate or less accurate but size-wise a data snapshot every 30 seconds or 1 minute seems adequate and accurate enough since the parameters being measured do not shift rapidly.

Current tasks:
  • Coding scripts for all sensors and components
  • Calculating light requirements
  • Enabling data logging on all components
  • Lay wiring within the hood and connect all devices

Planned features:
  • Water level checking
  • Water refilling from reservoir in hood
  • Heater monitoring
  • Temperature monitoring at surface and bottom
  • Temperature and humidity monitoring inside the hood and ambient
  • Fertilizer dosing
  • Filter inlet and outlet flow checking
  • Resrvoir and fertilizer level checking
  • Light monitoring within the tank and ambient
  • Sunset/Sunrise and cloud simulation using white and RGB LEDs
  • Automated fan control based on temperatures
  • Automated CO2 injection
  • Data logging
  • Web interface with graphical interface for live data
  • Historic data via web interface using graphs and other visual tools

What is being used so far in the computational side of things:
  • Raspberry Pi 3 + 8GB micro SD card running Raspbian Jessie
  • MySQL Database (for data logging and parameters)
  • Node.js (for all scripts)
  • pi-gpio (for Node.js to interface with Raspberry Pi pins)
  • sockets.io (for live data display)
  • lightppd (for web hosting)
  • Custom written scripts (for all the code I write)

Sensors:
  • DS18B20 temperature sensors
  • DHT11 temperature & humidity sensors
  • Water flow sensors
  • Water level floats
  • Water level sensors
  • Light sensors
  • More to be added

Other hardware:
  • WS2812 LED Modules
  • 5630 SMD Strips
  • 12V Relays
  • A lot of wiring
  • More to be added
  • A number of mini pumps

Please remember that this is a work in progress. I'm open to suggestions so please let me know what you think I might be missing or doing wrong, I'd be happy to hear your feedback. I believe strongly that we can all learn from one another so if you need further information or clarification let me know. And please, by all means, teach me as well!
N-Gen is offline  
Sponsored Links
Advertisement
 
post #2 of 11 (permalink) Old 07-04-2016, 09:49 PM
Planted Tank Enthusiast
 
BDoss1985's Avatar
 
PTrader: (8/100%)
Join Date: Sep 2011
Location: Bossier City, LA
Posts: 752
I'm about to put my iaqua arduino together soon, i would be interested seeing data collection, being as my main goal of mine is the overhead sump housing my emersed crypt collection.

Sent from my SM-N910V using Tapatalk

Brian D


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
BDoss1985 is offline  
post #3 of 11 (permalink) Old 07-04-2016, 10:06 PM Thread Starter
Algae Grower
 
N-Gen's Avatar
 
PTrader: (0/0%)
Join Date: Jul 2016
Location: Malta, Europe
Posts: 20
Quote:
Originally Posted by BDoss1985 View Post
I'm about to put my iaqua arduino together soon, i would be interested seeing data collection, being as my main goal of mine is the overhead sump housing my emersed crypt collection.
You have a number of options when using an Arduino, most of them involve another device. I'll go through them in short form to give you an idea.

  1. Store data directly to SD card in a file
  2. Run a Raspberry Pi with a database
  3. Run a file server or PC with a database
  4. Send data to the web

Using the first option you're restricted with what you can do. Storing data in just a file is not the ideal way to store data especially if you'll be storing a chunky amount of information. If however you're logging information say, once every 6 or so hours probably even every 1 hour I think it would work.

The second and third option work the same only with hardware differences. If you already have a PC that runs 24/7, you could host a database and simply interface directly. If you don't and want something that's low cost, low maintenance and very low power, you'd just set up a Raspberry Pi.

The fourth option depends on what services you can find. If you already pay for web hosting you should have a number of databases available to you which you could use or maybe there are some services that offer free low size databases for these kinds of projects.

Personally I like the Raspberry Pi approach because even if the network goes offline the data is still store. The only eventuality where data is lost is during a power cut or device failure. Using a database is also a faster way to query and visualize your data if that's what you're planning.

I've seen the iAqua project on a high level but if you can manage to get iAqua working you should have virtually 0 problems in settings up a data logging solution.

Hope this helped
N-Gen is offline  
 
post #4 of 11 (permalink) Old 07-04-2016, 10:10 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Installing software on the PI is such a pain. It took me half a day to install just mysql. good luck on the project.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
post #5 of 11 (permalink) Old 07-04-2016, 10:17 PM Thread Starter
Algae Grower
 
N-Gen's Avatar
 
PTrader: (0/0%)
Join Date: Jul 2016
Location: Malta, Europe
Posts: 20
Quote:
Originally Posted by mistergreen View Post
Installing software on the PI is such a pain. It took me half a day to install just mysql. good luck on the project.

Thank you.


Sadly, I can't actually argue with this statement, haha. MySQL is one option, to me it's the one that makes most sense. However simpler options exist and I would recommend them to anyone wanting to keep it simple, use SQLite3 although I wouldn't recommend it for anything faster than 1 save per second in this case but I doubt anyone would be saving at that rate when it comes to tanks.

Unfortunately I met my first MySQL database hiccup last night on this project when for some reason it decided to corrupt itself greatly. Took me about 5 hours until I gave up on it and had to re-install MySQL. Luckily I was able to back up the structure before I deleted the whole thing.

Last edited by N-Gen; 07-04-2016 at 10:17 PM. Reason: Spelling
N-Gen is offline  
post #6 of 11 (permalink) Old 08-21-2016, 12:58 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Aug 2016
Location: DFW, Texas, USA
Posts: 12
How's the project going? I'm interested to see how it's all coming together.
prahsms is offline  
post #7 of 11 (permalink) Old 08-22-2016, 04:19 PM
Planted Tank Guru
 
scapegoat's Avatar
 
PTrader: (16/100%)
Join Date: Jun 2010
Location: philadelphia, pa
Posts: 2,454
Hey N-Gen,

I went the Pi route as well. I've been running my controller for nearly two years now with zero updates to it. It's not quite as fancy as what you're planning.

currently speaking, it doses liquid ferts, and has 6 outlets that I can both toggle manually as well as schedule.

Personally, I'd dump MySQL and write historical data to an xml doc perhaps. I'm not keeping any historical data, because none of my sensors have been hooked up. I am, however, using a nosql db (NeDB in my case) to keep the tasks in, as it was super stupid easy to utilize. I don't think a relational database is appropriate for an aquarium controller. An XML doc could probably be used for everything, with a separate doc for each sensor to save historical information to.

I'm using node.js along with angular 1.* for the front end. I can visit my controller via raspberrypi:8000 on my home network. I also set up sockets so that any device looking at the controller would have the same state... not that anyone but me uses it, but it was a cool little addition.

I've been thinking of revisiting my controller, and writing it from scratch using node, and maybe React, just because.

I'm excited to see another Pi based controller on here!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
scapegoat is offline  
post #8 of 11 (permalink) Old 09-25-2016, 10:02 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: May 2013
Location: Ca
Posts: 7
How is it going so far?

I tried doing something similar on raspberry pi 3, couldn't figure out how to pass mysql install error-

Here is the website which may be useful - jayfish/

If you make it work, Please make a tutorial on it for total beginners with no programing skills!
viick is offline  
post #9 of 11 (permalink) Old 01-14-2017, 04:13 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Dec 2016
Posts: 26
This sounds like such a cool idea


Sent from my iPad using Tapatalk
Tankinho is offline  
post #10 of 11 (permalink) Old 01-14-2017, 04:33 PM
Planted Tank Guru
 
Axelrodi202's Avatar
 
PTrader: (37/100%)
Join Date: Jul 2008
Location: Morris County, NJ
Posts: 3,329
Very neat project; keep us posted. For me the one thing that holds me back from full automation is the need to vacuum out detritus/sludge during water changes.

O_o
/ /_______________________________
| BWAAAH IMA FIRIHN MA LAZER!!!!!!!!!
\_\
Axelrodi202 is offline  
post #11 of 11 (permalink) Old 01-15-2017, 12:54 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Quote:
Originally Posted by Axelrodi202 View Post
Very neat project; keep us posted. For me the one thing that holds me back from full automation is the need to vacuum out detritus/sludge during water changes.
Underwater Roomba.


Sent from my iPad using Tapatalk HD


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mistergreen is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome