Introduction: 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

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!

For the transmitter:

  1. 1pc An Arduino UNO/Nano 5V (Ebay EUR 3.10)
  2. 1set RF 433MHz module (Ebay EUR 0.71)
  3. 1pc I2C Si7021 temp/humidity sensor or whichever sensor you like to use.Just replace the Si7021 library with the needed library for your sensor and adjust the code accordingly (Ebay EUR 2.31)
  4. 1pc 18650 battery, the largest capacity you can afford (Ebay EUR 1.85)
  5. 1pc Plastic Battery Case Holder Storage Box for 18650 Batteries (Ebay EUR 0.71)
  6. 1pc 5V MICRO USB 1A Lithium Battery Charging + Protection Board Module to charge the battery. If you have a 18650 battery charger you can skip this item (Ebay EUR 0.71)
  7. 1pc 3V to 5V 1A Charger DC-DC Converter Step Up Boost Module to supply power to the Arduino from the battery (Ebay EUR 0.99)
  8. 1pc 400 point breadboard (Ebay Euro0.71) or 1pc single sided 5 x 7 cm DIY Prototype PCB (Ebay Euro1.21)
  9. One case to fit all inside

For the receiver:

  1. 1pc An Arduino UNO/Nano 5V (Ebay EUR 3.10)
  2. 1pc Si7021 temp/humidity sensor or whichever sensor you like to use.Just replace the Si7021 library with the needed library for your sensor and adjust the code accordingly (Ebay EUR 2.31)
  3. 1pc 20x4 I2C LCD with your favorite backlight colour (Ebay EUR 4.50) - Caution: Keep a note of the LCD's I2C address you 'll buy, it should be stated by the seller!!
  4. 1pc DS3231 RTC Real Time Clock I2C module with LIR2032 Rechargeable Battery (Ebay EUR 0.71)
  5. 1pc 100K Ohm Linear Potentiometer for brightness adjustment
  6. 1pc tactile push button for the menu select button (Ebay EUR 0.71)
  7. 1pc 10k Ohm resistor (for the menu select button)
  8. 1pc 400 point breadboard (Ebay Euro0.71) or 1pc single sided 5 x 7 cm DIY Prototype PCB (Ebay Euro1.21)
  9. 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 Si7021 sensor uses the I2C communication protocol, its connections are:

VCC -> 5V

GND -> GND

SCL -> SCL

SDA -> SDA

Pretty simple!

The RF 433MHz module is connected like this:

VCC -> 5V

GNC -> GND

Data -> Arduino Digital pin 12

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:

18650 battery -> 3V to 5V DC-DC Converter Step Up Boost Module -> Arduino.

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

The Si7021 sensor uses the I2C communication protocol, its connections are:

VCC -> 5V

GND -> GND

SCL -> SCL

SDA -> SDA

The RF 433MHz module is connected like this:

VCC -> 5V

GNC -> GND

Data -> Arduino Digital pin 11

The RealTimeClock module is also I2C and these are its connections:

VCC -> 5V
GND -> GND

SCL -> SCL

SDA -> SDA

These are the 20 x 4 I2C LCD connections:

VCC -> 5V
GND -> GND

SCL -> SCL

SDA -> SDA

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:

temp_float = temp_float * 100; // Multiply by 100 for 2 decimal point precision
int b = int(temp_float);

int temperature = round(b); // Round float number to nearest integer

Adafruit Si7021 library

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:

for(int i=0;i<30;i++) // sleep for 4 minutes (30 x 8s = 240s)
{ LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); }

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.

Step 6: To Sum Up...

I hope you find the instuctions useful, it's an easy project for someone starting up Arduino programming like me. Let me know if you make one!

Arduino Contest 2016

Participated in the
Arduino Contest 2016