Introduction: Arduino Nano With DHT11, RTC DS1307 and LCD 16x2

Hi. This is my first Instructable, so I hope it will be OK.

This is my Arduino Nano project with LCD with I2C board, RTC DS1307 and DHT11 sensor.

For this project I used Arduino Nano, RTC DS1307 clock board, DHT11 sensor board, 16x2 LCD, LCD serial board (not yet soldered to LCD), one mini breadboard, bunch of wires and modified old Samsung cell phone charger (modified - soldered mini-USB on it - it has 5V and 700mA output, good enough for powering Nano and all modules).

All of this is just combination of Boian's instructables (and these are great, trust me).

Step 1: Hardware Setup

Hardware setup isn't straightforward, as RTC and LCD serial board need to be connected to Nano. As this isn't easy to connect for novice like me (and many different connection attempts haven't worked), I had to find out how to manage this. Lots of googling and solution is pretty simple: RTC SDA pin is connected to Nano A4, SCL to Nano A5, and LCD serial board SCL is connected to RTC input SCL and SDA to RTC input SDA pin (it's a pass-through). That same LCD serial board is enhanced with LED switch instead of plain jumper, so LCD works all the time, but can be dark during night (or when not needed). DHT11 sensor is connected to Nano D6 pin.

RTC and LCD power is connected with breadboard to Nano 5V pin, and RTC, LCD and DHT ground through other breadboard rail to Nano GND pin. DHT power is connected straight to Nano 3.3V pin.

NOTE: When DHT11 was connected to 5V pin, it didn't gave correct temperature output (2-3 degrees more). I guess it could be result of possible overheating the sensor with too high voltage, although it is rated 3V-5V. So that's why it's connected to 3.3V pin and it gives reasonable values (as DHT11 can be - next project will have DHT22 for temperature and humidity combo, or DS18B20 for temperature only).

Step 2: Software Setup - Visuino

Software is set up with Visuino. At this moment, the only way for me to make anything with Arduino at all... :-)

In Visuino I have changed board to Nano, and added my components: DHT sensor, RTC clock and LCD I2C. Both RTC and LCD are connected to I2C port, and DHT is connected to Digital 6.

In LCD I have set up analog fields for temperature and humidity from DHT sensor (4 chars sized with precision 1, as DHT11 sensor isn't super precise), one text field for percentage sign and one define character in which I have made degree sign. Temperature and degree sign fields are in row 0, humidity and percentage sign fields are in row 1.

There are also text fields for hours, minutes and colon sign, where fields for hours and minutes are two chars sized, and colon sign field only one. These fields are set to columns 11 (hours), 13 (colon) and 14 (minutes) and set to row 1. Data for hours and minutes are provided from Decode Date/Time component on which is RTC element connected.

The thing I haven't figured out how to make is add leading zero to hours and minutes with Visuino. But I will :-)

Step 3: Software Setup - RTC Programming

At this time everything will work, but I had problem with clock, as it was never set up before. For that I have uploaded one sketch that will set time on RTC clock as it is set in sketch, and will work correctly from that moment onward, untill RTC battery dies and whole Arduino "bomb-like" set-up loses power. That sketch is also attached (it needs editing before uploading to Arduino, otherwise you'll have my time on it). So it is good to connect everything to Arduino, insert battery to RTC module, set up TimeDateSet sketch, upload it, reboot Arduino, and then upload advanced Visuino sketch.

Step 4: Case, Finishing Etc...

This isn't encased yet, as I'll make it as see-through mirror (nice wooden frame, glass 30x40cm and fine mirror foil found on ebay). This will be also described here :-)

When the case will be made, all wires will be soldered, breadboard will be obsolete, and wires will be shorter... whole project will be more compact. At this moment is a bit loose (or messy if you like that term more) :-)

One more thing: maybe you have noticed some strange wire on back of Nano. It is result of playing with Nano and non-USB power supply. It is a temporary replacement for fried Schottky diode (temporary, as I have ordered new, and it will be replaced before encasing). Don't use unregulated power supply with your Nano, it may give you headaches like I did to myself. With this emergency workaround, Nano works just fine - but real Schottky is better.


BoianM (author)2016-04-18

Congratulations on your first Instructable! Looks great :-)

DIY Hacks and How Tos (author)2016-04-17

Fun arduino project.


Thank You! It was a bit headache to manage all that I wanted (still some features are not implemented) as Nano is pretty limited with memory... :-(