Aquaponic 2.0

Hi all, I finally started diving into the world of microcontrollers/-computers like the RPi3 and the Arduino Uno. Now, while I do have a good technical background in machine-engineering I’m unfortunately fairly new to programming and setting up networks (both from the physical but also digital pov). Yet I’m determined to learn. As I tend to always start with (too) big projects, I’m planning to set up fully automatized aquaponic-glasshouse. I think the concept of the symbiosis of growing plants and rearing fish at the same time, while only using limited resources is really interesting, which is why I would like to take part in this. (And NO, it’s really not going to be used to grow any kind of illegal plants)

Based on several other similar hydroponic systems, my plan currently looks like this: On Raspberry Pi 3 will be used as the master, while the Arduino boards will be used as slaves having sensors and relays attached to them. For now there will be 3-4 Arduino boards, each having the same hardware/ sensor, but this number might be increased in the future. The network setting should therefore also allow adding more boards, without re-configuring everything. Communication will have to be two way, in the sense that the slaves shall constantly report sensor data (such as water-temperature etc.) to the raspberry pi while the pi will control devices (meaning, turning them on/off both on a regular schedule but also based on the incoming data) attached to the Arduinos.

The programming part will definitively be a challenge (at least for me as a beginner), but it is not my main concern at the moment as I am still struggling to find the ideal solution in terms of connecting the devises.

To define the general system requirements: Due to physical restrictions the connection has to be wired (so WIFI, Bluetooth, RF etc. are not an option) and the Arduino sensor nodes (at least some of them) will be as far away as approx. 100m from the pi. (Several tanks in different locations)

As the system should ideally be running 24/7 for at least a year, reliability is key. (Of course regular wear and tear can not be completely excluded and some maintenance can be needed from time to time, but it should be held at a minimum)

The budget is not my main concern. Of course the whole set up should not cost a fortune but $100 more or less will not be a problem, as long as the system fulfilling the requirements.

Data transmission rates will probably not be really high, as the sensor data should only be a few byte per reading. Yet data corruption via collision of data shall be ruled out as good as possible. For the “incoming” sensor data this would not be the main problem (if just one reading is incorrect this could be compensated while processing the data elsewhere), BUT for “outgoing” (RPI->Arduino) commands this will definitively a problem. If f.e. a valve is not closing as the command is not going trough I’ll have a big problem.

Finally, the Arduinos could be powered at their location as a power supply will be needed close to them anyway to provide energy for the appliances they are controlling. Therefore the connection-cable will solely be needed for communication purposes.

As far as I understood from my research up to this point, USB, SPI and I2C are not a viable option as their maximum cable length is “only” around a few m (More with range extenders, respectively is that usually defined as the max. length for max. bandwidth communication, but nowhere close to what’s needed) Is this correct so far?

When it comes to longer distances usually the terms Ethernet, RS232, RS485 are brought up. I do have a basic understanding of Ethernet connections (from what you’re using in a regular office network) and read a bid about the other two, but unfortunately they are usually not really discussed considering using them to connect RPI and Arduino boards. Especially not when it comes to connecting multiple Aruinos to one RPI.

My main question now is which of these options is the most suitable for the above described scenario and using these two boards types? Are there any other options that I missed so far?

Really looking forward to your input

Best regards,

I'd start with a single node, that's going to be enough of a challenge. I'm doing the same for hydroponics, and it's a lot of work to get it right. Aquaponics is a lot harder, as you're trying to simulate an ecosystem, in which you have more variables to control with less inputs than you have in hydroponics.

$100 - in what currency? I can't really think of a $ that's valuable enough to do all the above on just 100 of them. A single node, maybe. A pH and an ORP sensor take most of such a budget already, other ion sensitive probes such as for nitrite or ammonia are about ten times more expensive. Temperature sensors are cheap. EC a bit more expensive (a remarkably tricky one, but very important for proper growing to know how much minerals you have in the water). Water level sensors can be cheap if all you need is a high/low value.

You will have to add nutrients: first of all the fish feed (use quality aquaponic grade - trace mineral enhanced), secondly you'll usually have to add calcium for proper plant growth, and sometimes you may need to top up trace elements. Those are going to be hard to impossible to automate, that's where the farmer comes in.

For communication: RS485 sounds like the way to go. It can handle 100m easily, and you can connect multiple nodes to a single wire. The RPi can then simply query the nodes one by one at a regular interval, say every 10 minutes or so, to get their latest sensor readings. Nodes may also initiate transmission in case of alarm situations.

RS232 doesn't have the range. Ethernet requires much more complex hardware and protocols.

Hi wvmarle,

thanks for your reply.
Regarding the $: I think you might have misunderstood me here: I said $100 more or less are not going to be the problem, meaning that I won’t be pinching pennies as long as it makes sense for the system. I already have a rather small aquaponic system running and know that especially the EC / PH probes can be really expensive (somewhere between USD200-1000 and even above). Except for the nutrition dosing part, this system nevertheless is not automated at all and is more or less a ready-made thing. This is why I explicitly left this part out of my post (As I can use the equipment I have for now, respectively might this be added in a later phase)
As I always wanted to learn programming and was already interested in the topic I thought why not connect these two :slight_smile:

Did you work with the RS485 on your system? I already thought that Ethernet might be a little more tricky but as I have at least some experience with it, it seemed more comprehensible for me.
Is it also possible to set up a RS485 network in a hub and spoke like way? (Just in terms of wiring) As the water tanks will be in different locations not next to each other, wiring them to in a daisy-chain like way (as usually done for RS485) will be a little complicated.

No direct experience with the protocol as I use WiFi to connect to my devices. Happy I don't have to string even more wires!

Hahaha I know what you mean :) In the meantime I just found a video perfectly explaining (and thereby answering) my daisy-chain, hub/spoke question. @boardadmin: I hope it's ok to share the link, in case anybody with a similar project stumbles across this threat. If not please remove it: https://www.youtube.com/watch?v=k993tAFRLSE