Go Down

Topic: Chinchilla Temperature Monitoring and Alert System (Read 1 time) previous topic - next topic

wallaceb

Aug 05, 2013, 06:30 pm Last Edit: Aug 06, 2013, 07:46 pm by wallaceb Reason: 1
greetings,

some of you may have seen my thread titled "Automated Reptile Control System(webserver, Data Logging, RTC and much more)" which can be found here:
http://forum.arduino.cc/index.php?topic=140740.0
where i made a system to control my Ball Python's cage.

i am here again to show another Arduino project i have created. this one uses the same base code as the reptile control system in that is uses the same web-interface design and underlying code.

this system is much simpler in that it uses two temperature sensors (same ones as the reptile system) and will send out an e-mail over SMTP alerting me if the temperature in their area gets too high. it will continue to send an e-mail every 60 minutes as long as the temperature remains above a user-definable set point.

for those who are unfamiliar with Chinchillas, they have such thick fur that if the room temperature gets too much higher than 80 degrees F, then they can begin to over heat and even die. their room as its own AC unit, and if that was ever to die or malfunction, then this system will alert me.

i will supply a parts list, photos, and code later.

boleo

You did a really good work with the original proyect! I'd like to see this one too.

Cheers!  :)

craigcurtin


You did a really good work with the original proyect! I'd like to see this one too.

Cheers!  :)


+1 on that - cant wait o see this one !!

Craig

wallaceb

Parts list:

DS18B20 Temperature Probe Temperature Sensor - Grey - http://www.amazon.com/gp/product/B008RIOGP2/ref=oh_details_o03_s00_i00?ie=UTF8&psc=1
3 Pin to 2 x 3 Pin Computer Case Fan Y-Splitter Power Connector Adapter Cable - http://www.amazon.com/gp/product/B00957SY6G/ref=oh_details_o04_s00_i00?ie=UTF8&psc=1
Hosa Cable ACD477 Universal AC Power Supply - http://www.amazon.com/gp/product/B000Z31G3M/ref=oh_details_o05_s00_i00?ie=UTF8&psc=1
Box for Arduino - http://www.amazon.com/gp/product/B003ZKJNVY/ref=oh_details_o05_s00_i01?ie=UTF8&psc=1
Arduino MEGA 2560 R3 - http://www.amazon.com/gp/product/B006H0DWZW/ref=oh_details_o05_s00_i02?ie=UTF8&psc=1
Arduino Ethernet Shield R3 - http://www.amazon.com/gp/product/B006UT97FE/ref=oh_details_o05_s00_i03?ie=UTF8&psc=1
SainSmart I2C RTC DS1307 AT24C32 Real Time Clock module+board for AVR ARM PIC - http://www.amazon.com/gp/product/B006J4FZW4/ref=oh_details_o05_s00_i04?ie=UTF8&psc=1


I was able to fit everything perfectly within the "arduino box" i had to cut a slot so i could run the two temperature sensor cables out of the enclosure. the power supply is set to 7.5 volts, and the Y-splitter was cut so i could use its two male ends to interface nicely with the connector tip on the temperature sensors.

the web-interface of this design looks the same except that it does not have a "humidity" or "I/O" web-pages as it does not need that code. all the other specifications from my reptile controller are the same. there is a user-definable temperature setpoint and if the temperature goes above that value, it will send an e-mail out every hour for as long as the temperature is above that limit. all settings are saved to EEPROM.the user can adjust the date, and update the time from an online NTP time server. the URL for the NTP server and for the SNTP server are automatically resolved using DNS so i do not have to hard code an IP address in case that address ever changes. The user can configure if the system uses Fahrenheit or Celsius. the user can configure data logging to an SD card, and can configure all network settings including the option to use DHCP or static IP settings.

the real code that matters in this new project was the code to send e-mails and here is what i use:

Code: [Select]
void sendemail(void){
  if (mailclient.connect(ip, 25)) {
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("helo wi.rr.com")); /* say hello*/
    wdt_reset();
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("mail from: <###########@hotmail.com>")); /* identify sender */
    wdt_reset();
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("rcpt to: <##############@wi.rr.com>")); /* identify recipient */
    wdt_reset();
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("data"));
    wdt_reset();
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("to: <chin monitor>")); /* insert to */
    mailclient.println(F("from: <chin monitor>")); /* insert from */
    mailclient.println(F("subject: Chin Monitor Temperature Warning")); /* insert subject */
    mailclient.print(F("The temperature in the Chin's room is above "));
    if ((((hour * 3600UL) + (minute * 60UL) + second) >= ((UVLIGHTONHOUR * 3600UL) + (UVLIGHTONMINUTE * 60UL) + UVLIGHTONSECOND)) && (((hour * 3600UL) + (minute * 60UL) + second) < ((UVLIGHTOFFHOUR * 3600UL) + (UVLIGHTOFFMINUTE * 60UL) + UVLIGHTOFFSECOND))){//if it is day time
      mailclient.print(AADTOFF);
      if (temp_scale == 1){ //if temp scale is in degrees F
        mailclient.print(F(" F"));
      }else{                //if temp scale is in degrees C
        mailclient.print(F(" C"));
      }
    }else{
      mailclient.print(AANTOFF);
      if (temp_scale == 1){ //if temp scale is in degrees F
        mailclient.print(F(" F"));
      }else{                //if temp scale is in degrees C
        mailclient.print(F(" C"));
      }
    }
    mailclient.println(F(". Please check the status of the AC unit.")); /* insert body */
    mailclient.println();
    mailclient.println(F("."));
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println(F("quit")); /* terminate connection */
    wdt_reset();
    delay(wait); /* wait for a response */
    wdt_reset();
    mailclient.println();
    wdt_reset();
    mailclient.stop();
}
}



you can get the full amount of code here:
https://www.dropbox.com/s/wl3o0ngcd6i3xbh/chin-monitor.zip

i have included the project code, all the libraries i use, and also the EEPROM initializer code which will set all the required EEPROM memory spaces so the actual project will function once downloaded to the arduino.

ctaylor1

I saw this project and downloaded it to try on my 1284P Calunium V2.0 board.  I also loaded it to my Mega 2560 board where it is working perfectly.  Excellent work!  The DNS resolution and NTP update to the RTC is not working on the 1284P.  Debugging in one of the libraries is suspected.  Probable conflict with the 1284P and UDP or the Dallas Temperature library I use for my temp sensors.  Has anyone tried and experienced any problems with the IDE 1.05?

wallaceb


I saw this project and downloaded it to try on my 1284P Calunium V2.0 board.  I also loaded it to my Mega 2560 board where it is working perfectly.  Excellent work!  The DNS resolution and NTP update to the RTC is not working on the 1284P.  Debugging in one of the libraries is suspected.  Probable conflict with the 1284P and UDP or the Dallas Temperature library I use for my temp sensors.  Has anyone tried and experienced any problems with the IDE 1.05?


i use 1.05 and have no issues.

however with that said, for one reason or another, the automated time update code does not seem to want to work on the chinchilla monitor, but works fine on the reptile monitor. given that is the same code, i am not sure why. i can get the time to update correctly when i use the manual time update on the time adjust page. i need to look into the issues. both systems use the Arduino Mega.

ctaylor1

I tried your reptile monitor code on the Calunium 1284P with the same result... No DNS resolution, timeout so no NTP update.  I'm still looking at library differences.  It is good that you are not having issues with 1.05.  I'll keep you informed with any progress.

Go Up