This project is more of a learning challenge than anything else. The goal was to use a SOC device to interact with my salt water aquarium. For this implementation, I'll be doing the programming in java, this may be the only true departure from other projects.
When complete, the FLOPR will be able to monitor:
ATO Reservoir level
Temperatures
Water volume, and levels in various areas
pH
Flow rates to and from the sump
Spillage
When complete, the FLOPR will be able to control:
Heaters
ATO pump
Return pump
Local displays and status lights
FLOPR is capable of sending alert text messages and email based reports. Eventually, an interactive GUI and remote email based commands will control some aspects of the aquarium
Components
1×
Raspbery Pi 3 Model B+
Overkill for this stage, but it's a test bed
So I've completed a lot of testing with temperature sensors and ultrasonic sensors as well as program logic. Currently, the FLOPR computer will log temperatures of the Main Tank, Sump, and the room. It takes a measurement of ATO water remaining and calculates how many days are left before the reservoir runs out. The measurements are taken hourly, and every 24 hours, a report is compiled and emailed to me, and I get an alert text message to tell me a report is available.
I'm working on getting a version of the code that I'm able to put on github. There's a lot of specific information like account names, passwords, numbers that I'll have to edit out to provide a publishable version. I'm also trying out making a configuration file that the java program reads to set variable parameters.
I condensed down the rat's nest of wiring to a project box with a few simple break out boards connecting to the GPIO pins. The HC-SR04 ultrasonic sensor requires a 1k ohm resistor inline on the echo pin, and a 2k ohm resistor from the echo to ground. Vcc is 5.0v. For the DS18B20 temperature sensors, a 4.7k ohm resistor ties the signal and the 3.3v Vcc pin. Here are a few build pics:
For a while now I've been wanting to do something useful with a SoC and start learning about the IoT. I chose Raspberry Pi as the SoC due to popularity and capabilities. In my Computer Science classes, I've used java primarily, so I wanted to explore it's use with the RPi. Python seems to be the weapon of choice, but I like doing things the hard way.
Before I even get to sensors, calibrations, and computations, I had to make sure I could interface with the FLOPR. Yes, my inspiration for the project theme is based on one of my favorite 80s movies and it's antagonist (?) the WOPR computer. The first step here was to make sure I could get FLOPR to talk to me. I want to combine as many methods and types of sensors to increase my learning potential for this project, so I wanted alerts to go out as text messages, and reports to go out as email.
I've seen tutorials about using a free aspect of Twilio to originate SMS messages from java via internet. After much struggle, and some help from reddit and Twilio's help desk, I got it working. I also looked into sending emails using SMTP with a gmail account. After a lot of fine tuning, I have that working the way I want it also. While working these two avenues, I was introduced to Maven, a dependency manager. After a week of trial and error, I am getting better at dealing with maven, and I was able to write a short java program to send both a text and email to myself from inside the NetBeans IDE. Huge success.