Introduction: Mini Weather Station

In this project, we will be making a mini weather station that measures temperature and humidity and transmits them wirelessly to a ground station, which displays the readings on an LCD display!

It’s a fairly easy project and can be used either on its own or part of something bigger.

Step 1: List of Materials

For this project, we will be using:

- RF 433 transmitter/receiver module cost: ~2.00 USD

- DHT11 Humidity and temperature sensor cost: ~5.00 USD

- Two Arduino boards

- 16x2 LCD display HD44780 equivalent cost: ~2.00 USD

- 10k linear potentiometer cost: ~1.00 USD

- Jumper wires

- Two breadboards

About the RX433.

This module can make an open air connection up to 500m, depending on the voltage you power it with (operating voltage range: 3.5-12V) and the length of the antenna you provide. Here, 5V are used from the Arduino board to power the RF433. For an antenna, you can solder a simple single-strand wire, like the one you see on the various pictures, which is about 17.2cm long. Depending on the frequency of your model, you should find out the appropriate length for the antenna.

You can calculate it on a website like this: http://www.qsl.net /kd4sai/antencal.html. But if you use a 433MHz transmitter, 17.2cm is the correct antenna length.

Step 2: Hardware Connections

In general, the connections are very simple. Follow the instructions and images above, and you should have no problems.

Transmitter Side:


Connecting DHT11

Connect:

- the VCC pin on Arduino’s 5V output

- the GND pin to Arduino’s GND and

- the DATA pin to Arduino’s digital pin 4

Connecting RF433 transmitter

Connect:

- the VCC pin on Arduino’s 5V output

- the GND pin to Arduino’s GND and

- the DATA pin to Arduino’s digital pin 12

Receiver Side:

Connecting RF433 receiver

Connect:

- the VCC pin to 5V on Arduino

- the GND pin to Arduino’s GND and

- the DATA pin to Arduino’s digital pin 11

Note: one of the pins will not be connected anywhere.

Connecting the LCD display

To properly connect the LCD display, you will need to connect the following:

- LCD VCC pin to 5V pin

- LCD GND pin to GND pin

- LCD RS pin to digital pin 7

- LCD Enable pin to digital pin 6

- LCD D4 pin to digital pin 5

- LCD D5 pin to digital pin 4

- LCD D6 pin to digital pin 3

- LCD D7 pin to digital pin 2

Connecting the potentiometer

Connect:

- one of the outer pins to Arduino’s 5V output

- the opposite outer pin to Arduino’s GND and

- the middle pin to LCD’s VO

The potentiometer is used to control the LCD’s contrast, so you should fiddle with the pot a bit, when powered up, to find that sweet spot!

Once you have connected everything, it should look something like in the image.

Step 3: Arduino Programming

We will be using codebender to program our Arduinos. It’s really easy and effortless to make it work. Also, all the necessary libraries are already provided to include in our code straight away, so you will not have to search and download them.

Three libraries have been used and their links are in the resources section, at the end of this Instructable if you need them.

Here is the code for your transmitter Arduino:

To program your arduinos via the embedded link above, you must install the appropriate plugin to your browser, as indicated in the message at the bottom right of the code window. Make sure to choose the correct board and COM port!
And the code for your receiver Arduino:

You can clone and edit the code in any way you prefer.

Step 4: Enjoy Your Mini Weather Station!

After making sure that everything works smoothly, you can take the project from the breadboard and onto a PCB! Power through batteries or a plug and you’re good to go!

Resources:
Libraries’ links:

DHT11 library

Easy Transfer Virtual Wire library

Liquid Crystal library

Comments

author

If you put one of these 433MHz Helical antennas on your receiver you'll get improved reception. I just bought some of they seem to make an improvement. Continue to use a straight 17CM wire for the transmitter.

433MHz Helical antenna Ebay search link

author
darkcook made it! (author)2015-09-11

I'm reading the "inside temp" with a bmp180 sensor, and I can see the temperature with two decimals, but in the "outside temp" (Ext.) I only have the temperature with no decimals.

I don't know if this is a limitation of the library... :(

Manu.

IMG_20150911_192305.jpg
author

Darkcook you should write an Instructable on how you added the bmp180. Start the article from scratch covering what indigod0g wrote and then add your modifications. It would great. VEL

author

Volthaus,

I'm modifying the code because I want to add more nodes and sensors. Also I want to use a LCD Display, it's a big project for me and I home finishing soon.

author
indigod0g (author)darkcook2015-09-22

Hi Manu,

I'm really glad you liked it. I'm not really sure about the decimals though...

Your setup looks killer!

Jim

author
darkcook (author)indigod0g2015-10-02

Hi Indigod0g,

I'm using a DHT22 sensor in the emitter, that can measure temperature and humidity with two decimals, as you can see it in the serial monitor.

**********************
temperature: 24.40
Humidity: 39.20
**********************
but the emitter only sends the entire part of the data, in this case:

**********************
temperature: 24
Humidity: 39
**********************

I think that is not the same 34.99 ºC than 34.00ºC. Because this, I'm searching how I can send all the value, (24.40 & 39.20).
Unfortunately, I'm not a programmer, so this is a hard work for me, but this doesn't matter me... I have google and (I hope) the help of the comunity. :)

I have added a BMP180 sensor for the interior temperature and I have changed the screen with a Blue LCD. Now I'm trying to add a RTC...

Thanks again for your great work.

author
indigod0g (author)darkcook2015-10-20

Hey, I just noticed and have not tried it, but try making the temp and humi variables to float type in the receiver, maybe that is why they appear as integers in the screen.

Hope this solves it for you

author
ana y richard (author)darkcook2015-10-17

hola amigo me puedes pasar el codigo heee gracias


author
gheciobanu (author)2015-05-31

would this work with a DHT22, for more acurate data?

author
alini (author)gheciobanu2015-06-15

Yes, you can use a DHT22 sensor with some minor code modifications. Instead of the DHT11 library I am using Adafruit's DHT-sensor-library (https://github.com/adafruit/DHT-sensor-library) which allows you to easily swap between the DHT11 and DHT22 sensors.

I can provide the code but need to find a convenient way to post it. I am new to this posting online stuff :)

Andre

author
alini (author)alini2015-06-15

here's the code:

https://codebender.cc/sketch:124330

let me know if it works with your setup.

author

alini I loaded your code into my transmitter and switched out the DHT11 with a 22 and it worked perfectly. Thanks.

author
indigod0g (author)gheciobanu2015-06-02

I have not tried using a DHT22 on this project, but it should. Please take a look here for the use of libraries for the DHT series.

author
michael.a.wiseman1 (author)2016-02-23

I had the project working, "Everything was working" then I noticed that the degrees were in Celsius, so I thought I would change the degrees to Fahrenheit, well when I did that, I did not get any readings, so I changed the code back to Celsius, well that did not change anything back to where it was and I still got no readings, just a blacken in squares on the display of the LCD. I felt stupid and wondering why I did it in the first place and it was curiosity of course.

Even changing out the DHT11 did not change anything, so now I am not sure what it could be?

author

I know it's been 7 months since your post but I was wondering if you tried adjusting the LCD contrast?

author
jcasteal made it! (author)2016-08-21

Thanks a lot indigod0g for your project. I've some problems with my weather station, I only receive something like that (see attached image). Any Idea? thanks in advance.

Captura de pantalla de 2016-08-21 12:52:14.png
author
michael.a.wiseman1 (author)2016-02-15

I have a problem with my project. I entered the codes into the boards and there is no reading on the LCD display ( Temp: 0C and Humi: 0% ).

Temp in the room is 72 degrees.

I also remember you telling me that once I have entered the codes into the boards that the project could power itself without being plugged in and that is not happening as well, it seems like it needs to be plugged in to my laptop.

20160215_161846.jpg
author

I was wondering if there is anything that needs to changed with any of both codes for either of the arduino boards?

author

Hi,

from what I can tell in the photo, you have connected the DHT11 on digital pin 11, this should be on digital pin 4.

I really am sorry for this, as I have not corrected the Fritzing file to match the instructions, please connect the wiring according to the text, the photos and the code, NOT the fritzing sketch.

[this is noted, I will correct them ASAP, I'm just swamped right now)

Please do the following:


- double check your wiring, as some cables are hard to see in the photo, again: connect the wiring according to the text, the photos and the code, NOT the fritzing sketch.

- first on the transmitter arduino: see what data come to your serial monitor via the serial port. See that the DHT11 does give you readings. If not, check it's wiring.

- then on the receiver arduino: see what data the serial monitor shows on this side. If the data are 0, check both the RF433 wiring and make sure your antenna is the correct length.

Lastly, I thought that by saying "stay plugged in" you meant on the computer in order for the code to run. The boards MUST be plugged in some kind of power source to work, either that is a USB or a power adapter (see the arduino page for the board you are using to see what voltage input it can take).

I hope this helps, please feel free to ask anything you might have a problem with, just have in mind that for the next week or so, I will have no easy internet access, but I will get back to you as soon as I can!

author
payasonegro (author)2016-02-16

Can I change Arduinos UNO for ATTiny85 or Nano without modify nothing? (Sorry I am new in that)

author
michael.a.wiseman1 (author)2016-02-04

Do both Arduino boards have to stay plugged in, as shown in some of the pictures, after putting in the programming? Or can the project run on its own once you have put the programs into the boards?

author

Hi!

Once you've flashed (programmed) the boards, the code stays in the microcontroller. So you can unplug it and power it up whenever you need. That causes the code to restart as if you just uploaded it!

Hope it helps

author
michael.a.wiseman1 (author)2016-01-10

I heard something that the LCD might need some sort of shield, I have no idea what is meant by this, but if there is some sort of shield that has to be included and it deals with the LCD screen, I would be interested to know, since I am building this circuit/project for my project at school?

author

Hi there, sorry for the delayed answer!

Was it for this particular display? Or an other one?

There are LCD displays that come as a shield for the arduino, but this one, as well as other similar models do not. As you can see, my project is running with the display not as a shield. So, you will be fine using it like this.

Hope this helps! Good luck with your project :)

author

You did answer my question. Thank you for your assistance.

author
IsraelD3 (author)2015-10-16

How should the receiving antenna, number of turns, length and material having a large distance to the transmitter?

author
indigod0g (author)IsraelD32015-10-20

Hi, I guess you are trying to make the communication distance bigger?
Try reading from these links:
http://forum.arduino.cc/index.php?topic=216467.0
http://electronics.stackexchange.com/questions/103...

Unfortunately, I'm not an expert on this topic :(

Hope it helps!

author
ana y richard (author)2015-09-25

hola

author
indigod0g (author)ana y richard2015-10-02

hola!

I know no spanish, and I see an answer is here already, but you can also find the library here:

https://github.com/adafruit/DHT-sensor-library

http://playground.arduino.cc/Main/DHTLib

author
darkcook (author)ana y richard2015-10-02

Hola ana y richard,

Está puesto un poco más abajo por Alini, este es el enlace.

https://codebender.cc/sketch:124330#weatherStationTransmitter_allDHT.ino

author
ana y richard (author)2015-09-25

hola amigo me puede pasar el codigo con dht22 gracias

author
Volthaus Electronics Laboratory made it! (author)2015-07-31

Your Instructable is a really well done piece of work. Thank you for taking the time to put this together for the community!

I noticed your tutorial is calling for connecting both the RF433
receiver's data pin and the LCD's Enable pin to digital pin 11 and the
LCD RS pin to digital pin 12. It should be LCD Enable pin to Arduino digital pin 6 and the LCD RS pin to Arduino digital pin 7.
In the picture of my transmitting station you can see I have setup a boost converter so I can run the Arduino with a 18650 3.7v Li-Ion battery and then I added a Li-Ion battery charging module that gets its power from a 5v solar panel to keep the 18650 charged. When it comes time to put it all into a case I will build a barebones Arduino with no LED to to run the TX. And I hope to add a BMP180 to measure air pressure. Also slow the update time to the RX station to once a minute and use the LowPower library so the Arduino can sleep between updates. Check out deba168's Instructable for more info: https://www.instructables.com/id/SOLAR-POWERED-ARDUINO-WEATHER-STATION/

11754378_961820810506942_1213059245783587220_o.jpg11754378_961820803840276_2869414952674276576_o.jpgTX_station.jpg
author

Hi,

thank you for noticing the pins, I corrected them.

Sorry for any inconvenience.

author

Sure thing indigod0g. Your Instructable is a very fine piece of work and I know writing all that can be confusing. Please keep up the good work my friend.

VEL

author
jhunmar100 made it! (author)2015-09-15

Edit and modified a bit of the code with added RTC and it works!

Thank you for this post, this one is a good practice

IMG_9407.JPG
author
indigod0g (author)jhunmar1002015-09-22

Looks great! Loving the graphics on the LCD :)

author
darkcook (author)2015-09-11

A very nice Instructable,
I have built this, but with Alini's modifications (thanks Alini) because of I'm using a DHT22 sensor.

I see that the receiver only shown the temperature in entire numbers, without decimals.
Do you think that is possible to send these decimals from emiter to receiver.

Thanks a lot for your good Work

Regards.

Manu.

author
darkcook (author)2015-09-11

author
VojtěchM1 (author)2015-05-24

Hi, I think there is some discrepancy in transmitter code. First you are writing that DHT is connected to pin 11 and transmitter to pin 4, but then in the code you have DHT on pin 4. Where is the transmitter pit defined in the code?

author
indigod0g (author)VojtěchM12015-05-24

Hi,

thanks for pointing that out, it was a typo and was been corrected.

The transmitter pin is predefined in the VirtualWire library.

author
alini (author)indigod0g2015-06-13

There are a number of typos in the instructions that made it pretty hard to get this to work (at least for a beginner like me).

Data Pin for DHT11 goes to digital 4 not 11

Data Pin for RF433 transmitter goes to digital 12 not 4

Data Pin for RF 433 receiver goes to digital 11 not 12

Backlight of LCD display needs to be powered: pin 15 to 5V and pin 16 to GND

Also, the Fritzing diagram for the transmitter is not correct.

All in all still a great project and an excellent learning experience!!!

author
indigod0g (author)alini2015-06-15

Hi alini,

I'm glad you like the project and thank you for your comment!

In the written instructions,

data pin for the DHT11 goes to the digital pin 4,

the data pin for the RF433 transmitter goes to the digital pin 12 and

the Data pin for the RF433 receiver goes to digital pin 11,

all as you say they should be.

Maybe I miss something in your comment? Please do tell me if that is the case.

For the Fritzing diagram, I see the DHT11 on pin 11, should be 4, which is unfortunate and will be corrected ASAP. But the transmitter is on pin 12, like on the photo and the typed instructions.

In order for the backlight to work, you need to connect the pins as you said.

Jim

author
alini (author)indigod0g2015-06-15

Hi Jim,

it looks like I was using an older version of the instructable that I printed out before your recent revisions (I like to scribble on the instructions). I better be more careful next time!

Andre

author
samuel123abc (author)2015-05-24

Hello,

First of all, thank you for creating this intractable, it is really nicely done. Ten to the second little "thing" or problem. Where do I download the Easy Transfer library? The download link in step 4 gets me to a code blender site and whee do I download it from there? Thanks a lot for your help,

Samuel

author
indigod0g (author)samuel123abc2015-05-24

Hello and thank you for your interest.

You can download the library here. It will also download some other libraries that are in that repository, use what you need :) The library in codebender can de used when you program your project through the site.

I hope this helps. Feel free to ask anything else you might need.

Jim

author
diy_bloke (author)2015-05-23

Well done.
But if you feel like an Arduino might be a bit of overkill for just temperature and humidity, An Attiny85 can handle a DHT11 and transmitter as well as a receiver and LCD.
nevertheless, well done

author
indigod0g (author)diy_bloke2015-05-24

Thank you!

You are right. Each may customize this and use whatever he pleases. I used what was in my arsenal at the time :)

author
diy_bloke (author)indigod0g2015-05-24

Please do not take it as criticism, it wasn't meant that way. In the end, an Arduino, especially as base station will give you a lot of options on how you present the data

author
diy_bloke (author)diy_bloke2015-05-24

and if i may add... a bare attiny will cost around a dollar: a complete arduino pro mini can be found for say 1.80 USD if you buy a couple, so price wize it isnt that much of a savings (unless you use a lot of them), I just have this anal retentive character trait that I don't want to 'underuse' a chip :-)

author
Ploopy (author)2015-05-23

Cool!