TankDroid - Bluetooth Android-Arduino Controller - The Planted Tank Forum
 7Likes
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 25 (permalink) Old 03-27-2015, 02:29 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 107
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.

Quote:
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.

Features:

- 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

Hardware:
- 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.



App:

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:



Power:


Fades:



Dosing:



Feeding


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?
saiko, saiko, Zaki and 9 others like this.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
renesis is offline  
Sponsored Links
Advertisement
 
post #2 of 25 (permalink) Old 03-27-2015, 03:04 PM
CPD
Planted Tank Enthusiast
 
CPD's Avatar
 
PTrader: (0/0%)
Join Date: Feb 2012
Location: Ontario, Canada
Posts: 501
Oh man that is so awesome! Congrats on the incredible work.
CPD is offline  
post #3 of 25 (permalink) Old 03-27-2015, 03:52 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Looks awesome.
You can put that up on the play store for $.99.
iuli8 and iuli8 like this.
mistergreen is offline  
 
post #4 of 25 (permalink) Old 03-27-2015, 04:31 PM
Wannabe Guru
 
PTrader: (1/100%)
Join Date: Jun 2014
Location: rochester ny
Posts: 1,401
Looks awesome! Im guessing you have some background in software development


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Help build the [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
] and [
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
]
theatermusic87 is offline  
post #5 of 25 (permalink) Old 03-27-2015, 05:40 PM
Planted Tank Guru
 
Freemananana's Avatar
 
PTrader: (12/100%)
Join Date: Jan 2015
Location: Tavares, FL
Posts: 2,971
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!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Freemananana is offline  
post #6 of 25 (permalink) Old 03-28-2015, 12:49 AM
Planted Tank Obsessed
 
PhysicsDude55's Avatar
 
PTrader: (0/0%)
Join Date: Oct 2011
Location: Dallas, TX
Posts: 339
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.

DIY Enthusiast


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
PhysicsDude55 is offline  
post #7 of 25 (permalink) Old 03-28-2015, 01:30 AM
Planted Tank Enthusiast
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Edmonton, Alberta, Canada
Posts: 797
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  
post #8 of 25 (permalink) Old 03-28-2015, 02:23 AM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 107
Thanks everyone! Lot of hours into this one.

Quote:
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!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
renesis is offline  
post #9 of 25 (permalink) Old 04-14-2015, 12:56 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 107
Hey all, back from vacation!

Quick update- Unfortunately, the RTC seems to have fried while I was away. It only gives out the time and date as all 0's, and will not accept any time being written to it. So, next step will be to figure out if it was a bad chip, or something I did in the wiring. Luckily that time condition put it into midnight- and essentially kept the lights off.

Fish and plants were all okay though!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
renesis is offline  
post #10 of 25 (permalink) Old 04-15-2015, 02:18 AM
Planted Tank Enthusiast
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Edmonton, Alberta, Canada
Posts: 797
Welcome back, hope it was a good one. That sucks on the RTC, luckily it was only that. I thought you were a little brave letting it run your tank untested. Glad everything worked out.
robsworld78 is offline  
post #11 of 25 (permalink) Old 04-15-2015, 01:41 PM
Planted Tank Obsessed
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Toledo ohio
Posts: 310
glad to see your controller worked out ok for you even with the bad rtc
rottison is offline  
post #12 of 25 (permalink) Old 04-18-2015, 04:52 PM Thread Starter
Algae Grower
 
PTrader: (0/0%)
Join Date: Dec 2014
Location: Toronto
Posts: 107
Thanks guys,

I finally had some time to open everything up to figure out what went wrong (was able to run the tank manually off my phone in the meantime to turn on/off lights, dose/ co2 etc..)

Well... took a look at the RTC and immediately found my error - total rookie mistake!

I had put 2 2.2k pull up resistors for SDA and SCL - except... the one for SDA, I put it into the hole next to strip that connects to the clock. So, SDA was not pulled up - and it worked for a little while until the pin on the DUE died.

Since I was using SDA1/SCL1, I moved everything over to SDA0/SDA0 - removed the resistor (as there are internal ones for SDA0/SCL0), and it looks like I'm up and running again.

I've started working on a custom board now as well to replace my wire jungle.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
renesis is offline  
post #13 of 25 (permalink) Old 04-19-2015, 01:46 AM
Planted Tank Obsessed
 
PTrader: (0/0%)
Join Date: Aug 2014
Location: Toledo ohio
Posts: 310
sounds like your making good head way
rottison is offline  
post #14 of 25 (permalink) Old 09-10-2015, 02:06 PM
Newbie
 
PTrader: (0/0%)
Join Date: Jun 2015
Location: Prague
Posts: 3
WoW. It is excellent, awesome. I definitely want to know the details of the project.
Marthinius is offline  
post #15 of 25 (permalink) Old 09-25-2015, 12:20 AM
Newbie
 
PTrader: (0/0%)
Join Date: Feb 2010
Location: Queens,NY
Posts: 4
This project seems amazing, and I must say that I will be willing to test this sketch and android app immediately. This is so convenient for my tank, and it will enable me to control my tank with ease, as I believe that 3.2 inch LCD is too small for my liking (the LCD size that most other sketches run). I have spare tablets that can act as a monitor too, which is great, even if it requires Bluetooth (which I believe has less range). Also if you want to keep up with the most recent activity on this project, I would recommend visiting TankDroid - Bluetooth Android-Arduino Controller - GTA Aquaria Forum - Aquarium Fish & Plants serving the Greater Toronto Area. (This same project but on a different source). Renesis also included the Github, which has the sketches on it. The link to the github is: https://github.com/renesis/Tankdroid. It seems that any help will be accepted to help with this project, so I just wanted to keep everyone here up to date.
matagim is offline  
Reply

Tags
None

Quick Reply
Message:
Options

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:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



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
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome