Simple Weather Station using Arduino uno
Heading 1
Arduino is an open-source platform that enables us to quickly build electronics projects. It consists of both a physical Programmable Circuit Board (PCB) and a piece of software (an Integrated Development Environment (IDE)) that works on all known operating systems. We use the Arduino to develop a weather monitoring system based on temperature and humidity variables obtained from a DHT11 sensor. The system, when tested, was able to report if weather is Hot, Normal, or Cold based on the exact temperature and relative humidity within a 20meter area. We also demonstrate the recycling of plastic foam to be used as an insulator and casing for electronic components. Plastic foam, which is a waste material, greatly contributes to the Global Warming Potentials (GWP) when discarded improperly.
Components:
- Arduino UNO
- DHT Sensor
- LCD 16*2
- Jumper wires
Code:
#include <dht.h>
#define dht_dpin A1 //no ; here. Set equal to channel sensor is ondht DHT;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(){
lcd.begin(16, 2);
lcd.print("TEMP HUMIDITY");
Serial.begin(57600);
}
void loop()
{
lcd.setCursor(1,3);
DHT.read11(dht_dpin);
//lcd.print(abs(moisture));
//Serial.println(moisture);
lcd.print(round(DHT.temperature));
lcd.print("C ");
lcd.print(round(DHT.humidity));
lcd.print("% ");
}
Conclusions:
The Arduino IDE was used in developing the sketches that were uploaded as firmware into
the microcontroller. Thereafter, the system could work without the user's intervention.
Libraries are required for a robust firmware development using Arduino. In this case, we
used the ‘LiquidCrystal’ and ‘dht’ libraries. Next we set the Arduino pins and attached
them to the LCD for display. Arduino pins 9, 10, 4, 5, 6, 7 were attached to the RS, E, D4,
D5, D6, D7 pins respectively on the LCD. The ‘pinMode’ of Arduino pin 12 was set as
INPUT. This is the pin that reads the numeric values from the signal pin of the DHT11
sensor. At least a second delay is required to get reliable readings from the DHT11 sensor.
However, we used three(3) seconds delay to ensure that the previous values have been
displayed. It is also important to confirm that the temperate and humidity readings are
within the acceptable range for the sensor. In this work the humidity range was between 20
- 90 relative humidity, while the temperature ranged between 0 - 500c. Once the read values
are within range.