The Planted Tank Forum banner

Chads Arduino Build

28K views 73 replies 23 participants last post by  jbullfrog 
#1 ·
So, I am throwing my hat into the arduino total tank build, and I will try and document as much of my journey as possible here. I have tinkered around with the Arduino in the past, but have never attempted anything of this complexity. I have zero real world programming experience, but enjoy reading sites like hackaday, lifehacker, and such. What I'm saying here is that my code will look pathetically amateurish and possibly unreadable if viewed by a professional...

So, the goals of my personal build will be:
  • Autodosing
  • Keeping track of the fert levels and alarming if they become low (I am rather forgetful and would like a warning)
  • Keeping my light schedule
  • Controlling CO2 solenoid
  • Scheduling an auxiliary RGB strip, as I will shamelessly steal from AnotherHobby Fallen Tree Branch 60cm
  • The aux RGB strip will have sunrise, sunset, and moonlight as AnotherHobby has, ideally
  • Writing all of the alarm times to the DS1307 RAM, in case of a power outage (Unnecessary, but what the heck, why not?)
  • Keeping track of tank temp and cutting power to the tank heater in case of an issue
  • Anything else that I don't need but would like to try and implement

Thus far, my current build consists of:
  • SainSmart Arduino Mega 2560 (Knockoff from Amazon for like $28)
  • Sparkfun DS1307 RTC
  • Adafruit 20x4 LCD display
  • Adafruit 10K Precision Epoxy Thermistor
  • Small piezo buzzer for alarms
  • Assorted buttons, resistors, transistors to make it all work

This is currently it:






So far, I have achieved:
  • RTC is running and keeping time
  • Thermistor is working and updating once a second on the main screen
  • As you can see in the pics, I have the fert bottle levels displaying. Each full block is obviously 20%, and there are half blocks so I can easily see roughly how much fertilizer is in each bottle.
  • I have functions written to store the fert levels in the RTC RAM, and I am able to get them back out again (This required a lot of staring at code I didn't understand until it all kinda clicked)
  • I can now set the on/off times for the main lights
  • I can set the backlight via PWM anywhere between 0-255

So, I haven't gotten too crazy far in yet, but progress has been made. I need to finish getting the on/off time screens programmed in, then I can start writing the code to actually do something with the times!

Here is a link to the code as it stands
Current sketch

And this is the tank, awaiting its master


Good times will be had here, feel free to follow along on the journey :icon_cool
 
See less See more
3
#56 ·
BigD, I did post a help thread on Adafruit, and they were very responsive and helpful. Looks like I will be relocating the capacitive board outside the project enclosure and just running the data wires back to the box. This should eliminate the problems I am having. It just so happened that while I was troubleshooting, I made a separate board just for the touch sensor, so that board will go right next to the buttons on the inside of my stand.
Here is my help thread:
Adafruit help forum

And here is the new board I made that I will be relocating outside the box
 
#57 ·
Working!

Ok, I finally have everything working like its supposed to :) I had to relocate the capacitance sensor board to the inside of my stand, but once I did that, it worked like a charm. I am using 1.5" x 1.5" copper clad board as my sensors, right now they're just taped to the inside. However, even as-is, they are sensing through 3/4" plywood. I am sure once they are securely screwed down they will work even better. Right now they work great, but only within a tight area.

Here's a pic from inside the stand, facing outward. You can see the LCD glowing on the right hand side:


I also made a quick video after I got the project working. It is kinda crap, as I took it quickly with an Iphone :icon_redf

Project Demo

So, the plan is to have the plumbing done, and plants ordered this weekend!!! As I live in Phoenix, I'm hoping that Arizona Aquatic Gardens is open for walk-ins, as they are only an hour drive away.

Stay tuned for more pics as things end up in their final resting places!
 
#59 ·
Ideas?

So, I'm having some issues trying to figure out how I'm going to plumb the dosing pumps into the filter hose lines.... The peristaltic pump tubing is 3/16" OD, which can be fit inside standard airline tubing, which is 5/32" ID. Then that leaves me with 1/4" OD tubing. I can get the standard press fittings, however I am somewhat nervous about using those, as I feel they may leak. However, finding barbed fittings for 1/4" OD tubing seems very difficult. I am lead to believe that airline tubing is 1/4" OD, 5/32" ID.
Any ideas here?
 
#60 · (Edited)
Box done

Here some pics of the box in its final form. There are a couple code changes I wanna make, now that I've had it running for a little bit. But the physical box is now complete!! Now just to figure out the plumbing situation....

Bottom. I drilled out the group of holes under the USB port for ventilation. The cheap-o box didn't really like having so many holes drilled so close together, and kinda splintered some.



Left side. The DIN connectors from left to right are: RGB lights; Buttons and temp sensor; LCD; LCD. The LCD takes 10 wires by itself.



Front. The red button on the right is wired to reset. It has come in handy as I troubleshot problems when moving from the breadboard to the box. I def recommend adding one to your box if you decide to make your own controller!



Right side. Self explanatory. Three dosing pumps, the #1 reason I built this thing! The tubing is 3/16" OD silicon tubing, which is not easy to find fittings for. Airline tubing fits pretty well over it, but I'm not to confident in that holding for extended periods of time. usplastics.com isn't the easiest site to browse, but I think they may have some sort of adapter to take this tubing to 1/4", which would make everything much much easier
 
#61 ·
Chemical injection

So, after a couple trips to Ace, I got some good advice from one of the guys there. Instead of trying to cobble together a bunch of fittings, why not just use the same idea as the CO2 into the cerges reactor? So, I simply drilled a 3/16" hole in a 1/2" PVC plug, and pulled some air line tubing through. Add a couple check valves, and now my dosing pumps can pump into the filter line after the cerges reactor.





 
#63 ·
Thanks sketch! It has been a very long journey. I have everything hooked up now, however since I mounted my project box, it is now in close proximity to the capacitance sensor, and I am getting the ghost readings again :icon_frow So now I will have to move the sensor board again... Oh well. In better news, the tank is being put back together. Since I intend to have such a pronounced slope, I am going to use egg crate under the substrate to help with erosion. Work has begun on that part, and I intend to flood the tank sometime this week

Underneath the tank. Still a little messy, but I'll do some cable management down there soon.




Closeup of the chemical injection port. I drilled a 3/16" hole in a PVC cap and pulled some air line tubing through. There is a check valve just outside of it. I have two lines running into the top cap, as I didn't really have room for another PVC "T" fitting. I will run micros into the single port, and macros into the T fitting to keep them from mixing and precipitating. I also was able to calibrate the pumps today.




Shot of the tank with the egg crate being built. I need a couple more levels of the crate and then I start scaping!
 
#69 ·
Notorious, I'm glad my posts have helped someone! I haven't had any problems with my dosing setup since I started using it. I have mL markings on my bottles, and it's been injecting 15mL rock solid since the initial calibration.

kman, I'll have to get some new pics up soon. I replaced the Ray2 with a Ecoxotic E-series recently, as my previous RGB led setup was not built to withstand the test of time. Been looking at AnotherHobbys setup, and have to reprogram my controller to use those IR codes.

Thanks for the interest!
 
#72 ·
Wow Chiefston, great job here, i decided to grab a mega and started getting to work replicating this project as it is what i was envisioning myself anyways and had all the other parts(code from post 66). I have the code uploaded along with connecting the rtc, lcd, DS3231 and some buttons, the problem i am having atm is setting the fert levels and testing out that part of the code. I am able to get to pump settings 1 2 and 3 then the problem starts, i can set ml amts for pump 1 ONLY, and on top of that no amts are showing when i return to home screen, and this is where i get stuck..

Hopefully this message reaches you or anyone else that has used this sketch, any help would be greatly appreciated, thanks,
Matt
 
#74 ·
Quite impressive. That takes quite a bit of research to get everything wired safely in addition to learning how to code the Arduino. Nice code by the way! I only looked at the most recent upload but its very clear and easy to follow from what I skimmed of it. That, after all, is all that matters after functionality!
I was wondering something though. Sorry if you answered it already but you have a lot of power going into the box and I was wondering how you delivered power to the lights, filter, heater, pumps, co2, etc. Are you using the 12V power supply to power all of these parts?
 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top