Go Down

Topic: Aquarium Reef Controller, stage 1, the LCD shield, (Read 41 times) previous topic - next topic

Harlequin

Hello Folks, New to both Arduino and the forum so please be nice.

firstly alittle bit about this project: I'm an avid marine/reef keeper, and always love dabbling with 1 DIY project or another. My last project was building a DIY LED rig (you've probably seen tonnes of them). Now the next step up from this is to add an Arduino to control it via PWM. It was researching the LED build that brought my attention to ardiuno's and everything else possible with them. after spending many an hour googling, it looks like theres a few Arduino based controllers and decided i wanted to build my own.
Intial plans is to build a controller which controls the LED's and the light cycle and display them via a LC. Then from here include temp probes, and other things vaguely interesting.

Alittle bit about myself: as i mentioned above im an avid reef keeper, Im also 20, Male, British, love getting my hands in and always been the kind of person to rip something apart jsut to see how it ticks.

Im currently studying Biology and Computer Science at University and am in my first year. as part of my computer course im learning the programming language JAVA, which was another reason why i picked up an arduino because i thought it might be an interesting self teaching exercise. Im aware that arduinos are programmed in C/C++ but as you probably know, java came out of C++ and is very similar in some respects. so i have "some" consept of Object orientated programing and pick new stuff up pretty easy.

I currently have an Arduino Mega and 2 LCD with 5 button keypad shields (though 1 is broken and can only be used as a "3" button keypad)

Right still with me?


good.

because i've had limited time recently i havent had a chance to do much hardware work on the arduino (i.e. intergrating the buckpuck's) and have instead turned my attention to trying to create  and menu and try and link the keypad coding with the LCD display coding.

my main issue is ... well everything  :-/ ok not quite.

firstly i put most of my coding inside of Loop() method calling various methods etc but the big issue i have is the code is cycling through the code adn telling the LCD to rewrite itself over adn over, which gives an awful looking program which flickers constantly as the LCD rewrites itself.

now one way i managed to get past that was to run the cycle first then put a Delay() at the end. Issue with this is, if your stuck in a delay period (say 5 second) you cant input any data (i'll get onto the keypad programming later) the second option was to use a While loop and a boolean to run it once then only run it if the boolean value has been "reset" at another point.

before people shout, yes i have done some googling, on menu tutorials but cant really find much help. Also this is going to be a big ongoing project so i thought it was worth creating its own thread.


Well i think that covers everythign for the moment.  hope that wasnt too much and i appricate any help or suggestions people offer.

Im new to arduinos, the program language C++ and i've only been doing java for a semester.

cheers

Luke

Harlequin

(sorry for the double post, but i wasnt able to post links without posting atleast 1 message)

for those interested here is the LCD+keypad shield i have, on retrospect i think it might have been easier to buy a seperate LCD and keypad, for coding. and if it is i might buy a seperate one anyhow.


http://www.ekitszone.com/Products/3-lcd-keypad-shield-for-arduino.aspx

one imeidate issue i can see with this shield as it covers all the PWM ports, so i'd have to use jump leads etc anyhow to connect it in the final project and while prototyping.

Chris Parish

#2
Mar 30, 2010, 05:27 pm Last Edit: Mar 30, 2010, 05:30 pm by cjparish Reason: 1
If the LCD is visibly flickering then the chances are that you are clearing the LCD screen on each loop. Simply removing the clear statement and just overwriting will get rid of the flicker.

Also, if the sheild is blocking the pins then just make yourself some leads to connect it instead of plugging it straight in on top of the arduino.

What are you hoping to achive with the Aquarium Reef Controller?

Can't really do much more without seeing your code; any chance you could post it?

Chris

Harlequin

hello Chris thank you for your qucik reply, where to begin..



unfortunatly i dont have my coding to hand, it wasnt anyhting special as its on my old pc (i got a new laptop a few days a go) but when i get a moment i'll pull it off the old pc.

I'll write sone new coding now to show you some of the things i've been thinking. it wont take me that long and i'll post it up once i have it, so far all teh coding ive done todate has just been messign around to see if i can get different ideas to work. so i dont really have much todate. but like i said i'll load some up once i've wrote "as far" as i can get .. if that vaguely makes sense.

the first thing i'd like it to control is all the lighting, (i copied and pasted this off my tank thread on anothe forum)


Lighting:-

Fade in
Fade out
enable user to input the photo period
enable user to set max light intensity
possibly simulate lunar cycle
possibly simulate varying weather conditions (i.e. cloud cover, stormy, you get the idea)
possibly have an Acclimatization mode which reduces the lights and then slowly ramps them back up.

i want the user to be able to enter values via the keypad so i dont have to plug the thing into a computer i want to make it "stand alone" if that makes sense.

other ideas i have floating around once ive got the lighting down.

Monitoring:-

Monitor Tank temperature.
Monitor LED lighting unit temperature.
possibly monitor PH
possibly monitor salinity
do retrievable data logging.

and possibly build my own power bar using relays etc to control pumps on and off etc.

hope that vaguely makes sense, i know its alot and its very ambitious but hey it keeps me out of trouble  :P.

i'll creat some mock ups and stuff now and post them, up.

some of the better/more complete controllers are this one :

http://delicathdesigns.com/LED/?p=1

and

http://reefprojects.com/wiki/Main_Page

Luke

(oh i also know at some point i'll need to order a RTC for the time inputs, but for now i was just going to use delay() ... maybe )


Chris Parish

Hi Luke,

That look like an interesting project. I have a freshwater tank myself and you have got me thinking about the automation possabilities.

All the temperature monitoring should be really easy, the difficult point is deciding which of about ten million methods to use! :D

I look forward to seeing your code, and I hope I can help you with your project.

Keep us posted!

Chris

Go Up