• You are viewing the forum as a Guest, please login (you can use your Facebook, Twitter, Google or Microsoft account to login) or register using this link: Log in or Sign Up

Submerged: modular aquarium automation

jsiegmund

Member
Joined
15 Nov 2014
Messages
167
Location
Netherlands
Hi all,

These last few months I've been working on a pet project which I've called "Submerged". I wanted to introduce it here and maybe some of you might be interested in trying it out or even contributing it.

At the moment, submerged supports two kinds of modules: a sensor module for monitoring a tank, and a cabinet module for leak detection and switching relays. These modules are simple and require only power to work. They connect to the "gateway" device via bluetooth. This gateway is a raspberry pi (2B or 3) running Windows IoT. You can connect a display to the gateway to get realtime information about your tank:

submerged_dashboard.png


The gateway also sends this information to the submerged back-end. The back-end collects all measured data for storage & analytics. A mobile app for smartphones (cross platform although only tested for Android at the moment) can display the data:

submerged_live_400.png


At the moment the app displays the live data (along with a small graph of the last 3 hours) and you can click to see the data per hour, day, week or month. Especially for pH this can be very useful.

The app also allows you to control the relays you might have (linked to the cabinet module). It's simple on/off and each relay can be toggled automatically in "maintenance mode". This allows me to switch everything off for maintenance, but the cabinet light comes on :)

submerged_relays_400.png


There's also notifications included for sensor values running out of preset limits (min/max). These trigger a near real-time notification on your phone. For future versions I'm looking into a LED control module and maybe automatic feeding and water changing. I've got all of the sources published on github (http://www.github.com/jsiegmund/submerged).

Anyone who wants to use / contribute will have to get the hardware themselves. I've got a list of hardware here: https://github.com/jsiegmund/submerged/blob/master/hardware.md. It's all very common stuff, I've ordered a lot from aliexpress.com. All included I've spent about 150 euro I think. Most expensive parts are the Pi and the Atlas pH stuff which is relatively expensive (tried a Chinese one, didn't fly).

The code is .NET C#, the back-end is running on Azure. At the moment I'm limited in the number of devices it can support, simply because I need to scale up some things when the number of messages increases. In the github readme you can find some of the things that you can contribute to if you're interested in any way.

Even if you don't want to contribute, it would be very helpful to know which features you want to see added or what you'd find useful. I can use that to build a backlog. I'm not yet sure how far I'm going to take this, it's a fun hobby project at the moment so don't expect the world at this point.

Love to hear your opinions!
 
No problem, I totally get that. The hard part of setting it up at the moment is the hardware, some soldering is required ;) I guess in the end we might be able to do ready made modules which you only need to register and plug into power, but for now that's a strecht too far.
 
Hi Jasper,

Just picking up from my question in the previous thread.

Can your .NET code run on other platforms (e.g. mono on linux) - or does it require Windows 10 IoT?
and is it possible to control those sensors/switches directly from the Pi (i.e. without the arduinos)?

I ask because I can't help but feel you're adding additional complexity and cost for no significant benefit.

Let me explain :)

Using Windows 10 IoT requires you to use a Raspberry Pi 2B or 3. This is at least £25 more expensive than a Raspberry Pi zero, is physically larger and you don't need the additional memory or processing power.
Using Arduinos (rather than direct connection to pi) adds more boxes and cost, still requires wiring for the power and is potentially limiting (both inherently by using arduino's and through the use of bluetooth).

Assuming a basic project with a couple of temperature sensors and switches and ignoring common costs such as power supply, cases and the sensors themselves, the costs of a 'multiple box' solution would look something like:-

Raspberry Pi 3 £31
8Gb SD Card £3
Arduino nano x2 £6
Bluetooth HC-06 £4
Total £44

Whereas using a 'one box' solution looks like:-

Raspberry Pi Zero £4
4Gb SD Card £3
USB OTG Shim £1
Mini WIFI dongle £4
Total £12

For someone just getting interested/started, the initial costs are lower and the complexity is reduced - no additional boxes and no need to learn about arduino's as well as pi's.

The arduino route with bluetooth does potentially scale better if you decide to upgrade/expand at a later date (no need to physically touch the gateway device) - but using just a pi and the right initial design, this can be handled (e.g. those DS18B20 temperature sensors can be networked and a single pi can handle reading a number - I have 7 connected to my main system).

Please take this as constructive feedback/criticism and not some sort of personal attack:) - this looks like a very promising project and I'd really like more and more people to see how easy it is to get started with DIY solutions like these - hence my interest in keeping it as simple and cheap as possible.

Regards,
Mark
 
Can your .NET code run on other platforms (e.g. mono on linux) - or does it require Windows 10 IoT?
and is it possible to control those sensors/switches directly from the Pi (i.e. without the arduinos)?

At the moment it requires Windows 10 IoT, but Microsoft is launching .NET core soon which runs on Linux and Mac as well. The current app is already UWP (Universal Windows Platform) so should port over without too much effort. Might depend on some of the API's becoming available for the other platforms though, not sure about that.

Using Windows 10 IoT requires you to use a Raspberry Pi 2B or 3. This is at least £25 more expensive than a Raspberry Pi zero, is physically larger and you don't need the additional memory or processing power.
Using Arduinos (rather than direct connection to pi) adds more boxes and cost, still requires wiring for the power and is potentially limiting (both inherently by using arduino's and through the use of bluetooth).

Agreed, to some extent. The main reason for this choice at the time was the availability of the Azure IoT SDK. It's not that I per se wanted to use Windows 10 IoT, but it was the most logical option. When there are good SDK's for the zero, there's nothing in the way of creating a zero compatible gateway and plug that in. You could also do it without any SDK's, but thats too much trouble for me at the moment. That's one of the perks of the current design; you can switch out any of the components for something else.

The reason for the Arduino modules was mainly the ability to limit cables running everywhere. It's all doable as long as you have one Pi per tank, but if you want to monitor more tanks, you would be running all cables to a central Pi, or you needed to buy more Pi's which is more expensive. The end set-up will feature temperature sensors, ph sensor, flow sensors, multiple leak detection sensors, float sensors for stock fluids, etc. etc. That's a lot of wire. Also, the length of the wires might become a problem when you need to run it across your room to a central point.

For the bluetooth part; alternatives like ESP8266 433Mhz communication are being considered. There's no dependency on bluetooth apart from the gateway module implementations which can be swapped quite easily.

By the way, if you write a module class which uses the Pi's hardware instead of connecting to Arduinos via Bluetooth, you can quite easily support the "one box" scenario as well. The rest of the system doesn't care about how a module is connected to the gateway, as long as the gateway is able to retrieve its data. Each module is stand-alone in that sense. I've got a simulation mode in which a second Pi is outputting fake data without any physical arduino's connected. It's just two different classes being used, the rest of the system is completely agnostic. Dependency injection ftw! ;)

For someone just getting interested/started, the initial costs are lower and the complexity is reduced - no additional boxes and no need to learn about arduino's as well as pi's.

That's true. If you could specify the things you would want a one-box set-up to do, I can look into building it (no promises).

Please take this as constructive feedback/criticism and not some sort of personal attack:) - this looks like a very promising project and I'd really like more and more people to see how easy it is to get started with DIY solutions like these - hence my interest in keeping it as simple and cheap as possible.

Sure, no problem at all. I really appreciate any form of constructive feedback so I'm definitely going to take this into account!
 
I developed something like this once but found that people didn't like messing around with software and wanted buttons and lcds to read directly. Easy enough to program but I just couldn't build a nice enough box with all the right buttons, displays, knobs and power sockets to support my software.

I would start more basic - even just a knob and lcd to let users control their lights in a nice enough box to see if you can really do it.

Most people will buy anything if it comes in a nice enough box. Sounds simple but oh so hard to pull off... But don't let me discourage you
 
Well here is my controller (article in progress) with buttons, switches, display & ethernet. Can be operated and configured completely from front panel, so that if fiddling at tank during water change time, you decide you want all 4 tubes on right now and want to change light on time to 17:00, it can easily be done from front panel, without resorting to a PC and doing any programming. Its a Siemens Logo! programmable logic controller in a box. Job done.
upload_2016-6-22_13-25-6.png
 
I developed something like this once but found that people didn't like messing around with software and wanted buttons and lcds to read directly. Easy enough to program but I just couldn't build a nice enough box with all the right buttons, displays, knobs and power sockets to support my software.

That is already in place. That screenshot of the dashboard; it's running on a small LCD connected to the Pi which is next to my tank. Mine isn't touch enabled but you can use a touch screen and simply tap the relays to switch them on or off. So you either use the app or the touch screen. No need for physical buttons whatsoever :)
 
These are really great and I love them. But by 'nice' I mean it has to be close to ada-level nice. No screws sticking out, no wires showing anywhere, lcd needs to be flush with no gaps where it is mounted, labels need to be etched and not just printed and stuck on, everything needs to be square (i.e machine-aligned) and set in the middle, nice led buttons etc. etc.

My point is that if you can do just one simple box to that standard that only controls lights, it would sell better than a box that looks like a diy job even though it does 100 different things.

And my experience with touchscreens is that the design will look old after 6 months because iphones and google have programmed people into expecting high oled res level graphics that are regularly updated. Also a lot of people can't operate them properly (fat or dry fingers). Most hobbyists prefer a nice chunky button anytime (just look at the hi-fi crowd).

I'm just speaking from personal experience but if you believe in your approach then go for it!
 
I understand what you're saying, but this is still a DIY style project. It's feasible to create neat looking production grade modules, but I don't have the expertise to do so and at the moment the goal is not to sell stuff. So should anyone be interested in making these, that's perfectly fine with me of course, but don't expect too much :)

Here's a pic of the gateway dashboard display next to my tank:

submerged_display.png
 
Last edited:
You know what would be really cool, if you could incorporate the tablet display to run across the front panel of your tank. There's got to be clear, LCD displays out there, right?
 
You know what would be really cool, if you could incorporate the tablet display to run across the front panel of your tank. There's got to be clear, LCD displays out there, right?

If you find one, let me know ;)


Nice. I already have a 4ch dosing pump myself so this one is not very high on the list. Measuring the stock fluids running out is :)

Last addition to the project is logging. The mobile app now supports entering simple log messages which you can use to keep track of your latest maintenance. That information can be used to predict the next required maintenance of warn you when your late doing it. I also plan on saving all alert notifications to this list so there's a history to keep track of. For now it's just the basics.
 
Next up: out-of-stock-detection! I've ordered some cheap-ass float sensors off aliexpress and found a 500ml bottle in which they fit (actually the problem was finding bottles with a large enough opening). The rest is pretty simple; drill a hole, fit the sensor, hook it up to the cabinet module and you've now got an IoT enabled bottle ;) Ok, still have to write some software for it. Not quite sure whether the fluids are going to affect the sensors in any way, but I don't think so and otherwise that's not too big of a problem.

submerged_floatsensor1.png

submerged_floatsensor2.png


Placement of the sensor allows me to have a few days to refill before it really runs out.
 
Another update! Done a major overhaul of the back-end. Where previously there wasn't much flexibility, there now is lots. I've introduced a generic module based on Firmata which can read all sorts of sensors based on the configuration. That reduces the need for preconfigured modules although that can still be an easy way to provide some ready-made components in the future. The sensor configuration is now completely flexible, allowing to add as many sensors on as many modules as you would like (not tested for hundreds of course). Same goes for the notification settings; normal sensors have min/max thresholds, stock float sensors only signal when running out of stock and moisture only signals when wet.

submerged_app_stock.png

submerged_app_leaks.png
 
Here's another update, mainly focused on fixing some bugs and getting the experience more ready to get other users on board. I've published some documentation on how to get started at http://jsiegmund.github.io/submerged/. For now, getting started still requires some manual work deploying the mobile app and gateway using Visual Studio but I'm working on getting that fixed. Within the new app update users can now self-register a new device. The gateway is now more friendly to set-up too, it will request some information the first time it runs and then automatically gets its configuration from the back-end. Theoretically, also updates (adding a new sensor for instance) should be automatically pushed to the device and start working without any required reboot but that part does still need a bit of testing.

Let me know what you think about the documentation website, if there's anything missing or unclear, let me know or create a new issue in the repo (docs have their own branch).
 
Last edited:
Sooner then expected, I made a small breakthrough in controlling LEDs. I found a controller which can be controlled via TCP which allows me to quite easily send RGB+W values via WiFi to this controller. So there are no technical limitations any more for implementing lighting, but I want to be serious about the UI. Being able to control RGB is fun and all, but we want nice sunset/sunrise programs in an easy to program way. The old controller I'm using at the moment (TC420) comes with software to program it, but that UI/UX sucks big time. So I'm looking for a better way to do it and want to find some inspiration. So I was wondering if any of you have good examples of lighting-control UI's that are user friendly and flexible at the same time.

What I'm thinking of is programming color + output level linked to a specific time. The software can then calculate the crossfade between different settings and store a program with values per minute (probably sufficient?). But if there's better ways to do it... Would be best if the UI fits a mobile app, since I don't have a desktop version at the moment.
 
Back
Top