About: electronics, software, ....

About the project

Build yourself your own temperature monitoring system with MAXIMUM and MINIMUM temperature thresholds, keep alive massages and (oldies but goldies as) SMS paging and remote ARM/DISARM system. You can supervise one or more 1WIRE temperature sensor(s) and page via SMS the "heating and chilling events" and keep alive messages, including last temperature. You can ENABLE/DISABLE the alarm system from remote via single SMS. This project uses for SMS integration the pin 2 pin compatible GSM shield (c-uGSM) or 3G shield (d-u3G).

Where to use it:

  • Greenhouse temperature monitoring and alarm
  • Your servers rack temperature monitoring and alarm
  • for the home-brewed beer fermentation barrel ;)
  • cellar temperature monitoring
  • aquariums temperature monitoring
  • freezers/heaters
  • ...and other. Just think at areas where the temperature variation can be critical.

I've originally published this project on my site on January 15'th, 2016.

Needed parts

Software credits

Inside this project I used for 1WIRE temperature the "Dallas Temperature Control Library" developed by Miles Burton & Tim Newsome >> Arduino Library for Dallas Temperature ICs reference here. Thank you guys! Nice job! software libraries are used as stated in their software license agreement.

Step 1: About C-uGSM and D-u3G Shields

There are pin 2 pin compatible shields, first one it is quad band GSM only(world wide compatible) and has support for 2SIMs and the second one it is SINGLE SIM 3G only (North American version) / 3G+GSM (European and rest of the world version). Those shields are compact as 1.25"x1.57"(31.75x39.88mm) / 1.35"x1.57"(34.29x39.88mm), weight around 10g, have USB support (communication and powering), auto level 3.3V-5V digital interfaces and Lithium Polymer charger integrated.

Step 2: DALLAS/MAXIM 18B20 Temperature Sensor

Solder the 2.2kb resistor between 18B20 Vdd pin(3)and 18B20 DQ pin(2). 18B20 Vdd pin(3) must be wired to Arduino 5V, 18B20 DQ pin(2) to Arduino D4 and 18B20 GND pin(1) to Arduino GND....see details above. DALLAS/MAXIM 18B20 reference here.

Step 3: Hardware Cabling

In the picture above (d-u3G - 3G shield wiring example) you can observe all logical connections.

For c-uGSM shield ( the GSM only version) usage: just connect the wires to the very same pins on the GSM shield.
Brief 3G / GSM shield powering wiring:

  • "WITHOUT Lithium Polymer configuration" configuration >> connect +4V power supply (g-SPS 4V [DDRV] recommended) to the 3G/GSM shield "Vcc 4V" pin.

  • "WITH Lithium Polymer" configuration >> connect +5V power supply (g-SPS 5V [LiPOL] recommended) to the 3G/GSM shield "Vin 5V" pin.

Read the reference: c-uGSM and d-u3G how to start.

The temperature sensor it is connected as following: 18B20 Vdd pin(3) must be wired to Arduino 5V, 18B20 DQ pin(2) to Arduino D4 and 18B20 GND pin(1) to Arduino GND. Do not forget to solder a 2.2kb resistor between 18B20 Vdd pin(3)and 18B20 DQ pin(2).

HINT: if you would like to have multiple 1WIRE temperature sensors, just connect them in paralel mode (single pull up resistor requiered... check for proper value...) and hack the software (use 1,2.. sensorIndex in "sensors.getTempCByIndex(sensorIndex)" ...see on next step).

Step 4: Software

  1. We use version Dallas Temperature library 3.7.2 beta. Download from here: Miles Burton Dallas Temperature library v 3.72 beta.
  2. Install this library >> how to install here.
  3. Start making a folder named "SMS_THERMAL_alarm_supervisor".
  4. Download the "c-uGSM kickstart for Arduino" from c-uGSM CODE SAMPLES and UTILITIES, or "d-u3G kickstart for Arduino" from d-u3G CODE SAMPLES and UTILITIES if you use the d-u3G shield. Product EMEI and your email address it is required in order to perform the download.
  5. Uncompress the archive and copy "cuGSM_basic_lbr.h", "cuGSM_basic_lbr.ino", "cuGSM_SMS_lbr.h" or "cuGSM_SMS_lbr.ino" ("du3_basic_lbr.h", "du3G_basic_lbr.ino", "du3G_SMS_lbr.h" or "du3G_SMS_lbr.ino" - 4 d-u3G users) files to the folder previously created.
  6. Download the Arduino code from the link bellow:

SMS_THERMAL_alarm_supervisor.ino : ARDUINO THERMAL SMS ALARM & GSM/3G SHIELD - main code

Set parameters

Edit the "SMS_THERMAL_alarm_supervisor.ino" (double click on the file; this one will be open by the ARDUINO environment).

Write in your desired destination mobile number on line 19. (Before this you may check the supported SMS number format by your NMO, using our kickstart software.)

Input the desired values for the temperature thresholds, sampling and keepalive time. You may edit the SMS commands and the SMS messages assigned to the alarm events.

If you use the c-uGSM shield. comment line 17.

Step 5: Behavior. How to Use It.

#0 DISARM the ALARM, #1 ARM the ALARM.

Any other received SMS, makes the ALARM to reply with a sort of "help message".

KEEP ALIVE SMS >> the thermal supervisor send an SMS (containing STATUS and last temperature) at each "keepAlivePeriod" seconds, if the temperature it is placed inside the "lowTempLevel" and "highTempLevel" threshold interval, or at at each "keepAlivePeriod/10" seconds, if the temperature it is outside the interval (ALARM STATUS).

Arduino's LED (D13) copy the ARM/DISARM status.

Usage areas...some (crazy) suggestions:

  • newborn baby temperature monitoring.... JUST KIDDING GUYS!
  • home-brewed beer fermentation barrel ;)

Anyway, always adapt the temperature sensor(s) to the environment (Eg.: liquids,..) or use proper encapsulated sensors.


Possible improvements

  1. Restrict SMS processing only from "phoneNumber" (master number)... Just look in the function readSMS (SMS library), after second readline(), the buffd variable contains the SMS header (sender number, date+time).. Feel free to make a patch there, in order to extract the SMS sender number... DONE! Check how I've done it in my SMS CONTROLLED RELAY BOARD and make yourself the changes.
  2. Add additional temperature threshold levels, in order control and compensate the temperature drift using one or more PELTIER CELLS via a Arduino digital output plus a TIP122 in open collector configuration or a relay??

Where you may go from here!

If you enjoyed this project, you may add it to your favorites, or you may follow me. Also, you may like to check my other projects.

Thank you for you time and for your interest!