All times are UTC + 8 hours




Post new topic Reply to topic  [ 425 posts ]  Go to page 1, 2, 3, 4, 5 ... 29  Next
Author Message
PostPosted: Aug 8th, '14, 06:57 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
Intro
I'm rebuilding my aquaponics system with a new greenhouse. I decided that I would try to automate as much as possible due to the fact that I travel often for work. I want a way to remotely check-in on my system and see if things are going bad and have enough data to be able to give instructions to my wife (or whoever is babysitting the system) on how to fix whatever is going wrong. Also it's nice to have a history so you can identify trends in the behaviour of your AP system.

The Arduino Controller
I turned to the Arduino for the sensor interface. I originally intended to use a bare ATMEGA but the simplicity of the Arduino let me get up and running quicker.

Here is a list of the components I used. I got almost everything from eBay. I would post links but they will probably expire in a month.
1 x Arduino Mega2560 R3 - Cheap chinese clone
1 x Arduino Ethernet Shield - Again, not the original.
5 x DS18B20 water proof temperature sensors in stainless steel sleeve. Tank, sump, growbed1, growbed2 and growbed3.
2 x DHT-22 temperature and humidity sensors. One inside the greenhouse and one outside.
1 x HC-SR04 Ultrasonic Ranger to measure tank water depth.
1 x Atlas Scientific pH test kit.
1 x Atlas Scientific Dissolved Oxygen test kit (Has not arrived yet).
1 x Tiny RTC DS1307 Real Time Clock module.
1 x Hall Effect Flow Meter.
1 x Relay Module. Opto-isolated, 8 channel. For controlling lights, fans, pumps, heaters, etc.
1 x 40x4 LCD module with HD44780 controller.
1 x LM2596 Buck Voltage Regulator module.
1 x Light Dependant Resistor to measure ambient light.
3 x Vibration Switches to detect activity on the bell siphons.
1 x Float Switch to detect low water level in sump.

This is the setup as it is sitting on the test bench now.
Image

Image

Fritzing diagram. Not as complicated as it looks.
Image

The power fail switch-over circuitry schematic. This is responsible for switching over to battery power when the AC fails. The Arduino can sense when AC power fails and take appropriate action.
Image

Here is the Arduino sketch. Bear in mind that this is my first Arduino project though I used to be an embedded device programmer so it's not my first rodeo. I used to code exclusively in AVR ASM and I think that style is reflected in my code (most obviously in my lack of the use of functions). I've included all library's required in the zip file. Also, this is work in progress so there is bound to be many changes to come. A lot of the code comes from various examples around the net so license is open. If you make millions of dollars off of my code, please buy me dinner.
aquaponics_chiumanfu.zip

Functionality description
Check growbed and tank temperature sensors. Turn water heater on if tank too cold.
Check inside and outside air temp and humidity. Turn fans on if inside temp is above threshold or inside humidity is higher than outside humidity. If inside temperature too cold, turn the pump off at night to prevent growbeds acting as heatsinks.
Check pH and DO. Push button to start calibration.
Check light level. Turn grow lights on if it is daytime and ambient light level is low and tank temp is below a temperature threshold.
Check flow meter. Determine if pump is operating at peak efficiency.
Check ultrasonic water level sensor. Turn off pump if water too high.
Check Real Time Clock.
Check bell siphon sensors. If no activity in 1 hour, trigger alert.
Check AC Power Status. Relays auto-switch to backup battery and inverter when AC power is lost. Everything turns off except controller and pumps.
Send REST to Grovestreams for interval sensors every 15 minutes.
Send REST to Grovestreams for random sensors when they are triggered obeying the 10 second timout.
To do :
Relay fish feeder on RTC schedule
Reset RTC from NTP every week
Webserver running on Arduino to allow changing thresholds
Log all data to local SD card

Grovestreams Interface
I started using Xively for cloud presence and data visualization and really liked it. Unfortunately, they have moved to a corporate model and all us hobbiest are left in the dust. In my search for a new service, I came across Grovestreams. Although it is still under development, I find it already more mature and feature rich than Xively. It is free if you stay under 20 sensors and 10000 transactions per month... easily doable with a hobbiest system. I just hope grovestreams doesn't go the way of all the rest and change their billing model.

Here is a shot of the Grovestreams dashboard. There are many different graphs, dials, bar charts and tables to choose from. Each widget can be embedded into your own webpage. You can also share a read-only link to your dashboard. If you'd like to see my live dashboard, pm me. I won't make it public because if too many people hit it, I may exceed my free transactions. Bear in mind, this is all just data from my test bench. The controller is not installed in a real system yet.
Image

Here is a shot of a single sensor view. The spike is just me testing the sensor in a glass of ice.
Image

Setting up sensor streams is simple.
Image

Grovestreams is capable of setting up complex alerting schemes. You can configure multiple trigger conditions and multiple actions including email, sms, html, etc. Delivery frequncy lets you set a really critical error to send alerts more frequently than a non-critical warning.
Image

The Aquaponics System
The plans are finalized and I've started collecting materials and preparing the ground. Part of it is in space that is already occupied so I will have to wait until my tomatos stop producing before I can finish digging the sump hole and erecting the greenhouse. It is a standard CHIFT PIST system.
Image

Image

Image

more to come...

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Aug 8th, '14, 07:05 
Offline
Newbie
Newbie
User avatar

Joined: Jun 11th, '14, 00:14
Posts: 47
Location: Vancouver, BC
Gender: Male
Are you human?: YES
Location: Canada, BC
That is really impressive. :notworthy:

The graphs I can see being pretty useful in diagnosing problems. You should come up with a kit and start selling them. :D

_________________
Levi's apartment aquaponics system


Top
 Profile  
Reply with quote  
PostPosted: Aug 8th, '14, 08:33 
Offline
A posting God
A posting God
User avatar

Joined: Dec 12th, '13, 18:34
Posts: 3846
Gender: Male
Are you human?: Yes
Location: Adelaide
Looks good. I've fiddled with arduino in my systems as well.

I might have to look into groovestream. I had the same problem with xively, and I couldn't figure out how to make the alerts work properly.

With the ultrasonic water level sensor. If it's automated to the pump, you need to make sure the sensor is 100% waterproofed. A splash on the top, or dribbling underneath will make it fail, or send readings saying the water is super high/super low. So make sure the code has failsafe inside it.

How pricey are the PH/DO sensors these days? And let us know how often they need to be calibrated :)

_________________
My System

My Aquaponic Youtube Channel

The Black-Byron Ice Creamery Youtube Channel


Top
 Profile  
Reply with quote  
PostPosted: Aug 8th, '14, 10:49 
Offline

Joined: Jun 11th, '14, 06:00
Posts: 5
Gender: Male
Are you human?: yes
Location: USA Georgia
Im just starting my system and im planning on automating as well. Im trying to study abroad in Italy and need to get real time information to direct my parents in case something goes wrong. Glad there are more people that think alike. Any tips for someone who has no coding experience/electronic experience? I will definitely be following this cant wait to see how well it works.


Top
 Profile  
Reply with quote  
PostPosted: Aug 8th, '14, 11:42 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
Colum Black-Byron wrote:
With the ultrasonic water level sensor. If it's automated to the pump, you need to make sure the sensor is 100% waterproofed. A splash on the top, or dribbling underneath will make it fail, or send readings saying the water is super high/super low. So make sure the code has failsafe inside it.

How pricey are the PH/DO sensors these days? And let us know how often they need to be calibrated :)

Thanks for the tip. The ph sensor is reasonable at $100. I found a lightly used one on eBay for $80. The manual says it requires calibration once a year. I've been testing it against my handheld meter and so far it hasn't drifted (3 months). The dissolved oxygen sensor kit is $200. A little more pricey but IMO it's a critical bit of data. I ordered mine from Amazon and it is in the mail.

You should switch to grovestreams. The API is very similar so the code won't need too much work and it fits perfectly for our application.

MariettaAqua wrote:
Im just starting my system and im planning on automating as well. Im trying to study abroad in Italy and need to get real time information to direct my parents in case something goes wrong. Glad there are more people that think alike. Any tips for someone who has no coding experience/electronic experience? I will definitely be following this cant wait to see how well it works.

I think it would be hard to keep a system going from afar for extended periods of time. You would need additional sensors for ammonia and such and maybe some dosing pumps for ph buffers. I have not found an affordable aqueous ammonia sensor.

Arduino is made for people to get into the world of micro controllers. It is aimed at people with zero coding experience and there is a plethora of sample code and hardware examples on the net. Plus, you can use my schematic and code to piece together your own system.

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
PostPosted: Aug 8th, '14, 22:50 
Offline

Joined: Jun 11th, '14, 06:00
Posts: 5
Gender: Male
Are you human?: yes
Location: USA Georgia
Yeah im definitely going to be using a multitude of sensors and i have located some Ammonia sensors that aren't to expensive, ill find the link and post here later. I will definitely try and use what i can from you i forgot i have an uncle who is a programmer so im going to get help from him.

How have those ultrasonic sensors worked out for measuring water depth i have heard of people using differential pressure transducer for the same thing wasn't sure which is better?


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 03:30 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
I went with ultrasonic for the simple reason that it's simpler and a lot cheaper. If it doesn't work to my liking, I will try the pressure transducer route.

I would love to see the ammonia sensors you found.

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 06:49 
Offline
A posting God
A posting God
User avatar

Joined: Dec 12th, '13, 18:34
Posts: 3846
Gender: Male
Are you human?: Yes
Location: Adelaide
Apart from the moisture issue when it rained, the ultrasound sensor worked perfectly. It'd also send back false readings if water was splashing around the sensor, but that's normal enough.

_________________
My System

My Aquaponic Youtube Channel

The Black-Byron Ice Creamery Youtube Channel


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 08:18 
Offline
Seriously, this cant be healthy.
Seriously, this cant be healthy.
User avatar

Joined: Feb 23rd, '07, 03:48
Posts: 6713
Location: Lyonville Victoria
Gender: Male
Are you human?: yes
Location: Lyonville
My brain just went "arghh, ug".

I'm going to have to read all that again.

_________________
Grow more with less


http://www.FishFarmers.com.au
https://www.facebook.com/fisharmers?ref=aymt_homepage_panel
http://hedgerowfarm.com.au/
https://www.facebook.com/HedgerowFarmVictoria/


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 08:30 
Offline
A posting God
A posting God
User avatar

Joined: Dec 12th, '13, 18:34
Posts: 3846
Gender: Male
Are you human?: Yes
Location: Adelaide
Once you break it down into parts, it gets easier to understand. Same with writing the sketch (code).

What flow meter did you get?

_________________
My System

My Aquaponic Youtube Channel

The Black-Byron Ice Creamery Youtube Channel


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 10:37 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
Stuart Chignell wrote:
My brain just went "arghh, ug".

I'm going to have to read all that again.

Anything you want me to explain in greater detail, just let me know. I'd like to give a little back to this forum which has helped me so much.

Colum Black-Byron wrote:
What flow meter did you get?

http://www.ebay.ca/itm/1-5-Water-Flow-Flowmeter-Counter-Hall-Sensor-Switch-Meter-1-120L-min-/111316005163

I also added a large chunk of code last night. Added a demand feeder switch and control of the relay with a bunch of checks to prevent over feeding. Plan on doing something similar to this.
[https://www.youtube.com/watch?v=I7_yUsjnHEY

Started adding a keypad and user interface to change all the min/max parameters and store them in eeprom.

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
PostPosted: Aug 9th, '14, 13:40 
Offline
A posting God
A posting God
User avatar

Joined: Nov 7th, '12, 19:48
Posts: 2359
Gender: Male
Are you human?: YES
Location: Warragul
When I become old and wise this is what I want to build :) Credit to you Mr Manfu

_________________
current system build
IBC system retired
Barrels&IBC in the greenhouse system retired


Top
 Profile  
Reply with quote  
PostPosted: Aug 10th, '14, 14:00 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
jayendra wrote:
When I become old and wise this is what I want to build :) Credit to you Mr Manfu

I consider myself more on the young and foolish side of things. :-P

The whole "maker" revolution has made this stuff really accessible to people of all skill levels. It's like night and day from when I first started. All you have to do is dive in and you will so on discover all the really geeky things you can do with these little arduino boards. You just have to take the first step.

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
PostPosted: Aug 11th, '14, 08:04 
Offline

Joined: Jun 11th, '14, 06:00
Posts: 5
Gender: Male
Are you human?: yes
Location: USA Georgia
I cant seem to find that ammonia sensor it appears i did not bookmark it but good news Atlas scientific is suppose to be coming out with nitrogen, ammonia, and chlorine sensor within the next year. It wont be long and i will start my own thread on my build.


Top
 Profile  
Reply with quote  
PostPosted: Aug 12th, '14, 01:19 
Offline
Xtreme Contributor
Xtreme Contributor
User avatar

Joined: May 17th, '14, 07:21
Posts: 180
Gender: Male
Are you human?: YES
Location: Vancouver BC Canada
A bunch of people have asked for links to the parts I used. I didn't post them originally because almost everything was from eBay and the links wouldn't last more than a month. Anyways, enough people have asked, so here goes.

Arduino Mega2560 R3 plus Ethernet Shield - $25.54 x 1

DHT22 Temperature and Humidity sensor - $3.88 x 2

5PCS DS18B20 Waterproof Digital Sensor Thermal Probe - $8.90 for 5

DS1307 Real Time Clock with AT24C32 EEPROM - $2.65 x 1

8 Channel DC 5V Relay Opto-coupler Module - $7.99 x 1

New Ultrasonic Module HC-SR04 Distance Transducer Sensor - $2.40 x 1

1.5" Water Flow Flowmeter Counter Hall Sensor Switch Meter 1-120L/min - $20.88 x 1

10pcs NEW Vibration Switch Shake Sensor Switch - $1.75 for 10 (would not suggest using these at this time, might need too much force to trigger)

Water Level Sensor Liquid Float Switch Tank Pool 90MM - $2.84 x 1

Wide Angle 40x4 Character LCD Module Display,w/HD44780,Bezel,White Backlight - $28.00 x 1

10PCS Long Straight Hinge Lever Type SPDT Micro Switch Limit Switch 153-1C25 - $5.20 for 10

Matrix Array 16 Key Membrane Switch Keypad - $1.17 x 1

20PCS 5MM Photoresistor GL5528 LDR Photo Resistors - $0.91 for 20

DC-DC Buck Converter Step Down Module LM2596 Power Supply - $0.99 x 1

Atlas Scientific pH Development Kit - $105.95 x 1

Atlas Scientific Dissolved Oxygen Development Kit - $192.95 x 1

_________________
.·´¯`·.¸¸.·•Chîµmånƒµ•·.¸¸.·´¯`·.

Arduino Aquaponic System Controller - Github


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 425 posts ]  Go to page 1, 2, 3, 4, 5 ... 29  Next

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.101s | 16 Queries | GZIP : Off ]