The Planted Tank Forum banner

DIY Aquarium Touchscreen Controller

87K views 207 replies 26 participants last post by  Darkblade48 
#1 ·
After seeing some amazing DIY controllers, I'm gonna have a go at it. Just had my Arduina Mega and 3.2" touchscreen delivered yesterday.
The plan is to monitor Temp, pH, dissolved Oxygen and eventually filter output flow. Want to also be able to control my heater, Co2, and LEDS with this controller.
I have never written code before, so this is going to be a learn as I go project :)

Used an existing sketch (Jarduino 1.1) to test everything out, and to give me an idea on how all the code ties in together.



Mike
 
See less See more
1
#77 ·
white screen problems

having done a lot of research on this project(jarduino) it appears that several types of boards (Touch screens) are supported. in the sketch you have several of them commented out. what needs to be done is to comment out the one that is currently being used (not commeted out) then compile the sketch until you get one that works. then there is somecalibration that needs to be down with the Touch Screen to make it all line up.
doc
the way you comment things out in the code is by using "//" or "/*at first of code */ at the end of code. i hope this helps if not i can find out what other settings will work for you. i hope
doc
:)
 
#80 ·
For those who have the Sainsmart Mega shield and cannot get the SD card working, I came across a website which shows the modification that is needed to get it working.
It requires a steady hand and some surgery on the board :icon_roll
I can confirm that it does work.
I have a bad DS1307 board, waiting for it to be delivered. I have a bug in the time code I need to work out. I do have my temp probes working now :)

 
#82 ·
Yes, if you look at the above picture, the blue pot is the screen adjustment
 
#83 ·
On a side topic.. How is this keeping date and time?
In a standalone app (not plugged into the computer), is it better to use an external clock like the DS1307 real time clock?

I remember the internal arduno time keeping drifts a bit and need periodic syncing.
It runs on the cycle of the processor with isn't 100% accurate?
 
#84 ·
If it is based on the Jarduino, then a DS1307 is probably used (that is what I am using as well for my own side project).

I assume that ultimately, you will want to use the controller as a standalone unit and not have it connected to a computer anyway, so a RTC would be required.

The Arduino has a way to keep track of time (the millis() function) but it resets everytime the unit loses power (i.e. it only keeps track of how long the unit has been powered on). It's not really useful for keeping time, especially if you lose power, but it can be useful to avoid using delays in code.
 
#86 ·
Yes, most devices will lose time if there is no power. The battery does not go directly to the Arduino per se, instead, the DS1307 RTC has space for a 2032 button battery, so it will be able to keep track of time even in case there is a power loss.

The 5V line in is so that the Arduino can query the IC for the correct date/time. Then you can throw it all onto an LCD (or have the microcontroller query the RTC if it requires that information, i.e. for a timer).
 
#87 ·
so i got my parts into the mail a few days ago and was messing around with the codes and made a temp control for 3 tanks so that i can run 1 control for 3 tanks if needed...


hey mike i see that you have edit a code with a ph monitor and was wondering if its working or just a dead display for now... if its working would you mind sharing your code? maybe i can grab some things you have laying around within your code...


also has anyone coded a timer to run with the arduino for say a co2 solenoid and for lighting on/off timer? if thats a yes, please share =)
 
#88 ·
also has anyone coded a timer to run with the arduino for say a co2 solenoid and for lighting on/off timer? if thats a yes, please share =)
I'm working on a pH controller that turns on/off a relay (that is hooked up to a solenoid). So far, it works fine with hard-coded pH values.

I'm working on editing a TFT LCD for input, so that the user can adjust the pH as required, and then have the values saved to EEPROM, etc, so that the pH controller will work fine.

Of course, temperature monitor and RTC is there as well, so I can control lights, etc.

I think the lighting on/off timer shouldn't be too hard; again, just have the TFT LCD accept inputs, and have the on/off schedule values written to EEPROM so that it'll be there even if power is lost.
 
#90 ·
Hey guys, loving this thread as I am in the same boat as you guys. Good to know there are others out there. I'm working with a 3.2" TFT (with SSD1289 controller) and an Arduino mega 2560.

The only set of software I've managed to get working is a folder I downloaded named UTFT off of Henningkarlsons website. Even those however don't work seamlessly. This is the best I've been able to get with them:





So I picked up Jarduino again and have been debugging for quite a while now. I'm using v1.1 and had to make a few modifications I picked up along the way from other programs. A big one is replacing

# include "WProgram.h"

with

# if (ARDUINO >= 100)
# include "Arduino.h"
# else
# include "WProgram.h"
# endif

in the ITDB02_Graph16 and ITDB02_Touch files. I'm still getting this string of errors however:

Jarduino_v1_1.cpp: In function 'void TimeDateBar(boolean)':
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.cpp: In function 'void testArrayScreen(boolean)':
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'
Jarduino_v1_1.pde:-1: error: invalid conversion from 'int' to 'const char*'
Jarduino_v1_1.pde:-1: error: initializing argument 1 of 'String& String::eek:perator=(const char*)'


Hmm, those smiley faces in the code must be the same shortcut text lol.

Any input would be greatly appreciated, sorry to thread-jack :help:
 
#92 ·
From what I can tell, megamax42 downloaded the UTFT library. I am not sure if he is using them, however.

megamax42, you can convert Jarduino v. 1.1 to use UTFT and the new UTouch libraries.

For Jarduino v 1.1 to work properly, you have to use the libraries that it uses, which only work under the older version of the Arduino IDE (not v 1.0 and up).
 
#94 ·
To use the example code that the Jarduino uses, you will need a Mega. I do not believe there are enough I/O pins on the Uno for the 3.2" TFT LCD Touchscreen.

As for me, I did not have any experience in coding at all. I started learning C++ last November, and can work my way around the sketches now with fair confidence.
 
#98 ·
This thread is a good start; there are some others on these forums.

If you Google Jarduino, you will also find some more information regarding that project. Older versions of the source code are open source, so you can build from there. There also is a list of some of the items that were used for that particular project, so you can see what was used, and then expand from there.
 
#99 ·
I was wondering, are the sensors and devices hooked up through i2c or through available digital and analog pins on this jarduino thing?

I would assume you need to define the devices somehow so then arduino can recognize them. Is it all through code? If so, that's a bit cumbersome every time you want to add a new device. We can do better for sure.


Sent from my iPad using Tapatalk HD
 
#100 ·
I think the only device that is connected over I2C is the RTC. Everything else is controlled by digital pins.

And defining the devices is pretty much done via coding (and is very cumbersome, as you mentioned). I think the Jarduino coding makes it a little easier by separating the code into little "units" .... but it is still a hassle to work through.
 
#102 ·
I'd assume you'd be able to write data to the sd card and store them in files. my idea with this stuff would, since i'm a web guy, interface with a website and store the data in a database.

not having any experience with arduino itself, i can only assume that with a wifi connection one would be able to make requests to a website for that data for reading/writing purposes.

I'd fully intend on making mine a web app.
 
#104 ·
Hmm...I'm just gonna have to dive headfirst into all this stuff to really figure it out. Do you guys know where I can find the ITDB02 Arduing Mega Shield V1.1 fully assembled, or did you guys buy the kit and put it together from iMall? (http://imall.iteadstudio.com/prototyping/kits/im120717001.html). Or would something like ebay item number 271025770499 work? Man it would be way easier if we could just link to ebay auctions...
 
#105 ·
Hmm...I'm just gonna have to dive headfirst into all this stuff to really figure it out. Do you guys know where I can find the ITDB02 Arduing Mega Shield V1.1 fully assembled, or did you guys buy the kit and put it together from iMall? (http://imall.iteadstudio.com/prototyping/kits/im120717001.html). Or would something like ebay item number 271025770499 work? Man it would be way easier if we could just link to ebay auctions...
I'm not sure if the ITDB02 Arduino Mega Shield v1.1 is still sold fully assembled. For sure, it is still sold as components only, and you just have to do the soldering. It is a useful skill to pick up anyway.

The eBay item that you linked will work, but it does not have the RTC that the ITDB02 Mega Shield v1.1 has.
 
#108 · (Edited)
After viewing this thread and project my eyes popped and I have wanted to look into something like this myself.



I have a few questions and maybe some solutions to better organize this thread a we bit. ( so rather a request )

1) How big is this touch screen ? (in inches)
2) would it be possible for you to post all the things you bought in the first post and their cost
3) could you also post in your first post the code you used in a spoiler for each portion
eg

LED CODE
blah blah blah blah this is my code blah blah blah
Co2 CODE
blah blah blah blah this is my code blah blah blah
4) could you maybe share your resources on where you are learning to code all this from
eg forums you have visited etc that would help anyone attempting this
5) Have you figure out what the code or script it uses yet ? so others may look for other screens etc may work with this protect as well.
6) a list of all the tools needed etc


I just found that reading through all posts ended up getting a little confusing and it would save you time in having to maybe help everyone else along the way through pm while your trying to figure it out yourself.

just a suggestion Mike and thanks for this lovely DIY thinking of doing this myself but wanting a bit bigger of a screen as this looks a tad small to me in pictures. ( although they are deceiving sometimes )


P.S. has anyone tried using this and would this work for adding other stuff ? http://www.ebay.ie/itm/Automatic-Di...quipment_ET&hash=item3cc9bc70f1#ht_4194wt_950

also wondering if anyone has made their own temp monitor or controller I was looking at something like this http://www.bedbathandbeyond.com/1/1/111625-pet-buddies-aquarium-temp-alert-dual-thermometer.html but also wanting something that can monitor or control my PH as well in one unit, for cheap.
 
#110 ·
I wouldn't recommend this project for beginners. It's not a plug and play, copy and paste project. There are lots of compatibility issues and bugs that only advanced users can handle.
I completely disagree. we're not talking banking application with millions of users and dollars at stake.

Don't sway someone away from trying something that is challenging. Great insight can come from attempting something you've never done or only slightly dabbled in.

If someone can wrap their head around the code examples and "see" what is going on within those, then give this a shot.

If someone is willing to email me code as a starting point, i'd like to set up a collaborative space so people could actively work on the code "together" and keep it under version control. A project like this needs something a bit more robust than a forum post.

I'd love to give more people a chance at using this code on their own terms as well, instead of being told "you don't know enough to get it so don't try"
 
#113 ·
The problem with that opinion is that it isn't helpful to the progress of this controller, or to those working on it, or to those who want to be involved.

That being said, I'm already working on a place where the code can exist for all to download it and all to contribute to it. I'd like to get a list of part numbers that go into the building of the unit as a whole.

ultimately, I'd like to provide a place for all of these sorts of aquatic controllers people are setting up.
 
#114 ·
well to be honest I am not exactly a beginer I am a network admin and I have coded my own games and server and programs for mmo, games so I know lots of different coding.

I was just trying to get a more clear step by step "quide" for prices and parts etc.

I was actually think about using a touch screen for a laptop or ipad or something. http://www.laptopscreen.com/English...screen+LCD+panel+on+a+tablet+PC+[HP+TX2500]+/




Thats what I was hopping to have set up in the first post so it is all in one place and here on the forums, I know I am new and all to the forums but after seeing this project I had to join. I am kinda offended that I was called a beginer with out that poster knowing anything about my background knowledge in computers/programming.

I could optimally help this project a great deal if I knew all the info and it was neatly organized in the first post.
 
#115 ·
i think they were talking about the OP

i purchased a domain that I intend to use to make this stuff a bit more friendly to grasp. I'll be using django for some quick setup and am hoping to get a github account setup so the progress can be visualized and tasks be created.

I don't have the funds to purchase the hardware (basement remodel underway) but intend on using this sort of stuff to control the 125g i have planned. for the time being my contribution will have to be in the way of a dedicated place for knowledge.

i'm a hardware novice myself, so it is beneficial for me to personally see how things progress.

If anyone wants to be involved more, please shoot me a PM. I hope to have the basics set up this evening
 
#116 ·
thanks Scape it would be awesome to have a place where we can all go and try and test different things.


I sure hope the OP can give us more detail as to the dimensions of the screen the cost the parts envolved the coding language etc as requested.

I originally wanted a screen about as big as a ipad to be mounted in my stand, and have it control everything.
 
#118 ·
as a web developer, my goal for a project using arduino will be a web based front end. that'd make it available to any mobile or home browser. I think it'd be great to log in via my galaxy s3, see what the probes are reading and make adjustments if i need to. but that is dooown the line for me.

I've purchased the domain opensourceaquatics.com, there isnt much there and won't be for a number of hours (i'm at work :( )

The goal is to provide the files via github, and ultimately host any conversation/discussion on people's various controllers on the site.

Github will allow the ability for people to fork the project to work on their own and provide push requests to merge those changes to the code base. It'll allow individuals to be set up as the main contributors, so those having already started their project would be given sole ownership with the ability to add others. It'll also allow tasks to be set up... so instead of splitting your attention all over the damned place, people can take on specific components and really focus on making one thing work.

Hopefully I'll be able to get some hardware in the next couple of months and start contributing code myself, and will be focusing solely on a web enabled system.

My website goal for the evening will be to figure out some site requirements and get a list of components that the site needs to start operating in the capacity i'm thinking it should.

considering I want this to be a site to assist the community, please make suggestions. If you have code, you can email me at ken@bugeyedllc.com and I can use it to test setting it up.

I'd kind of like the site to turn into an open database of DIY aquatics, from co2 reactors, to this awesome arduino stuff.

If anyone reads this who developed the code themselves, or started these arduino threads, please get in touch as I'd like to make sure you're given credit for the code hosted.
 
#119 · (Edited)
That being said, I'm already working on a place where the code can exist for all to download it and all to contribute to it. I'd like to get a list of part numbers that go into the building of the unit as a whole.

ultimately, I'd like to provide a place for all of these sorts of aquatic controllers people are setting up.
Hey Scapegoat, heres a list of the requisite components, plus some extras (most of this info is gleaned from the Jarduino user's manual).

First off, the Jarduino sketch is available here:
http://code.google.com/p/jarduino-aquarium-controller/


Parts:
The Arduino Mega 2650, retails for $65, but can be found cheaper. Beware of knock offs, though, they may be glitchy.



The ITDB02 Mega Shield Kit V1.1
$5.50 in kit form, you will need to solder everything together
http://imall.iteadstudio.com/prototyping/kits/im120717001.html



This is what it will look like assembled:


There is another Version 2 of the shield, but you will need to order the DS1307 RTC Module. E Bay sells them for like $2-5, and you will need to solder it onto the shield. This is the one I got:



The ITDB02 3.2" TFT LCD Display
$25.50
http://imall.iteadstudio.com/display/tft-lcm/im120419005.html
They have other versions for $30-33 but I cant determine the difference.



DS18B20 Temperature sensor:
$2-4 depending on the vendor, check E Bay



Others offer a waterproof temperature probe
$8-11



Then there are some fun extras that we can add into the system:

pH Sensor
$95 in a kit from Sparkfun:
https://www.sparkfun.com/products/10972?
Or you can piece meal it together. Some probes on E Bay are like $20-30, and the little pH stamp is $28 from Atlas Scientific (http://atlas-scientific.com/product_pages/embedded/ph.html)



Dissolved Oxygen sensor:
$192.95
http://atlas-scientific.com/product_pages/kits/do-kit.html
This one is definitely pricey, but would be really cool for those that really want to max out the system
 
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