Reef Discussion

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
DIY Arduino LED Controller
Whilst my existing controller has been working faultlessly for 2 years now, I have been looking to build a new one based on a 3.2" wide screen TFT LCD. After some feedback from The Reefuge members I think I know what is needed to build a controller which takes the best from everything commercially available and roll it all into one :).

Many people are basing their code on the Jarduino but I don't think this makes the best use of the LCD and Touch functions now available. I will list all the components used as well as any problems/solutions I encounter along the way.

I expect that this will be finished by the end of January but I will give myself until the end of February to allow for any unforeseen delays - I know that I am going to regret setting a deadline but I need a challenge :p

Please feel free to ask any questions relevant to this thread :banghead .....
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Who is Spain? . . . Why is Hitler? . . .Where are the Snowdens of yesteryear?
You know, when I typed "Please feel free to ask any questions ....." I asked myself whether I needed to be more specific as I didn't want to be answering any questions about sex problems etc but I then thought, no, Reefuge members would not be so silly :rolleyes I was obviously wrong :D

But, Dave, just for you http://www.urbandictionary.com/define.php?term=Where are the Snowdens of yesteryear?
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
OK, time to get this started...

Arduino - what to buy? In my opinion, don't bother trying to save a few dollars by buying anything other than a Mega 2560. The extra memory, and more Input/Output pins that you will ever need, means that you won't have to worry about the hardware side of things, especially if you are planning to use a TFT LCD with a Touch screen which uses a heap of pins. The Mega is slightly larger (100mm x 50mm) then the UNO (70mm x 50mm) but it is still small enough to fit into a relatively small project box.

Mega2560.jpg



A word of caution... You can purchase an official Arduino Mega from a reputable dealer such as http://www.robotgear.com.au/Product.aspx/Details/591 - $63.80 - which you should have no problems with. Or you can purchase a 'Chinese' version like this http://www.ecrater.com.au/p/15190310/arduino-mega-2560-atmega2560-16au-atmega8u2usb?gps=1 - $17.76 or this http://www.ebay.com.au/itm/Arduino-...81?pt=LH_DefaultDomain_15&hash=item416feda3cd - $19.90 from Melbourne. Now, you may have no problems with these versions, but a quick Google search will reveal many people having lots of issues with loading sketches (programs) onto some of these boards.

I purchased one of these Chinese boards and spent quite a few frustrating hours trying to sort out the problems. I have it working fine now, but some people may not want the hassle.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
My current controller utilises a 20x4 Liquid Crystal display, similar to this

LCD.jpg

These are very easy to program but also very limited in what they can display.

Luckily, the cost of Colour TFT LCD's which incorporate a Touch Screen have become more readily available over recent years, and at an affordable price.

TFT LCD.jpg

These come in a variety of sizes from 1.8" up to 5". For a project such as this LED controller I would not recommend anything smaller than 3.2" and would highly recommend a 3.2" Wide Screen version which gives you a bit more room to play with. I purchased mine from http://imall.iteadstudio.com/display/tft-lcm/im120419006.html - $29.80 USD and have had no problems with it.

To interface it with the Arduino, I would recommend that you purchase a shield http://imall.iteadstudio.com/im120417024.html - $9.50 USD - this effectively acts as an interface between the screen and the Mega and does a voltage conversion on the way. It is just not worth the hassle to try and connect the screen to the Mega without this shield - 32 wires and a voltage conversion is just too much trouble.
TFT Shield.jpg

This is what they look like stacked together

Arduino stacked.JPG

Similar products are available from sainsmart but I am aware of some 'quality control' issues with some of their boards.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Similar, but not the same ;) The Arduino is an open source platform so anyone is free to issue their own versions - this is itead's version but, to make things easy for you, I wouldn't buy it. Firstly, the various Input/Ouput pins are in different locations to the 'standard' layout and they have not installed header pins on the double row at the end of the board. A lot of these particular pins are required for the LCD shield. I note that they say that the LCD shield can be used with this board - I don't believe that this is correct without a lot of work.
 

newbiereef

Member
Nov 8, 2011
874
154
gracemere
Similar, but not the same ;) The Arduino is an open source platform so anyone is free to issue their own versions - this is itead's version but, to make things easy for you, I wouldn't buy it. Firstly, the various Input/Ouput pins are in different locations to the 'standard' layout and they have not installed header pins on the double row at the end of the board. A lot of these particular pins are required for the LCD shield. I note that they say that the LCD shield can be used with this board - I don't believe that this is correct without a lot of work.
ah so i see said the blind man how do you know this stuff or is it all trial and error
i looked at the spec sheets and went wtf ???????
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
ah so i see said the blind man how do you know this stuff or is it all trial and error
i looked at the spec sheets and went wtf ???????
Just playing around with these boards for the last couple of years and lots of reading - www.arduino.cc , the official forum, contains a wealth of information.

This is the same product that @Brekel purchased - there is a problem with the SD Card circuit that prevents this from working. You may have noticed that whilst they refer to the SD card in the product details they finish with this "It is the version of product only with touch screen and touch controller." Buyer beware ;)

Will this be a problem for you, probably not. The SD card operates over the serial bus but I am using this bus for another purpose and so do not propose to utilise the SD card. It can be good to have for data logging purposes though :confused: There is a 'fix' available to correct the board (requires a couple of the SMD resistors to be removed and replaced with replacement resistors but with the wires switched over).

For this LED Controller I think you will fine with this product - just wanted you to be aware of the limitations. The problem with the circuit is what I referred to earlier as a 'quality control' issue :rolleyes
 

Synodontis

Member
Aug 1, 2011
1,979
968
Melton, Victoria
I think @MagicJ has put a hell of a lot effort into this project, I for one believe that the parts he puts up are the ones that anyone who like me has FA knowledge about this stuff should use lol. As Magic has said, trying to save a few dollars on what will be a great little controller is false economy. If you know what your doing & can adapt different boards to suit this purpose, your smarter then me (which isn't hard) :)
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
And thinking about this on the way into work this morning, the software that I am currently writing is designed for a 3.2" Wide Screen i.e. with a resolution of 400 x 240 - it will not play nicely with any other resolution screen , including the screen linked to by @newbiereef above which has a resolution of 320 x 240.

I chose the wide screen version because of the extra 80 pixel width - it is hard enough fitting everything I want to on this screen. Anything smaller could be made to work but I don't think it would be worth the effort.