Also, gas leakage, instigated by pipe expansion, is a dangerous problem while temperature is rising. Therefore, I added an MQ-135 Gas Sensor to the device, which detects NH3, NOx, Alcohol, Benzene, Smoke, CO2, to check the hazardous gas status in my room. And, most importantly, to be able to send commands to control the cooling fan via SMS messages and get the weather and gas information as feedback, I used a SIM808 GPS/GPRS/GSM Shield sponsored by DFRobot.

Sponsored products by DFRobot:

Step 1: Programming Arduino Uno

Download the required libraries:

For SIM808 GPS/GPRS/GSM Shield | Download

For 3-wire Serial LCD Module | Download

For DHT11 Temperature and Humidity Sensor | Download

Do not forget that the SIM808 receives SMS messages as char arrays instead of strings. So, you have to use the strcmp function to make comparisons to detect the requested command.

And, the 3-Wire Serial LCD module prints only char arrays. After creating a data string, use the String_to_Char function to convert strings to char arrays.

Connections and Adjustments

// Connections
// Arduino Uno:           //                               SIM808 GPS/GPRS/GSM Shield For Arduino
// D0 --------------------------- RX
// D1 --------------------------- TX
// D12 -------------------------- POWER
//                               3-wire Serial LCD Module
// D2 --------------------------- SCK
// D7 --------------------------- CS
// D10 -------------------------- SID
// 5V --------------------------- VCC
// GND -------------------------- GND
//                               DHT1l Temperature and Humidity Sensor
// D3 --------------------------- S
//                               MQ-135 Gas Sensor
// A0 --------------------------- A0
//                               2-Way Relay Module
// D4 --------------------------- IN1

Note: D0, D1, D12 pins are occupied by the SIM808 GPS/GPRS/GSM Shield.

Connect an external battery (7-23V) for the SIM808 module to work properly.

Attach the GPS antenna and the GSM antenna to the SIM808 shield.

Insert a SIM card into the SIM slot on the SIM808 shield.

Before uploading the code, set the function switch on the shield to None (1).

Upload the code.

Then, set the function switch to Arduino (3).

Press the Boot button on the shield until seeing the Net indicator LED flashing every 1 second and wait for the SIM card to register the network - the Net indicator LED will slowly flash every 3 seconds.

Click here to get more information about the SIM808 GSM/GPS/GPRS Shield.

Connect the 3-wire Serial LCD Module to the Arduino Uno.

To switch to the 3-Wire mode, set the PSB_ON switch to SPI.

Click here to get more information about the 3-wire Serial LCD Module.

Connect the DHT11 Temperature and Humidity Sensor, the MQ-135 Gas Sensor, and the 2-Way relay to the Arduino Uno.

Attach a plug to the 2-Way relay to be able to control the cooling fan easily.

After making connections, I fastened all components to a corkboard. As you may have realized, I used the base of my previous project (ORP Water Quality Detector) to create this project. In this way, I can switch back between projects by merely adding or removing sensors :)

Features

I mulled over these functions below to be able to observe the temperature, humidity, and gas status of my room while controlling my cooling fan via SMS messages.

1) The device throws an error message (Init Error) until the SIM808 connects to the GSM network.

2) When the SIM808 connects to the GSM network and works properly, the device shows a confirmation message (Init Success).

3) The device always returns to the home screen after receiving and interpreting SMS messages to let the user know it is ready.

4) If the device receives Open Fan as an SMS message, then it activates the cooling fan.

5) If the device receives Close Fan as an SMS message, then it turns off the cooling fan.

6) The device sends a feedback SMS message, including the current temperature detected by the DHT11 module, to the given phone number if it receives Temperature as an SMS message.

7) The device sends a feedback SMS message, including the current humidity detected by the DHT11 module, to the given phone number if it receives Humidity as an SMS message.

8) Depending on the gas value detected by the MQ-135 module, the device sends a feedback message including the gas status (OK or DANGER) with the current gas value to the given phone number if it receives Gas as an SMS message.

Videos and Conclusion