Reef Controller ThingSpeak Channel

AnnArborJayhawk

New member
So I do a lot of lurking but I thought i'd share a project I recently got working.

I've been following D0ughB0y's controller build for the last two years or so. I tried compiling it myself but I wasn't familiar with code or different IDEs outside of the Arduino IDE. Normally I would start with someone else's example code and go from there but I couldn't find my way around the different files so I gave up and started from scratch. Originally it was just a PWM out to control a Meanwell driver for a DIY light on my pico tank. Then I got a bigger tank and made my own 8 relay power strip. I kept adding things that people on the forums have done time and time again, ATO, Auto Water Change, high water level buzzer, Heater redundancy, etc. I've had it set up in that state for around a year.

I tried messing with an ESP8266 a year ago but it was such a pain to flash. since I didn't have a FTDI cable I used an Arduino in reset mode to passthrough the flash, all set up on a breadboard with a 5v to 3.3V level shifter. It worked, and I got it connected to the internet but i got burnt out and stopped working on it until last month when I ordered a nodemcu clone off amazon for $9. This way it had a USB and 3.3V converter built in. The other struggle was communicating between the Arduino and the ESP. I thought this would have been a common project online, but I really struggled to find any code snippets I could use as a serial protocol. So i came up with my own protocol and implemented it on an extra arduino and the ESP. After a few weeks of playing around, I finally uploaded the new code to my "produciton" Arduino and connected the ESP.

Right now I have a temp sensor connected directly to the ESP as a redundant sensor to the Arduino's in case something goes wrong. I send that value to the Arduino and I send the ESP the Arduino's temperature reading, as well as the PH, the amount of time my ATO has run today, and the return pump state. I have the ESP set up so that I can use Telegram (Android messaging app) to send commands to the Arduino and to retrieve current values. I can control the intensity of my white and blue channels on my chinese black box LEDs, I can start a feed timer which shuts off my return and powerhead for some amount of time, and I get alerts when something is out of range.

The best part in my opinion has been the data logging. I had data logged to a CSV on an SD card, but the Arduino was so difficult to access physically that I rarely pulled the data. Using ThingSpeak I can upload it to their servers and use MATLAB to post process and plot. You can even make interactive plots that you can zoom in on.

I'm still in the tinkering phase and my plots don't have much data yet, but I've already seen that my LEDs coming on seems to make a noticeable impact in the temperature rate of change. I also noticed the lack of impact my ATO has on pH, but I guess that makes sense since i recently cut way back on the amount of Kalk added to my ATO water.

I will post a link to the ThingSpeak channel if anyone is interested, but i'll do it in a separate post. I think there must be a rule about new users and posting links because the last time I posted something with a link it wasn't visible when I was logged out.
 
Supposedly you can embed live plots from ThingSpeak.

<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/channels/84036/charts/6?average=10&bgcolor=%23ffffff&color=%23d62020&dynamic=true&max=8.4&min=7.9&results=1000&title=pH&type=line&yaxis=pH"></iframe>


<iframe width="450" height="260" style="border: 1px solid #cccccc;" src="https://thingspeak.com/apps/matlab_visualizations/135004"></iframe>
 
Back
Top