Tag Archives | humidity

Portable Temperature & Humidity Monitor System

The purpose of this build is to become more familiar with how to develop a free-standing Arduino system using the Arduino Nano. The Nano is a smaller equivalent to the Arduino Uno, but with fewer interface options. It obviously occupies less space since it is a smaller footprint while having reduced overall dimensions. The project makes use of a DHT temperature and humidity sensor that interfaces with the Nano and it includes a 16×2 LCD display to indicate measurement results.

As temperature and humidity variations appear within the immediate environment, there are readings at the sensor read into the Arduino Nano. The system is configured and programmed to accept those readings and report them to the liquid crystal display. The ambient conditions surrounding the sensor are processed within the Nano to translate sensor data into usable information at the display.
The system is powered by a 9V battery stepped down to a regulated 5VDC supply. The power module supports the Nano, DHT sensor, and LCD display. The power supply module’s detachability renders the Nano accessible for ease programming and alternative power through the Nano’s USB receptacle. This setup removes any permanent tethering with extended life through a power supply module’s USB-A receptacle if a power bank is used instead. The 10K-ohm potentiometer is a brightness control for the LCD display.

The system schematic makes no use of passive components except for the single variable resistor (10K-ohm potentiometer). The direct connections between the Nano and display provide for desired simplicity during build and diagnostics. The DHT11 sensor pin-out provides for clarity about necessary connections at the Nano.

1602A LCD Display Pinout

PinSymbolFunction
1VSSGround
2VDD+5VDC
3V0Contrast
4RSRegister
5R/WRead/Write
6EEnable
7D0Data
8D1Data
9D2Data
10D3Data
11D4Data
12D5Data
13D6Data
14D7Data
15AAnode (+5VDC)
16KCathode (Ground)

Arduino Setup:

To program, edit, or update the firmware within the Arduino Nano, it is necessary to attach a USB connection from computer. The serial connection is made to update settings, configure the Arduino IDE (Sketch)
The conventional structured programming setup applies to this project as with any other. The top of the program specifies libraries to support physical objects or devices in the project such as the DHT sensor and the LCD display in this case. Above the void set up procedure block, relevant variables are declared by data type (integer, float, etc). The void setup initiates devices, Arduino functions, or GPIO pins. The loop functions are the procedure itself that iterates to execute the main process by which the program operates.
To set up and program the Nano, it is necessary to select it under the Board option from the Tool menu. The Port option within the Tools menu may require selection or setup as COM1 – COM5 (or some COM#) to establish a connection to a computer for programming and to run the Serial Monitor under this same Tools menu selection.
To install relevant external device libraries (such as a temperature sensor, or display), it might be necessary to add the device to the Arduino Sketch folder on its host computer (usually C:\Users\[name]\Documents\Arduino\libraries).
An example to install or update a device library from the Manage Libraries selection of the Tools Menu option, provides a dialog box to search by library name or description. In this example, “DHT” is keyed in to find the temp & humidity sensor for installation.
Once the Arduino Sketch IDE is set up and configured with the correct board, serial COM connection, and relevant libraries, the code becomes operable and the serial monitor confirms proper use and setup (if/as applicable).

Code Setup:

#include <DHT.h>
#include <LiquidCrystal.h>
int rs=7;
int en=8;
int d4=9;
int d5=10;
int d6=11;
int d7=12;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);

int sensePin=2;
DHT HT(sensePin,Type);
float humidity;
float tempC;
float tempF;
int setTime=500;
int dt=1000;

void setup() {
Serial.begin(9600);
HT.begin();
delay(setTime);
lcd.begin(16,2);
}

void loop() {
humidity=HT.readHumidity();
tempC=HT.readTemperature();
tempF=HT.readTemperature(true);

lcd.setCursor(0,0);
lcd.print(“Temp F= “);
lcd.print(tempF);
lcd.setCursor(0,1);
lcd.print(“Humidity= “);
lcd.print(humidity);
lcd.print(“%”);
delay(500);
lcd.clear();

Serial.print(“Humidity: “);
Serial.print(humidity);
Serial.print(” Temperature: “);
Serial.print(tempC);
Serial.print(“C “);
Serial.print(tempF);
Serial.println(“F “);
}