Go Down

Topic: Grow Room Controller (Read 4966 times) previous topic - next topic

Nik G

Sep 30, 2011, 04:38 pm Last Edit: Sep 30, 2011, 04:47 pm by Nik G Reason: 1
I just finish publishing my first big project :smiley-mr-green:. It's a grow room controller that uses an Real-time clock and the TimeAlarms library to control a grow light, the arduino takes readings using a SHT15 digital temperature and humidity sensor that allows it to maintain the temperature using a heater and exhaust fan. It also logs data and events in two separate files and organizes them in a directory structure like so: "YEAR/MM/DD/". The controller displays info using a Serial LCD display and debug info over the Serial Port. I consider myself a learned novice at C++ so it's code is not to awesome :smiley-roll-sweat: (I think it could lose some weight considering it takes 32Kb :smiley-eek-blue:). Any polite criticism is appreciated  :)
Here's a link to my project page: http://arduinogrc.blogspot.com/

robtillaart


Code looks not bad, reasonable amount of comments, good use of functions (did not scan all 900 lines ;)

I see some repeating patterns that could be combined in some functions (esp LCD math to display values /10 & %10 )

Furthermore you use Strings quite extensively, rewriting the code so you use only char arrays could shorten your code.
Yes you should estimate how long the arrays need to be but that is not too complex.

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Nik G



Code looks not bad, reasonable amount of comments, good use of functions (did not scan all 900 lines ;)

I see some repeating patterns that could be combined in some functions (esp LCD math to display values /10 & %10 )

Furthermore you use Strings quite extensively, rewriting the code so you use only char arrays could shorten your code.
Yes you should estimate how long the arrays need to be but that is not too complex.




Awesome. I'll work through those and release an update along with a version that'll fit on an Uno once the code loses enough weight lol
Thank you for you input  :)

Nik G

I Just finished. Again, thank you rob for for looking it over, I did what you said and now there's only one string(which is a function) and the code for displaying numbers on the LCD is streamlined. It is now small enough to fit on an Arduino Uno and I saved enough space to add a humidity controller  :smiley-mr-green:.
Check it out: arduinogrc.blogspot.com

robtillaart


Another step to take is to place const char array's in flash memory, so they will not use precious RAM. Search for PROGMEM ...
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

supercrab

Looks like a sweet little project :)  I have to ask; what crop are growing?  ]:D
My Arduino 7 segment LCD/LED library

http://code.google.com/p/arduino-seven-segment/

maidbloke

Great job.  One addition could be using your ethernet sheild to tweet status changes: "Boy it's cold in here [15C], turning heater on."  You could then view the twitter stream to see what it's up to in real time, which would avoid you having to download files from the SD card.


I have to ask; what crop are growing?  ]:D


Personally I don't want to know...  :smiley-zipper:

frasco

Heh, no pics of the grow room.  8)

Graynomad

Quote
now there's only one string

If you meant String it would be nice to get rid of that as well so you don't pull the String library in at all. That must be fairly large.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up