Noob is planning a DIY Reef Controller! Input is welcome

Hi everyone.
I'm a professional iOS developer, have decent theoretical electronics understanding (well that could be Dunning–Kruger effect), and know to hold a soldering iron.
Since I'm cheap, bored and lazy - I decided to learn a thing or two about micro-controllers and for motivation I decided to go straight to a full blown reef controller!
Ok joking. First I think I will build a an automated phytoplankton farm (just a couple of peristaltic pumps on timers and float switches).
But I am planning a controller.
That is what I would like some input. Let me describe what I will image it will look like and then I'll have some questions. If you have constructive comments (though good jokes are also welcome :stuck_out_tongue: ) please do share.

Ok here we go. This controller thing will not be a 1 big thing. It will be modular.

  • Power brick - basically a smart power strip (1 phase 220V AC - eu). I see there are opto-isolated relay modules on the market so it seems quite forward for a simple timer/event driven control. I would like to add a feature - power metering for each AC socket. I see there are hallefect sensonrs and induction could anyone comment on what they would use and why? What are con and pros? if I know the current do I need to also measure V to calculate power or just assuming 220V is ok. I'm aiming for +-10% precision :slight_smile:
  • Water sensor module - I found very nice Atlas Scientific EZO modules + Whitebox Labs Uno shields for mounting them onto .. they are pricey though any alternatives? Im will need pH, Temp, ORP and Salinity. this module will be last
  • Brain - module that coordinates all other modules. All modules send their data to this. It would issue commands to other modules. It would log data. it would have LCD and some controls, it would have inputs for "feeding mode".
  • Server/cloud - I'm thinking Raspberry pi for this. It would basically run web server for nice graphs and online interaction with brain? This is the most fuzzy :slight_smile: great reason to learn backend/frontend
  • 3rd party controller - a just bunch of 0/1-10V signal outputs for lights and pumps

How would you connect these modules - I would like to use something like Cat5/6 cables or rj11(phone cable). Cable I figure would be 2-3m max. I2C? SPI? How susceptible they would be to nearby AC cables?
Data load - 2 power bricks would be constantly feeding power usage data into brain (i'm thinking of doing frequent sampling and sending blocks of data for a few measurements every few seconds). Water Sensor Module would probably send data every 5s.
I imagine rf24 modules would crowd wifi spectrum? i would like to use wires since I will probably be routing 12V dc current cables from a single psu anyway.
how about chaining options (though .. star layout would be most logical it's just the amount of inputs I would need on the Brain).

Hardware.

  • Brain - I hope I'm not breaking any rules but from my limited research I think I would need something more powerful than basic Uno - I ordered a few STM32F411CEU6 modules (black pils???) to play around (and burn :)). It will have to handle all the networking. multiple user input from switches. have a screen, beepers, I'm planning to go to town with UI :slight_smile:
  • Power brick 1 8-relay module + connection to brain + rtc + 9 current sensors ... I'm thinking Arduino Mega for that many pins
  • Water sensor Whitebox Labs sells pretty much full package in shield format :slight_smile: will just need to find a nice watertight box :slight_smile:
  • Server - Raspberry-pi .. as I understand it would not be a great Brain module because of limited IO options. I have no experience with http stuff since uni days long time ago, but since it runs full blown linux I imagine should be able to run any modern frontend stack to create a slick online manager (plus I could ask colleagues at work for input)

Are the any road blocks for communicating between arduino to smt32 to RPi ? are there libs for that?

how problematic is timing of multiple communications in arduino? since all I sees a single while loop .. what happens if 2 modules would liek to speak to brain at the same time .. well I could imagine I could do a rotating connection initiated from brain to every module in turn. But are there better solutions?

It's been done by quite a few folks. Search this site (and others) to see what people did. You probably won't need that many modules, indeed a Mega might be able to take care of it all. As to communications clashes, I don't suppose anything in an aquarium setup is that time critical - plenty of time to get to everything.

Use the forum search tool in the upper right of this page and search for "aquarium". Some years ago somebody made an impressive aquarium control and monitoring setup.

And along the way just learning the ins and outs of the hardware you might try working with examples to pick up on

  • ways to save RAM including keeping data in flash but also in changing habits built on long PC programming.

  • switch bouncing.

  • multitasking w/o an OS. We do it, it's a lesson here you won't get out in PC-land.

  • voltage leveling.

These are some of the things to learn and get comfortable with if you want to fit projects to Arduino. Do it right and this

"3rd party controller - a just bunch of 0/1-10V signal outputs for lights and pumps"

will seem like a rather expensive idea. Ever heard of transistors, relays and external power?