Date, Time, Thermo and Humidity Meter, Using Arduino Nano, LCD 16x2, DHT22 and DS3231, With Automatic DST .

by giano2002 in Circuits > Arduino

977 Views, 6 Favorites, 0 Comments

Date, Time, Thermo and Humidity Meter, Using Arduino Nano, LCD 16x2, DHT22 and DS3231, With Automatic DST .

20230416_184416.jpg
LCD_16x2.jpg

Another project to display date, time, temperature and humidity, using Arduino Nano. But its "novelty" consists in the ability to automatically change the time from standard local time to daylight saving time and vice versa, in March and October.

Using the DS3231 clock module, with its back-up battery, a remarkable precision over time is obtained. Even the DHT22 sensor allows a good precision, although it should be considered the opportunity to calibrate it, depending on how you decide to connect it to Arduino. In the sense that if the sensor is placed close to the Arduino, it could be affected by the little heat generated. Therefore, a compensation of the temperature value will have to be introduced in the program.


Supplies

1) 1 Arduino nano;

2) 1 DS3231;

3) 1 DHT22;

4) 1 LCD 16x2

5) 1 I2C Bus for LCD dispaly.

The connections between the different devices and the Arduino board are very simple.

The DS3231 clock module and the 1602 LCD display (which uses the I2C conversion module), must be connected to the Arduino Nano using Pin A4 for the SDA terminal, and Pin A5 for the SCL terminal (therefore, the two modules must be connected in parallel to the two pins of the Arduino Nano).

The output Pin of the DHT22 sensor (indicated as Data Out) must be connected to Pin D5 on the Arduino Nano.

The GND and Vcc terminals of the DHT22 sensor, of the DS3231 module and of the I2C bus of the LCD display, must be connected, respectively, to Pin GND and Pin + 5 of the Arduino Nano.

The 5V power supply takes place through the USB socket of the Arduino Nano.

Libraries used in the sketch attached are:

Wire.h

RTClib.h

DST_RTC.h

DHT.h

LiquidCrystal_I2C.h.

Before uploading the sketch on Arduino, it is necesary to edit two lines.

It is necessary to uncomment one of the two lines 23 or 24, depending on whether you are in Europe or in the USA. This is required for automatic transition to and from DST.

Also, you need to edit line 62 <rtc.adjust(DateTime(2023, 4, 11, 11, 56, 30));>.

Uncomment it to insert the current year, month, day, time, minutes and seconds. You have to enter the standard time (even if you are in the DST period!).

Once the two changes have been made, load the sketch. After that, comment out again line 62 and load the sketch again.

Done.

I thank those who want to suggest changes or improvements to the project.