TankDroid - Bluetooth Android-Arduino Controller
Planted Tank Forums
Your Tanks Image Hosting *Tank Tracker * Plant Profiles Fish Profiles Planted Tank Guide Photo Gallery Articles

Go Back   The Planted Tank Forum > Specific Aspects of a Planted Tank > DIY

Thread Tools Display Modes
Old Yesterday, 02:29 PM   #1
Algae Grower
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 91

TankDroid - Bluetooth Android-Arduino Controller

Yes, yet another arduino based aquarium controller. Finally am far enough to show you guys what I've been working on.

Inspired by AH's iAqua, robsworld's Robo-Tank, and bits and pieces from other older projects.

I started off reading the iAqua mega thread, and soon realized they were hitting space limits on the MEGA. I decided to go with a DUE and had begun my build with a 3.2" LCD. Later, Rob's mega-thread had started, and one quote stuck out.

Originally Posted by robsworld78
I wanted to build one for myself but was looking at one of my phones which has the 3.2" screen and figured that's to small so decided I would resize it to fit a 5" or 7" screen
Which got me thinking... why not just control it with my phone?

In comes the bluetooth, and weeks spent learning to write an app (Android if you haven't guessed), add a couple months of trial and error - and TankDroid was born.

It more or less covers the same things as iAqua, and a little less than Robo-Tank. No remote connect (for now ).

It is not complete (maybe far from it still), and I'd like to continue evolving it - but at this point, I am confident that it works. Still coming across the occasional bug in coding or in the app - but so far working very well. I do need to re-write the app to optimize it, as I used MIT App Inventor 2 which is not the best way to write apps (Takes a few seconds for the initial opening of the app). I also need to clean up the code before I post it, and would like to have it run while I'm on vacation without errors before I'd feel confident posting it.


- Bluetooth Control
- 5 LED Channel Control @ 12-bit PWM (right now set to WW/CW/R/G/B, but will add adjustability if there's enough interest for anyone else to build one of these)
- Sunrise/Low Sun/High Sun/ Sunset/Moon Lighting
- Custom Lighting
- 8 Relay Channel Control
- Heater Limit Controls + Alarm
- 3 Temperature Probes + Calibration
- 1 pH Probe + Calibration
- Feed Settings to turn off filters etc.
- Auto Feeder
- 2 Auto Dosing pumps (may expand on this later)
- Programmable schedules for power, lights, dosing, and auto-feeding

- Arduino DUE
- HC-05 Bluetooth Module (reprogrammed to 115200)
- DS3231 RTC (found to be less affected by noise, and to stay in sync better than the DS1307, also runs on 3.3V)
- DFRobot pH board + probe
- Optocoupled 8 Channel Relay Board
- Optocoupled 2 Dosing Channels
- Relay for Auto feeder

The hardware is a mess for now, after having to try various configurations and swapping pieces. I will be moving everything to a custom board in the coming weeks, and likely create a new box as I put a couple too many holes in this one. Also, having the dosing pumps inside the box makes me a little nervous.


First screen, upon clicking the button, list of your bluetooth devices pops up.

Then, select TANKDROID. I am going to try to change this, so it automatically finds the right device to pair without input.

Home Screen
Set to update every 3 seconds. Couple bugs still (MIN temps, fertilizer vials). Ignore pH value, probe was not connected when I took this capture. Clicking the Temp or pH icons resets the respective MIN/MAX.

Feeding icon shows last fed time or time left in feeding cycle when active.
Light icon shows the current mode, and time left to next fade, or time left in active fade when in a fade.

Dose remaining show up, accidently inverted the dose remaining in the app - so the vials actually fill up as the real ones empty .

Custom Lighting Screen, sliders or can type in a value. Checkmarks sends the value, the left icon resumes normal lighting mode.

Power Controls - Click on the icon to toggle power.

Settings Screen:

Light Values (click and type in), checkmark sends and saves the values, and the X requests current values (used to confirm changes, or revert changes) - this goes for most the screens.

Temp Limits for heater safety:

Temperature Calibration, this screen will show the current temps as well to help in calibration - placeholders there for now.

pH Settings - same as above, placeholder for current ph for now, also just realized i mixed up the high and low (whoops!). I'll add a checkbox option to allow for CO2 control based on pH value later.

Feed settings:

RTC Sync button sends android time to the arduino. Very easy to sync, but this RTC is very good, hasn't lost a second in 8 days. The ds1307 I had lost about 4-5 seconds a day.

Fertilizer settings, refill and run buttons:

Schedules screen:





That's it for the screens for now.

To Do:

- Fix MIN temp readings
- Fertilizer Icons on home screen
- Temp & pH readings on calibration screens
- Redo Box & Clean up circuit board
- Clean up coding & app
- Add WIFI

To Do if there's interest from others to build one:

- Allow adjustability in LED channel colours
- More LED channels?
- Add more dosing pump capability
- ???

No LCD means TONS of room to add things, whole sketch is at 10% of the DUE's capacity.

Also, didn't get any shots of it, but the app scales up nicely to my 7" tablet as well.

I may go with a PI server to allow for wifi control - the PI could connect to the controller via bluetooth and offer some separation between the DUE and the outside world. Still playing with this in my mind, and won't likely get anywhere for a month or so.

Suggestions? Comments?
renesis is offline   Reply With Quote Quick reply to this message
Sponsored Links
Old Yesterday, 03:04 PM   #2
Planted Tank Obsessed
CPD's Avatar
PTrader: (0/0%)
Join Date: Feb 2012
Location: Ontario, Canada
Posts: 478

Oh man that is so awesome! Congrats on the incredible work.
CPD is offline   Reply With Quote Quick reply to this message
Old Yesterday, 03:52 PM   #3
No more Bow ties
mistergreen's Avatar
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 14,676

Looks awesome.
You can put that up on the play store for $.99.
mistergreen is offline   Reply With Quote Quick reply to this message
Old Yesterday, 04:31 PM   #4
Planted Member
PTrader: (0/0%)
Join Date: Jun 2014
Location: rochester ny
Posts: 168

Looks awesome! Im guessing you have some background in software development
theatermusic87 is offline   Reply With Quote Quick reply to this message
Old Yesterday, 05:40 PM   #5
Planted Tank Obsessed
Freemananana's Avatar
PTrader: (8/100%)
Join Date: Jan 2015
Location: Leesburg, FL
Posts: 372

This is seriously cool. Doesn't even have to be a phone either, plenty of tablets run on android operating systems and can use this!
Low Tech Community Tank

Any feedback is welcome~
Freemananana is offline   Reply With Quote Quick reply to this message
Old Today, 12:49 AM   #6
Planted Member
PhysicsDude55's Avatar
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 239

When I first started my arduino project, this is what I had in mind.

Using an android phone or tablet to interface with the Arduino. I decided that it would take me too long learn to write an android app and get the interface working that I decided to just use an arduino with LCD.

I REALLY wish I would have done what you did an used android. A lot better long term potential and flexibility, and better screen/touchscreen quality.

Your project looks really good. Very impressed.
PhysicsDude55 is offline   Reply With Quote Quick reply to this message
Old Today, 01:30 AM   #7
Planted Tank Enthusiast
PTrader: (0/0%)
Join Date: Aug 2014
Location: Edmonton, Alberta, Canada
Posts: 560

Very nice renesis! The GUI looks great. So you're not worried about airborne noise from the relays sitting over the Due? Do you have any schematics?
robsworld78 is offline   Reply With Quote Quick reply to this message
Old Today, 02:23 AM   #8
Algae Grower
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 91

Thanks everyone! Lot of hours into this one.

Originally Posted by theatermusic87 View Post
Looks awesome! Im guessing you have some background in software development
Nope! This is my first app! My background is actually in Microbiology, believe it or not.

PhysicsDude55, The communication is actually quite simple over BT, as simple as sending serial commands back and forth. AppInventor made the android bit simple, but now I feel like I should do things the right way and rewrite the app properly. AppInventor has a lot of limitations.

Rob, Thanks! No schematics as of yet, but will be working on one to create a custom board soon. Not too worried about noise (at least yet), everything seems to be working great with the optos in place. The DC motors were creating more noise than the AC relays.

True test will be the next two weeks, as its now in complete control of the tank. Maybe I will try to borrow the scope and take some real measurements when the relays go on and off.

Thanks again everyone for the feedback!
renesis is offline   Reply With Quote Quick reply to this message

Quick Reply

Register Now

In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
Please enter a password for your user account. Note that passwords are case-sensitive.
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:


Human Verification

In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.

Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright Planted Tank LLC 2012