Wireless Indoor & Outdoor Thermometer

About: My hobby is electronics since childhood. I'm interested in Arduino, programming, drawing PCB in Eagle and solder the connections.....

Intro: 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.

Share

Recommendations

  • Tiny Home Contest

    Tiny Home Contest
  • Furniture Contest 2018

    Furniture Contest 2018
  • Audio Contest 2018

    Audio Contest 2018

38 Discussions

0
None
КарповА

1 year 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 ?

0
None
AumE

2 years ago

alarm 80 C led Pin 4

0
None
EmilK9

2 years ago

works fine

start with little trouble to connect the right wire's

0
None
Y987ousef

3 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 !

image1.JPGimage2.JPG
0
None
Y987ousef

3 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

1 reply

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

0
None
dunk8888

3 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

0
None
dunk8888

3 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

0
None
dunk8888

3 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

0
None
GarethL

3 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

5 replies

ante nije fora trebao si sam malo promozgati u tome i je stvar mogao sam ja odma ovako napraviti.to je bilo namjerno hehe :)

0
None
GarethLamaretić1

Reply 3 years ago on Introduction

//Credit to - www.facebook.com/njizi.dvizi

//added DS18b20

#include <LiquidCrystal.h>

#include <VirtualWire.h>

#include <OneWire.h>

#include <DallasTemperature.h>

#define ONE_WIRE_BUS 7

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

int i;

LiquidCrystal lcd(12, 10, 5, 4, 3, 2);

void setup(){

sensors.begin();

Serial.begin(9600);

lcd.begin(16, 2);

vw_setup(2000);

vw_rx_start();

vw_set_rx_pin(11);

}

void loop(){

lcd.setCursor(0, 1);

lcd.print("Indoor: ");

sensors.requestTemperatures();

lcd.print(sensors.getTempCByIndex(0));

lcd.setCursor(14, 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");

}

}