Automated aquarium monitor with Web GUI. daisychain units can control multiple tank all from the one master unit. PI/Arduino/ESP Powered

Similar projects worth following
This Project is to document the progress of a joint project between myself and my good buddy Liam O'Reilly.
The aim is to create an automated aquarium monitor to control and maintain several tanks, and provide feedback and manual control to the user via an easy to use interface.
The project started as a College project, but we are extremely interested in taking our rough-and-ready Proof of Concept and creating a professional looking unit suitable for industrial or commercial use.

The initial plan was something like this:

The aim was to use a Raspberry Pi as a Webserving i2c master. This would provide a user interface accessible over the network on any device, and also the ability to relay commands to multiple i2c devices.

These slave devices contain Arduino Nanos operating as i2c slaves, with multiple relays (for controlling a tank's lights, heaters, pumps etc) and also pH and Temperature sensors for monitoring the tank's current state.

All data collected by the Slaves would be returned to the master when requested for display on the web GUI when the page is requested. For example if the user were to access page /23 on the web interface the device would make a request to the slave configured for Tank 23.

In theory I would like the master to be able to provide a set of parameters to the slave; things such as temperature and pH thresholds, to be saved to the Arduino's EEPROM. This would allow the arduino to constantly monitor the Tank's state and respond to some any anomolies:

  • Trigger the heater if the temperature drops below the provided threshold
  • Send warning messages back to the Pi if anything is amiss.

This would allow the user to preset configure each individual slave for the type of fish they are keeping in that tank. Ideal for a multi tank setup, or even a pet store.

----------CURRENT PLAN----------

While the plan has not changed, the way in which I hope to achieve the functions required has evolved following lots of trial and error and also following me picking up a great deal of practice using wifi communication.

As a result the following updates have been made to the project:

  • The arduino in the slave device has been changed to a Wemos D1. It retains the Uno footprint required for use with the enclosure we are using, but enables WiFi to be used as a comms protocol
  • i2c is no longer required for linking the Pi (the 'Hub') to the Slaves (the 'Control Units'); The Hub will use a USB Dongle in AP mode alongside it's onboard Wifi, and the ESP8266-powered Control Units will connect to this AP.
  • The Control Units no longer require the Hub to operate; the Units will now server their own simple web GUI to allow for standalone use (great for home use).
  • The Control Units will also host the data via a second web page in JSON. The Pi-powered hub will scrape this information using a Python script.
  • The Hub will relay all scraped information in a single web interface for ease of viewing,
  • The Hub will also pass data to an IoT site to allow for monitoring from anywhere.

View all 8 components

  • DFROBOT Wifi Bee ESP 1.0

    Craig Hissett08/05/2017 at 01:22 0 comments

    A month or two ago I was lucky enough to he selected to trial the titular wifi module by dfrobot:

    ESP WiFi Bee

    I applied for the review programme as I was looking for some simple methods of adding wifi to my arduino-based control unit. The module came a while ago, but I chose to order a Bee-compatible Arduino shield to make connecting the board to the Arduino easy. To test the module out I am going to add it to an Arduino Uno with a Nokia display shield to create a 'test control unit' to fire sample data to my Hub unit when demonstrating my multi-tank setup:

    Using the WiFi Bee is fantastically simple when using Bee-compatible boards; just plug it in. Although it has a lot of pins I was relieved to find it only uses a handful; 3.3v, ground, and two pins for serial.

    The shield I have bought in the above picture has two Bee ports; one for connecting to the hardware serial port on the Arduino, and one for connecting to a software serial port.

    I have opted to use a software serial port for it, leaving the hardware serial port clear for uploading sketches without having to remove it.

    Next step I will tweak my code to work with the Uno (currently written for a Wemos D1) and report my findings here.

    If the code is easily tweaked I may opt to use my Arduino back in the control unit and use the Wifi Bee for wifi communication. The Arduino enclosure I am using (the ArduiBox by @Hartmut Wendt ) features a nice open prototyping area meaning i could easily solder the Bee in and use it along with my Relay shield.

    So far - loving it!

  • Software work continues

    Craig Hissett07/19/2017 at 22:29 0 comments

    I've been quiet for quite a while on here, but work is still underway.

    I have been focusing on writing and rewriting the sketches for the monitor units; at the moment the units work using a Wemos D1 to monitor sensors and relays, display the data on a simple Web page and also serve the data on  a json page.

    This means the monitors can operate standalone (for home use or for single tank operation) but can also operate as part of a network of monitors via the Pi-powered hub.

    I've written a nice little python function which is capable of scraping json data from the json pages. This means I can easily get hold of each monitor 's data for display on a single Web page, and can also be easily uploaded to anot iot site.

    I will aim to post more regularly!

  • Wemos <-> Uno Pins

    Craig Hissett06/15/2017 at 14:44 1 comment

    This is just a quick map to show how the pins differ on the Wemos D1 compared to the Arduino Uno.

    They share the same footprint but their pins are somewhat different.

    For my project I need to work out which Pins trigger the relay shield's 4 relays and also the maps for the remaining digital pins for connecting the pH sensor and temperature sensors.

    the i2c pins are also required for running the oled screen and buttons.

    Work is underway with the Wemos D1 code. The device will run a webserver to display data locally for users, and will also offer a json page for the Pi to collect data.

    Good times!

  • Current Build

    Craig Hissett06/15/2017 at 14:29 2 comments

    I just wanted to add a picture showcasing my current build using my enclosures from @Hartmut Wendt:

    This thing is going to look incredible when mounted in it's display case on the DIN rail!

    The DIN rail power supply has arrived today, so I can hopefully start to put together my case as soon as I have the rail fitted.

    Mains will be connected to an on/off switch I have, and that switcxh will route the power to the relays and also to the power supply. The power supply will then power the Pi Zero W-based Hub and the Wemos-based Control Unit.


  • Process Report

    Craig Hissett06/07/2017 at 21:01 0 comments

    Currently I have the following:

    Pi Zero W in DIN enclosure

    Wemos D1 in DIN enclosure w/oled display and relay shield

    DIN on/off switch

    Currently on order awaiting delivery:

    DIN power supply

    DIN rail

    DIN brackets

    In order to make this iteration of the Aquariumatic look the absolute balls I'm going to mount a rail in a small flight case on some angled brackets. This will look great for presentation and also will allow it to be really transportable.

  • Oled screen arrived!

    Craig Hissett05/30/2017 at 20:41 0 comments

    Today is another good day.

    My oled add-on screen for my Arduino enclosure from Hartmut Wendt has arrived.

    Great service from Hartmut - the first one didn't arrive so was quick to repost.

    The screen has 3 buttons with the screen, meaning ingredients I can add a small onboard menu for toggling displayed data etc, which is great.

    Today I've also found some good example code of a python websocket client. This is fantastic, as I can now put a websocket server on my esp8266 units and use the python client to request data from the all.


  • What a day!

    Craig Hissett05/04/2017 at 14:23 9 comments

    You know when you order so many little parts and components from various places you forget what you've ordered, and a few months down the line they all start arriving and every day is like Christmas, and the parts that arrive actually solve some project problems that you didn't have when you ordered them?

    Welcome to my Thursday!

    Today's delivery of note: a Wemos D1.

    ESP8266-based, and compatible with the Uno footprint, I'll be able to plug this into my enclosure instead of my Uno and have Wifi included without needing to add another module.


  • To Grove, or not to Grove...

    Craig Hissett04/05/2017 at 14:39 0 comments

    I am so, so close to finally putting all the components together I need for my modular Aquariumatic prototype.

    Once this is done I'm laughing; I'll be able to turn my hand to working on the code for the project (Raspberry Pi Images, sketches for the Arduino and ESP8266 devices etc), and also finalise my schematic to then start putting together a design for the PCB I most covet (I know exactly what I want in my head but can't design it until I get it down properly!)

    I've ordered a handful of components to and I'm now playing the waiting game until they arrive from China of course. While looking at ways and means to mount and connect all these bits and bobs in a nice clean way I came across the Grove modules. After looking through their list of modules they've got everything I'd need to rustle up my prototype; Relay modules, Temperature sensors, lcd screens, pH sensor modules and a ESP8266-based Wifi module. The Grove shield for the arduino would fit perfectly into my enclosure and it would make the completion of my prototype trivial.

    It would also make the swapping around of modules a doddle too, something I am looking for in prototyping platform.

    So, is it worth it? I will mull it over...

  • ESP Spree!

    Craig Hissett04/03/2017 at 15:04 0 comments

    That monthly sacred day known as Pay Day has arrived.

    I've ordered a few different types of ESP8266 based boards for my various projects:

    The ESP-01 has a nice small header, so will take up little real estate on any pcb designs as they materialise. This will give me a great platform to work on my new target of websocket communication with my prototypes once the chips arrive.

    Good times!

  • Protocol

    Craig Hissett03/29/2017 at 00:48 0 comments

    This is just a small update regarding a change of tact regarding communication for the Aquariumatic.

    My Arduibox arrived:

    Here it is pictured alongside my Pi Zero case. I love it! I am currently testing the configurations of lcd shield, relay shield etc. I think it's looking like both Shields will be dropped and just a standard 4 channel relay module added (screws and spacers added to the Arduibox prototyping area). With regards to the screen I feel like I may end up purchasing the oled add-on module available from Hartmut to keep the device looking so clean.

    So, protocol - up until this very point the plan has always been to use i2c to chain my units together; nice and easy, and addresses for 112 devices to be linked together. As a secondary form of communication the pcb was going to carry an esp8266, connected to the Nano via serial, for an additional way of getting data out of the slave, whether that be to a iot site like Thingspeak or even just to another Web browser.

    Today I had a brief chat over on the Aquariumatic Facebook page with a chap who was questioning my use of i2c. After talking him through my plans for i2c and a secondary esp8266 connection he said 'why not just use the wireless connection for the main protocol?'

    I couldn't give him a good reason why not, other than I have used i2c successfully in other projects so knew I could develop something for this project using it.

    After some thinking I have decided to stop letting my inexperience in wireless comms get in the way and have started looking at ways to implement this as the main comms in the project.

    The Tornado library (used to create the Python webserver on the Pi) has a handler for websockets, so I am going to look into using that to handle connections from my ESP8266. The ESP8266 will be getting coded to take data from the serial connection with the Arduino, package it into json format and sending it via websockets to the Pi.

    Wish me luck! Ha ha!

View all 15 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates