Bedside 20x4 LCD / RF 433MHz Clock & Weather Monitor With Arduino

How many times did you got out of the house in the morning only to find out that you are too lightly/heavily dressed for the day? Want to make a clock that on top of the time also reads the room's and outside temperature and humidity? Moreover, we will add 3 menu screens to our LCD and display the day's minimum and maximum values of temperature and humidity for our room and the outside environment.

It's easy! The complete setup includes two devices:

* The device that will be reading and displaying on a 20X4 I2C LCD the room's and outside temperature and humidity, time and date

* The device that will sit outside and transmitt outside temperature and humidity via a 433MHz RF module

Teacher Notes

Teachers! Did you use this instructable in your classroom? Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Bill of Materials

The parts we will need are cheap and easily found in the usual online or physical electronics shops. My proposals are based on lowest price only, you can always choose your own vendor!

1pc 220v/1A USB wall charger (Ebay EUR 1.18) and the appropriate USB cable that fits your Arduino (usually micro or mini). This is for EU residents, use the appropriate charger socket for your country (110V or 220V etc)

Step 2: The Transmitter

The transmitter's sole role is to sit outside, take readings for temperature and humidity and send them to the receiver.

We will use a Si7021 sensor to take the readings and send them through a RF 433MHz module to the clock sitting inside. The RF module will need a 17.32 cm antenna soldered in order to increase the range of the module. Please choose a waterproof case and make a hole on top for the antenna. Seal the hole with some silicone to prevent water leakage and add some holes in the bottom to help the sensor take more accurate readings.

The circuit diagram for the transmitter is shown below. You can use either a small breadboard to connect everything together or make a custom PCB to save some space.

The transmitter is powered by the 18650 battery. The battery is 3.7V and Arduino needs 5V at Vin so we will use the DC-DC step up converter between the battery and Arduino Vin. The connection goes like this:

Connect the + red wire of the battery case to IN+ and the - black wire of the battery case to IN- of the DC-DC converter. Next, connect OUT+ of the DC-DC converter to Vin of the Arduino and OUT- to GND of the arduino. Make sure you have charged the battery first! Once you connect it, the Arduino LED will start blinking showing that our Arduino is now ON.

Please check STEP 4 for an explanation of the transmitter's code.

Step 3: The Receiver

The receiver monitors inside temperature and humidity, receives outside measurements through the RF 433MHz module and displays them together with time and date on the LCD.

Again, we will use a Si7021 sensor and the RF receiver module which will also need a 17cm antenna. The circuit diagram for the receiver is shown below. Here as well, you can use either a small breadboard to connect everything together or make a custom PCB.

The tactile push button is used to select the LCD menu. A 10k Ohm resistor goes between GND pin of the button and Arduino GND.

VCC -> 5V

GND -> 10k resistor -> GND

OUTPUT -> Arduino Digital pin 5

A 100k Ohm is used to adust the LCD brightness. You can see how it is attached to the LCD pins in the photos

So, what we will do is make a common SCL line and a common SDA line and connect Si7021, RTC and LCD SCL and SDA connections to the common lines respectively. This is the beauty of the I2C protocol, you can connect as many modules as your arduino processor can handle in just two pins. If your Arduino UNO/Nano doesn t have separate SCL and SDA pins, then use analog pin A4 to connect SDA and analog pin A5 for SCL.

The receiver is powered by a 220V/1A wall socket adaptor, you can use a spare mobile phone charger for example as long as the USB cable is compatible to your Arduino's USB adaptor.

20 x 4 I2C LCD

We use a 20 x 4 I2C LCD display for our project. On top of its connections it has two additional adjustments, contrast and brightness. Contrast is adjust by turning the rotary knob on the back of the LCD with a flat head screwdriver as shown in the photo. For brightness we will use a 100k rotary potentiometer. These particular displays are pretty bright so you will want to turn it down a bit if you have it by your bed at night. Please see the attached photo and diagram for the connection of the potentiometer.

Please check STEP 5 for an explanation of the receiver's code.

Step 4: Transmitter Code

You can download the transmitter code below. You will need to install three additional libraries on top of the standard libraries already installed in Arduino IDE.

VirtualWire library:

This is needed for the RF 433MHz communication. It is not the latest library for these modules but it is easy to use. You can download it here or -the easy way- through Arduino IDE Sketch > Include library > Manage libraries. Search for virtualwire and install it directly.

The particular library allows messages up to 27bytes to be send in one packet. However, it does not allow for float numbers to be sent and we need this since our SI7021 sensor reads float numbers. We don t want integer accuracy to our temperature and humidity measurement, do we?! So, we will use a little trick which is to multiply the float measurement by 100, send it as an integer and then divide the x100 interger by 100 in the receiver side to have a float number with 2 decimal number accuracy to display on our LCD. This is the part of the code that does the conversion:

You can download the library needed for the Si7021 sensor here, follow the instructions in this page.

LowPower library

In order to increase the transmitter's battery life, we will use the LowPower library. You can download it here. Click on Clone or Download > Download ZIP and add the library to Arduino IDE by following Sketch > Include library > Add ZIP. Library..., browse for the zip file you just downloaded.

Since LowPower only supports up to 8s of sleep time, we will use a loop to increase this time to 4 minutes. This way we will conserve the battery and have a reading of temp and humidity every 4 minutes which is more than adequate:

Attachments

Step 5: Receiver Code

You can download the receiver code below. On top of VirtualWire and Si7021 library we installed for the transmitter we will also need to install 2 additional libraries in Arduino IDE.

LiquidCrystal I2C

This is needed for the LCD display. You can download it here or through Arduino IDE Sketch > Include library > Manage libraries. Search for LiquidCrystal I2C by Frank de Bradander and install it directly.

RTClib

Used by the RealTimeClock module. Download it through Arduino IDE Sketch > Include library > Manage libraries and search for RTClib by Adafruit.

CNC Contest

Make it Move

Teacher Contest

13 Discussions

Thank you so much for responding; I am sure there is no problems with your code, as I said I think it is a great project and will persevere. When I run the example sketch from Si7021 it functions correctly but when I run it from the Adafruit Si7021 example it gives correct humidity reading but temperature 128.87 degs. C. the same as when I run your code. I tried to eliminate the Adafruit library but it will not compile. You do need to respond to this message, I would just like to say thanks again and when it runs I will let you know. Best regards. John.

Hi again! I have a strange behavior on my version...After I power on the receiver or reset it by pressing the reset button, the receiver refreshes the outside values for two-three times and after that never updates them. I have disabled in the transmitter program the section of power down in order to send continuously new outside values. Clock and inside values work fine. Any ideas?

well my mistake!!! the strange behavior was caused by wrong connection: receiver data was connected on pin 12 instead of pin 11!! The strange here is that despite the wrong connection the arduino - receiver sometimes was getting data!!!

Some future improvements:

a) If receiver does not get data, just show "---" on display to indicate lost connection and maybe low battery

b) The decimal values on receiver could be more "stable" not changing on every cycle (every second)

Γεια σου Ropotis! Maybe by increasing the "low power" time it will last longer.....I will use rechargeable AA batteries so not to move the device inside the house to charge it! I added wire antennas and the RF distance now is ok!

You did an amazing job! really liked the push button option. I completed it but unfortunately my temperature readings were consistently 128 inside and out, with a reading of 119 for humidity inside but a correct humidity reading outside. Checked wiring etc. both sensors worked correctly on test program, any suggestions? Thank you for the excellent tutorial and great details.

Hello John and sorry for the late reply. That is quite strange, you suggest that both sensors run ok when loaded with the library's example code but not when running the project's code and with the same wiring? I d do these things: check wiring and contacts first, load library's example code and see the serial output without changing the wiring. Be sure that you use the code I uploaded, as it is tested and it should work. I am sorry I can t help you more