Automated Reptile Control System(webserver, Data Logging, RTC and much more)

Go to the playground and look at the Time and TimeAlarms library. You don't have to actually set the time, but you already have an RTC, so it should be easy to do. In the Time header file are a lot of macros including days between dates and such. Also, out on the web are a ton of days between dates routines that you can use. Most of the samples also have the seconds between date that will work for you as well, although saving the unix time when you start and just subtracting it from the current time will give you seconds pretty easily.

i have a few other bugs now, because of the removal of strings, my ability to download log files, and to delete the log files no longer works. i will look into that now as well.

edit: those are fixed now 8)

still going to look into the "system up time" calculator

draythomp:
Go to the playground and look at the Time and TimeAlarms library. You don't have to actually set the time, but you already have an RTC, so it should be easy to do. In the Time header file are a lot of macros including days between dates and such. Also, out on the web are a ton of days between dates routines that you can use. Most of the samples also have the seconds between date that will work for you as well, although saving the unix time when you start and just subtracting it from the current time will give you seconds pretty easily.

thanks for the info, i will take a look at those.

edit: latest code
https://www.dropbox.com/s/4s3vzc5gopik7re/Arduino3-1-2013.zip

Hi,

could you tell me what moisture sensor have you used?

thanks!

i am using Safety and Productivity Solutions | Honeywell

Hi,

No humidity sensor attached so far, just checking if all relays can be controlled in manual mode
but for unknown reason humidifier does not turn off in manual mode.
Any ideas ?

thanks!

ps. Talking about RTC, which pin SCL and SDA is connected on the arduino board please ?

On a standard Uno it is SDA to A4 and SCL to A5. Note that it is pins 20, 21 on a Mega. Most Megas have this marked on the board.

mkcinek:
Hi,

No humidity sensor attached so far, just checking if all relays can be controlled in manual mode
but for unknown reason humidifier does not turn off in manual mode.
Any ideas ?

thanks!

sorry for not responding sooner, been really busy.

to answer your question, i had the same issue. i know i fixed it, and if i recall there is a typo in the version of code i posted. when i get home tonight i will post the latest. that WILL fix that issue. :grin:

mkcinek:
ps. Talking about RTC, which pin SCL and SDA is connected on the arduino board please ?

i have the RTC connected to pins 20 and 21 on the MEGA

i would also like to update that the random system reboots and freezes have been fixed. now that i have removed the string class the system is stable. i also removed some code that had the unit auto-update its time every 24 hours. without that, you can still get the correct time by manually initiating a time update. the system has now been going for 25 days while logging data without issues.

latest code:

https://www.dropbox.com/s/s1tdkgo04rtc6cj/Arduino_3-29-13.rar

hi,

thanks - manual moisture control works now.

I have encountered another issue, when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

Thanks!

ps. what rtc module do you use ? I do not know why but I just can not start mine - it is Tiny RTC I2C module...
thanks!

Really appreciate your help and response!!!

I have five of those, they cost a couple of dollars each, and they all work fine. I have heard that they must have a battery installed to work. I don't understand why, but somebody recently had a dud battery and that was apparently the problem.

Thanks, I will test the battery ( perhaps I will buy another RTC)

Would you have an idea when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

No idea, I don't have a smart phone. My involvement is more about feeds to the internet and the only mobile device is a laptop getting the same data feed via bluetooth.

Nick_Pyner:
No idea, I don't have a smart phone. My involvement is more about feeds to the internet and the only mobile device is a laptop getting the same data feed via bluetooth.

thanks for fast reply!

I wonder if there is anybody who has tried to connect to this sketch with a smartphone ?

Thanks !

mkcinek:
hi,

thanks - manual moisture control works now.

I have encountered another issue, when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

Thanks!

i have experienced this as well when using the stock android browser. i have to use Mobile Fire Fox browser and i have no issues when using my smart phone. i have not determined what the cause of this behavior is. Just use fire fox mobile and you should not have any problems. there must be some issue with how the stock andriod browser behaves that keep the sketch in an infinite loop within the client connected code.

mkcinek:
Thanks, I will test the battery ( perhaps I will buy another RTC)

Would you have an idea when trying to connect with smartphone, arduino freezes - orange led starts blinking and no response...
Is there a way to use mobile devices with your control system?

the battery is required to keep the RTC module's time going when no external power is applied. otherwise the clock resets to zero.

mkcinek:
ps. what rtc module do you use ? I do not know why but I just can not start mine - it is Tiny RTC I2C module...
thanks!

Really appreciate your help and response!!!

i just did a search on amazon for RTC modules.

hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!

You only need one 4k7 but I don't know if this is the cause of your problem.

mkcinek:
hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!

i honestly do not know. i myself have one 4.7k resistor per sensor as well since each data line goes to its own dedicated I/O pin. do you have the sensors connected to the correct pin? have you tried to make sure the sensors that are not working, work correctly when connected to the I/O pin of one that does?

wallaceb:

mkcinek:
hi, any idea why I am only getting Middle Ground temp reading although Cold and Middle sensors connected.
Two one wire sensors with 4,7k resistors on each.

thanks!

i honestly do not know. i myself have one 4.7k resistor per sensor as well since each data line goes to its own dedicated I/O pin. do you have the sensors connected to the correct pin? have you tried to make sure the sensors that are not working, work correctly when connected to the I/O pin of one that does?

As far as I know one wire sensors are attached to 22,24,26, 28,30 pins.
Only getting Middle Ground readings, however after switching from Celsius to Fahrenheit I can get readings wherever sensor is connected, do you work on F or C?
thanks!!!