Introduction: Wireless Indoor & Outdoor Thermometer
I would like to introduce you to one of my interesting projects. It is a wireless thermometer that measures the indoor and outdoor temperature. The device consists of two parts. One is a transmitter that contains one digital temperature sensor and a transmitter module. A second receiver consisting of an LCD screen, the digital sensor and receiving module.
Step 1: Parts
You need:
1. Two arduinos any version
2. Two DS18B20 digital temperature sensor
4. LCD 16x2
5: RF 433MHz or 315 MHz module
Step 2: Transmitter
Transmitter is very simple. Connect the wires as shown in pictures.
Here is transmitter code:
#include <VirtualWire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
char msg[6];
void setup() {
sensors.begin();
vw_setup(2000);
vw_set_tx_pin(3);
}
void loop() {
sensors.requestTemperatures();
float temperature = sensors.getTempCByIndex(0);
dtostrf(temperature, 6, 2, msg);
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx();
delay(200);
}
Step 3: Receiver
Receiver is a little more complicated than the transmitter. Connect the wires as shown in pictures.
Here is the code for receiver:
//www.facebook.com/njizi.dvizi
#include <LiquidCrystal.h>
#include <VirtualWire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
int i;
LiquidCrystal lcd(12, 10, 5, 4, 3, 2);
#define ONE_WIRE_BUS 7
OneWire ourWire(ONE_WIRE_BUS);
DallasTemperature sensors(&ourWire);
void setup(){
lcd.begin(16, 2);
sensors.begin();
vw_setup(2000);
vw_rx_start();
vw_set_rx_pin(11);
}
void loop(){
sensors.requestTemperatures();
lcd.setCursor(0, 1);
lcd.print("Indoor:");
lcd.setCursor(14, 1);
lcd.print(sensors.getTempCByIndex(0));
lcd.setCursor(9, 1);
lcd.print((char)223);
lcd.print("C");
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if( vw_get_message(buf, &buflen) )
{
lcd.setCursor(0, 0);
lcd.print("Outdoor:");
for (i = 0; i < buflen; i++)
{
lcd.write(buf[i]);
}
lcd.setCursor(14, 0);
lcd.print((char)223);
lcd.print("C");
}
}
Step 4: Library
For this project you need three types of libraries. Two for digital sensor and the other for RF module. In the link below have all the files needed for this project.
42 Comments
10 months ago
Can I resurrect this thread? Can you help me use a BME 280 sensor outdoors instead of the sensor that you used?
Question 1 year ago
how does the transmitter portion get power? does it need a usb cable continuously connected? If so, then how can you call it "wireless"?
2 years ago on Step 4
I have a problem that the message does not appear on the LCD, when I use infrared
can you please tell my
Question 4 years ago on Step 4
Would have been nice to see the pinout of the LCD. Seems to me that the 4th wire from the left depicted as black would be the RS lead and would connect to arduino pin 12 - not ground and the fifth lead - depicted as orange - would be RW - should go to ground not pin 12. With that change I get the indoor temp displayed on the LCD but no outdoor temp. Still working on it but - seems to me someone should have notice that after all these years and said something. Wonder what else is wrong with it ?
8 years ago on Introduction
if you use dht 11 or dht 22 i have code for you :)
Reply 6 years ago
hello,
can you please send me the code for dht22?
Thanks
Reply 8 years ago
I'd be interested in this code
7 years ago
Please help me, how to replace in your script Liquid Crystal library to OLedI2C library?
-------------------------------------------------------
#include <OneWire.h>
#include <DallasTemperature.h>
#include "Wire.h"
#include "OLedI2C.h"
#define ONE_WIRE_BUS 7
OLedI2C LCD;
char line[5];
float val = 0;
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup()
{
Serial.begin(9600);
// Start up the library
sensors.begin();
Wire.begin();
LCD.init();
}
void loop()
{
sensors.requestTemperatures();
float val = sensors.getTempCByIndex(0) ;
LCD.sendString("Home:",2,0);// now includes the cursor position data (col, row)
dtostrf(val,4,1,line);//Convert the float value to string
LCD.sendString(line,9,0);//Send the string to the display
delay(0);
LCD.sendString("C",14,0);
}
---------------------------------------------------------
Or how to add in this script the data of RF-module ?
7 years ago
alarm 80 C led Pin 4
7 years ago
works fine
start with little trouble to connect the right wire's
8 years ago on Introduction
This are the pics of my circuit, I follow your steps, but it is not clear how you wired the LCD to the circuit.
Also, there is a confuse in the transmitter circuit, because you used two temp sensor (LM335az) on both TX and RX circuit. Can you please check my connection and tell me if I am right or not .
Show me how I connect the temp sensor and the LCD please !
8 years ago on Introduction
what is the parts on the receiver circuit that connected by the yellow wire ?
Also, How you said that you use two aurdino.
I see one on the transmitter and the nano ordain on the receiver ?
I am right or not
PLEASE HELP ME THROUGH IT
Reply 8 years ago on Introduction
part of which is connected to the yellow wire is 10K ohm potentiometer for contrast LCD.if one arduino on the receiver and if the one on the transmitter then it is a total of two
8 years ago on Introduction
Good job I need your help please on this project
8 years ago on Introduction
this is transmitter code error
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
In file included from transmitter_temp.ino:3:
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: variable or field 'vw_set_tx_pin' declared void
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: 'uint8_t' was not declared in this scope
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: variable or field 'vw_set_rx_pin' declared void
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: 'uint8_t' was not declared in this scope
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: variable or field 'vw_set_ptt_pin' declared void
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: 'uint8_t' was not declared in this scope
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: variable or field 'vw_set_ptt_inverted' declared void
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: 'uint8_t' was not declared in this scope
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: variable or field 'vw_setup' declared void
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: 'uint16_t' was not declared in this scope
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:96: error: 'uint8_t' does not name a type
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:99: error: 'uint8_t' does not name a type
C:\Users\Dunk\Documents\Arduino\libraries\VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type
transmitter_temp.ino: In function 'void setup()':
transmitter_temp:24: error: 'vw_setup' was not declared in this scope
transmitter_temp:26: error: 'vw_set_tx_pin' was not declared in this scope
transmitter_temp.ino: In function 'void loop()':
transmitter_temp:38: error: 'vw_send' was not declared in this scope
8 years ago on Introduction
code not work,witch ide do i use,this is errors.
receiver code
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Nano w/ ATmega328"
receiver_temp:3: error: 'Here' does not name a type
receiver_temp:14: error: 'LiquidCrystal' does not name a type
receiver_temp.ino: In function 'void setup()':
receiver_temp:21: error: 'lcd' was not declared in this scope
receiver_temp.ino: In function 'void loop()':
receiver_temp:30: error: 'lcd' was not declared in this scope
8 years ago on Introduction
hi ive coppy librarys etc and ime getting errors,what version of ide do i use ive tryed them all.thanks
8 years ago on Introduction
add DS1302 RTC and LCD 20x4 + serial adapter
8 years ago on Introduction
Hi, could you please post the code to use the DS18B20 for the receiver indoor temp instead of the lm35.
Many thanks
Reply 8 years ago on Introduction
Not to worry, I have figured it out :)