Notifications
Clear all

ArduinoPonics - Monitor/Control you Aquaponics with Arduino

15 Posts
3 Users
27 Reactions
2,353 Views
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Hi All, I'm starting a topic where I will post updates on my ArduinoPonics project, and my learning in general. Will include little code snippets that I find interesting and hopefully be a great place for people to join in or add advice on how I can do things better.

Haydz


   
Sean451, SuperCharlie, byron and 1 people reacted
Quote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

So, here is a little thing I just added for my startup. Just a little script to initialize my screen, and also some functions that will allow me to address the screen and print characters without having to specify lcd.setCursor() and lcd.print() each time. Basically made functions to accept where I want to start and what I want to print. Also created functions to clear a whole line.

void lcd_line_0 (int column_start,char *characters) {

lcd.setCursor(column_start,0);
lcd.print(characters);

}

void lcd_line_1 (int column_start,char *characters) {

lcd.setCursor(column_start,1);
lcd.print(characters);

}

void lcd_line_2 (int column_start,char *characters) {

lcd.setCursor(column_start,2);
lcd.print(characters);

}

void lcd_line_3 (int column_start,char *characters) {lcd.setCursor(column_start,3);
lcd.print(characters);

}

void clear_lcd_0 (){
lcd.setCursor(0,0);
lcd.print("                   ");
}

void clear_lcd_1 (){
lcd.setCursor(0,1);
lcd.print("                   ");
}

void clear_lcd_2 (){
lcd.setCursor(0,2);
lcd.print("                   ");
}

void clear_lcd_3 (){
lcd.setCursor(0,3);
lcd.print("                   ");
}

Place this in void setup to have a nice little welcome screen before I get into the proper display :

//Initialize the LCD
Serial.println("LCD Setup");
lcd.init(); // initialize the lcd
lcd.backlight(); // Turn on Backlight
lcd.clear();

//Screen Initialization

for(int i=0; i<20; i++) {
lcd_line_0(i,"*");
delay(50);
}

for(int i=0; i<20; i++) {
lcd_line_1(i,"*");
delay(50);
}

for(int i=0; i<20; i++) {
lcd_line_2(i,"*");
delay(50);
}

for(int i=0; i<20; i++) {
lcd_line_3(i,"*");
delay(50);
}
lcd.clear();

lcd_line_0(0,"Welcome To");
lcd_line_1(0,"ArduinoPonics v1.1");
lcd_line_2(0,"By Hayden Barker");

delay(5000);
clear_lcd_0();
delay(250);
clear_lcd_1();
delay(250);
clear_lcd_2();
delay(250);
clear_lcd_3();

Hope someone finds this useful. I have attached a little video of what the the outcome is here :

https://photos.app.goo.gl/JX8bsgcLV1NDFC3Y9

 

 

Haydz


   
Duce robot, Sean451 and byron reacted
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Here is the current parts list that I am using for ArduinoPonics :

//Parts List
// Arduino Mega 2560 (any arduino will do but go big or go home !)
// https://www.amazon.ca/gp/product/B016JWNYBE/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1

// Arduino Mega Compatible Ethernet Shield (we use this to upload the data to the MySQL Server on your computer/RaspberryPi)
// https://www.amazon.ca/gp/product/B01E5JY7UU/ref=ppx_yo_dt_b_asin_title_o01_s01?ie=UTF8&psc=1

// 8 Channel Relay Module (You can use a lower relay number, it depends on the control and size of your system, the code will work the same with some minor modifications)
// https://www.amazon.ca/gp/product/B06XCN5JNH/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1

// 3/4 Inch Hall Flow Sensors for water flow on your pump and your syphon so you can see when things are flowing.
// You may wish to go for a smaller diameter pipe so ensure that you are getting the right fittings for you pipe size.
// https://www.amazon.ca/gp/product/B07RF49TZH/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1
// You also need the barb fittings to make them fit into your flexible pipe.
// https://www.amazon.ca/gp/product/B009F3MSXU/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1

// I found these bioballs and filter bag helpful for stopping fish from getting stuck on the intake of the pump, and somewhere for the beneficial bacteria to grow. Not essential.
// https://www.amazon.ca/gp/product/B01MYPUNYA/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
// https://www.amazon.ca/gp/product/B08D6SSDFZ/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

// pH Probe/probes depending on how many systems your monitoring.
// https://www.amazon.ca/gp/product/B07RY6SJLQ/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1

// TDS Sensor so that you can tell the nutrient levels in your water. You will still need a Water Testing Kit to show you exact levels, but this will help with general TDS measurements.
// https://www.amazon.ca/gp/product/B086W63MTG/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

// DS18B20 Temperature Sensors. I like these sensors as you can stack them up on a OneWire bus and have only one pin used for loads of temps. I have multiple tanks plus I want
// to measure the ambient temperature so very handy! Especially good if your pushed for pins on an UNO or smaller device.
// https://www.amazon.ca/gp/product/B012C597T0/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

// LCD Module 20x4 for showing local statistics on the outside of your control board. Note, this required soldering together, you might be able to get a presoldered equivalent.
// https://www.amazon.ca/gp/product/B07TXGD3WS/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1

// Time of Flight Sensor for measuring the height of water in your growbed, or in your sump where the fish are. If this is not something you are checking every day, your water evaporates
// so you want to know when to add water. Note : These things don't like humidity, mine stopped regularly when condensation built up. Also, this required soldering.
// https://www.amazon.ca/gp/product/B07L47NS4J/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1

// I found these really handy for stacking my boards together into a box.
// https://www.amazon.ca/gp/product/B06XQ33Y9X/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

// 5V Buck Converter. Be careful how you wire these things up because I fried one of my Mega's by connecting it wrong. This is required if you are using lots of sensors and are going to
// blow the power budget of your Arduino. It's also fun just to have more flashing lights.
// https://www.amazon.ca/gp/product/B07ZSHT1TZ/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1

// You are going to want a pH meter to calibrate your cheap ones against. I recommend this one.
// https://www.amazon.ca/gp/product/B01ENFOIQE/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1

// You are going to want some of these for making all the hookups that you need.
// https://www.amazon.ca/gp/product/B01EV70C78/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1

Haydz


   
Sean451, SuperCharlie, MadMisha and 1 people reacted
ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Member
Joined: 4 years ago
Posts: 115
 

Sounds like a fun project! I've done a lot of gardening, dabbled in hydroponics, looked into doing aquaponics, but never proceeded. Even had a jacuzzi converted to pond with ducks.  But never got around to getting the fishies. What kind of fish will you use, and what is your growing climate?

Imagine by thought, create, don't wait, Scott.


   
Sean451 reacted
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

@whitneydesignlabs at the moment it's still mainly in prototype. So my small herb one at home is 1 medium goldfish and and small one. The larger chop and flip one is at my works warehouse and has 10-15 goldfish. Issues with lighting have stopped my progress there, the lighting is often on 24/7 which is not good for the plants. Saving my pennies over a couple of weeks to buy a nice large grow tent so I can have more control (yay arduino!). Will have lights set for approx 16-18 hours per day which I think it ideal.

Now that I have a couple of esp32 cams, I'm looking forward to making some cool time lapse videos of the growth inside the tent.

I'll be keeping this topic updated with my progress 🙂 Lettuce, Tomatoes and Herbs are the main goal. Hoping to eventually sell a few at the local farmers market, or, maybe create enough to take to the local foodbank. Long term goal would be some kind of commercial enterprise for veges, and an open source project for people wanting to do similar.

Haydz


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1150
 

@hbarkernz - following this topic with interest 👍, thanks for sharing.


   
Sean451 reacted
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Thanks, it seems there are a couple of people in the "Dronebot Universe" who are interested. I'll post up my success and my failures, nothing wrong with a bit of schadenfreude. Hopefully things I learn are useful to the overall community 🙂

Haydz


   
Sean451 and MadMisha reacted
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Hi All, just thought I would post an update to this. I now have the system up and running, if not as controlled as I want it to be. Currently instead of using my arduino for timing of the lights, it's a simple mechanical timer. Just haven't had the time to really get nerdy on it. The main pump is on a timer on my arduino mega, every 15 minutes, the pump turns on for 2 minutes which is enough to fill the grow bed and activate the bell syphon. The lettuce tower is just a standard hydroponics tower, but I'm powering it with Aquaponics 🙂 My 2 new ph meters arrived smashed from amazon, so waiting on replacements. Am adding an esp32cam to the setup for time lapse photography on the lettuce growth. Got it working finally earlier this evening, but have now spotted a new way I think i'll do it that uploads the images to a computer rather than onto the SDCard, SD card can only hold 4gb which isn't long enough. Need 30 days worth of footage at least. Spotted the script I think I will use on the esp32cam here : https://randomnerdtutorials.com/esp32-cam-http-post-php-arduino/

I brought a grow tent to house it all in so that the plants aren't in the constant light of my warehouse. Will hopefully find some time this week to get playing again and make this more of an arduino and esp32 project. Want to get my Total Dissolved Solids, pH and temperatures all being logged in a time series database and some reporting using one of the following :

https://kizniche.github.io/Mycodo/

https://grafana.com/

Have also been really inspired by this video. Some great ideas that I will steal from !

Anyways, that's the update. Once I have finished more of the code I will get it uploaded here and share some of the screenshots from the monitoring system.

PXL 20210219 182233261
PXL 20210226 123508443
PXL 20210226 123512551

Haydz


   
Sean451 and byron reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1150
 

@hbarkernz

Good to see your project evolve, thanks for the update.


   
HBarkerNZ and Sean451 reacted
ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Member
Joined: 4 years ago
Posts: 115
 

Kind of a side topic, but I have done some reading, and built a prototype LED lighting system that is controlled by Arduino PWM pin and SSR. The idea is pulsing the LED at high frequency, to save electricity, but at a duty cycle and frequency the plant's won't notice. Of course, over all light output is reduced by lowering duty cycle, so there may  be some point of diminishing returns. But I think there may be a sweet spot, of no loss of absorbed energy by the plants, but reduced electrical consumption.  Also, light hours vs dark hours can be dialed in for plant life cycle, but possibly with reduced overall power usage by PWM.  Just ideas to consider in your project.

My problem so far is the SSR and my experimental frequencies, using 120VAC mains power, seem to conflict with the internal electronics of the LED's driver circuits. I think I would need to discard the AC LEDs with built in drivers, and move to a custom driver circuit that can handle PWM input signals. Thoughts?

Imagine by thought, create, don't wait, Scott.


   
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Gosh that is a good idea, I won't have thought about that. Luckily I'm not too worried about power as our office warehouse is currently under utilized so the owner didn't mind me setting up my growing experiment. The idea sounds like it has merit if you could find the sweet spot where you are providing just the light that is required and no more. That said, and I'm no expert, I would imagine that in a grow tent environment that additional light might be reflected and get to areas where there might be less light available. I'm really a newbie at all of this to be honest. I started wanting to grow plants, then went down a rabbit hole of playing with micro controller and monitoring which was way more fund. In the end I had invested nearly $1000 in my hobby so I figured I had better grow something at least. So far if this is the only harvest I make, that would make my lettuces come in at around $15 each... even whole foods cant justify that haha

That said, I have had a couple of the local eateries ask if I can produce fresh herbs on a regular basis so perhaps I can monetize it a little 🙂

 

My ultimate goal would be to be running a small grow op that will provide fresh food to my staff, with additional food going to the local foodbank. Will see how it goes 🙂

Haydz


   
Sean451 reacted
ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Member
Joined: 4 years ago
Posts: 115
 

@hbarkernz So microgreens for immediate/soon consumption, are definitely a thing. Or at least they were before Covid19. Maybe they still are in private homes and some restaurants that have survived. Before I worked through my ideas, Covid hit, and I shifted gears. Your situation is unique. The warehouse: Too much light and (free?)-ish power. Under those conditions I am sure you can make something work. 

Imagine by thought, create, don't wait, Scott.


   
Sean451 reacted
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

I'm interested in continuing the conversation at some point, but for the purposes of this forum we should send the discussion back in the direction of electronics and microcontrollers. As for too much light, I'm talking about 24x7 light from high bay LEDs. That's not good for plants hence my grow tent. Looking forward to posting up my time lapse of the plants growing taken on my ESP32CAM. During testing all I got was 10 seconds of my dog sleeping on the couch, the plants didn't do anything in that time haha.

Haydz


   
ReplyQuote
(@hbarkernz)
Member
Joined: 4 years ago
Posts: 22
Topic starter  

Time for another update, I was able to find some time to make things a little more organized. I have cleared up some much needed space in the tent so that I can get more things growing at once. It has also gotten a little more green in there since last time I posted. We now have plenty of lettuce growing, and I was able to thin out some excess plants where I had put too many seeds in to make my fiancée a nice salad for dinner tonight. Fresh, Aquaponically grown baby lettuce greens !

I also took the random computer, switch and electronics and put it on a board that now hangs at the back of the tent instead of all over the place. In a nod to Bill, I have added a small DroneBotWorkshop sign and of course my computer runs on Linux.

We now have a nice little startup screen running on the Arduino Mega with the following measurements being taken :

Water Pump in (hall effect sensor on the inlet line)

Syphon Water out (halleffect sensor on the bottom of the bell syphon)

Temperature (ambient in the tent)

pH of the main tank

TDS (Total Dissolved Solids)

 

I hooked up a Real Time Clock for use at a later date when I want to do time based tasks like lights. I am just using a basic mechanical timer till I have the time to program this up.

IMG 20210306 151523 01
PXL 20210306 235359911
IMG 20210306 151517 01
IMG 20210306 151415 01
PXL 20210306 235344266
SerialOutput

I also included the little serial monitor output that I currently have. It's missing the TDS due to space on the line.

 

 You can see the LCD Display in action here :

https://photos.app.goo.gl/1itPjSZNrL5WNSsN9

I have 2 ESP32Cams lying around, programmed them up last night with a time lapse sketch I hope to use soon. I will probably put them in when Im at the office this week.

The time lapse sketch is here :

Credit to https://bitluni.net/esp32camtimelapse

To follow my code so far :

Hopefully this is helpful to someone in the future 🙂

Haydz


   
ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Member
Joined: 4 years ago
Posts: 115
 

Very cool!

Imagine by thought, create, don't wait, Scott.


   
ReplyQuote