Reef Discussion

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Arduino Controller
There have been a few members starting to toy with the idea of using an Arduino to monitor/control their aquarium. A few are looking to replicate the Jarduino system detailed here http://code.google.com/p/jarduino-aquarium-controller/ and demonstrated as follows:


Whilst this is a respectable system I find it lacking in a number of aspects, especially the visual presentation, and my medium term aim is to write a sketch to replace my existing system but to fully utilise the capabilities of modern touch screen TFT LCD's.

But first off, what is an Arduino; what can it do; and how do I get it set up - I don't have my new screen at this stage so this part of the setup will need to wait for a few days.

Arduino

You can read all about it here http://www.arduino.cc/en/Guide/Introduction but basically it is a small computer that incorporates a number of GPIO (General Purpose Input Output) ports that, via the addition of a large range of sensors, can be used to interact with the world.

For example, if it is 10 o'clock then turn on the lights; or if the temperature is over 30 degrees then turn on the fan - these are only very basic examples but hopefully it will give you an idea of how it operates.

Setup

Full details can be found here http://arduino.cc/en/Guide/Windows - there are also options for Mac and Linux operating systems.

I was going to provide my own summary, but this guide is pretty straightforward so there is no value in replicating what has already been documented. Please ask questions if you have any problems.

You are likely to have the Arduino banging around on your computer desk whilst you get it setup - this is not overly good for the circuit board so I would recommend that you purchase some rubber feet and attach them to the bottom of the board, like this

Arduino-1.jpg


Hopefully, my screen will turn up soon and we can get started with some programs.
 

Brekel

Member
Jun 8, 2012
273
109
Hobart
Just found this thread. I'm heading down the same path myself. Originally I was going to make my own controller from scratch, but with the price you can obtain the arduinos online it's not really worth the effort.
I ordered an arduino and a touch screen a few days ago. I'll be watching your progress with interest.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Brekel - I have to agree about the prices. You can get a Chinese UNO for around $16 delivered - you couldn't buy the parts for less than that, let alone the time required to put it all together.

What arduino/screen did you buy?
 

Brekel

Member
Jun 8, 2012
273
109
Hobart
Ordered a sainsmart Mega2560 and a 3.2" lcd/touchscreen from ebay. Ordered them as two separate parts - the same seller sells the two parts together, but for some reason it cost $10 more that way :confused:

Haven't done any sort of programming for a while, but it should come back.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Ordered a sainsmart Mega2560 and a 3.2" lcd/touchscreen from ebay. Ordered them as two separate parts - the same seller sells the two parts together, but for some reason it cost $10 more that way :confused:

Haven't done any sort of programming for a while, but it should come back.
Brett, does this LCD have the SD included?? The wording on ebay suggests that it just has the touch panel but the pictures tell a different story :confused:
 

VaultBoy

Member
Jul 10, 2011
2,279
673
Gawler, S.A.
I have looked at them on eBay and I think they have the slot for the SD on the back of the screen but I dont think they supply the card itself...
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Yes, the SD card reader is located on the back of the screen PCB - just not sure if it installed on these particular ones.
 

Brekel

Member
Jun 8, 2012
273
109
Hobart
Yep, it has the sd reader.
It didn't come with the shield to go between the display board and the mega though. I was looking at a number of different ones, and I inadvertently purchased the one without it. Mind you, the Chinese translations on some of them make the details a bit vague.
Ordered a separate shield, arrived today. Willl have to start experimenting.
VaultBoy did you get your RTC going? Had a quick play with mine tonight. I seem to be able to access the 24c32 EEPROM chip included on the same board, but not the RTC chip. Mind you, I'm fairly new to I2C and haven't done any programming for a while, so I'm still getting up to speed.
 

VaultBoy

Member
Jul 10, 2011
2,279
673
Gawler, S.A.
I am pretty sure the RTC is shagged... I am going to be ordering another one soon and hopefully that will solve my worries.

I am considering ordering a mega 2560 with 3.2" touch pad and a couple other bits and pieces so I can build a complete setup in one (I always planned to upgrade :rolleyes )
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Hopefully I will have something to show you in a few days :)

This screen/board takes some of the hard work out of creating this type of interface - but at an additional cost.
 

muz_z

Member
Aug 29, 2011
17
5
Gday MagicJ

long time no speak;)

I will tag along for the ride on this one even though i have a profilux i would like to do round two for a build as i didn't quite complete my other one before i sold it off
so will be watching with great interest

Have just today purchased a mega2560, RTC, 5inch TFT with sd card, and connectivity board

Now just to purchase some relays And keep reading!
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Hi muz_z - I saw elsewhere that you had the DIY bug back :p

You definitely need the Mega as the screen/touch panel/sd card take up a lot of pins - 5" screen will look the goods.

This will be a slow build as I have been working on a DIY light meter which has actually taught me a lot about programming the lcd screen and touch panel etc

I also need to find a way of connecting the screen shield to the Mega without covering all the unused pins - it's not a problem where you only need to use 3 or 4 pins but for a big project it is more like 20!!
 

muz_z

Member
Aug 29, 2011
17
5
This is why I thought to get the connectivity board is this not right? Will this board solve that problem?
I hope so that's why I got it but it won't be the first part I bought that has nothing to do with what I want to achieve LOL
 

Brekel

Member
Jun 8, 2012
273
109
Hobart
Hey MagicJ, my programming is coming along nicely with everything working so far except one odd thing: when I display a bitmap image, everything is shifted one pixel to the left and the left-most column of pixels appears on the right.
For some images it isn't obvious unless you look really close, but on small icons or graphics it is.

I checked the example programs in the UTFT library, which appeared to display correctly, but a close examination shows that the mainly white edge of the pictures disguises the effect. Its made more obvious if you edit, say, the top left pixel to something contrasting.
Not sure if it its something specific to the display I'm using.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Brekel I can't imagine that it is anything to do with the actual display.

What program are you using to convert the images? Email a bitmap and I will try it on mine.
 

Brekel

Member
Jun 8, 2012
273
109
Hobart
I tried both the program that came with the UTFT library, as well as the online version.
The example programs come with the graphics preconverted. I can manually change the order of the data in the array to compensate, but wouldn't want to do that for a large file.
I'm using my mobile at the moment. When I get back to the computer I'll send you a file.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
I will PM my email - I can't say I have noticed a problem but I may not have been looking either ;)

Have you had any problem with the touch panel library? Sometimes when I load a sketch the touch won't work, other times it is fine - it is almost as if the touch panel doesn't initialise correctly every time.