Wireless Temperature Sensor

My goal of this project was to track the temperature in different rooms in my house using multiple temperature sensors to send the data back to a raspberry pi and have the data stored historically so I could display it in charts and send alerts. As a follow up to my wireless power outlet project, I wanted to use the 433mhz receiver. I came across some wireless temperature sensors that work over 433mhz. These temperature sensors are great because they are cheap, well built, battery powered and outdoor resistant. I was surprised at how difficult it is to decode the signal coming from the temperature sensors.

After a lot of searching, I came across a great post on reverse engineering temperature sensors. The code in this article helped tremendously. I was able to get the temperature readings for the AcuRite 606TX Wireless Temperature Sensor. The next part was to store the temperature readings. I decided to use a sqlite database since it would be easy to use in php. Finally, I wrote a simple php file to read the sqlite database and display the temperature readings in a line chart.

So with everything working, I ran into a major problem that I haven’t been able to resolve. Currently, the receiver only works from at a max of 10 feet. Obviously, this will not work. I’ve tried different receivers and antennas with no success. I’m hoping someone will have a suggestion on boosting the receiver strength so it will work over 150 feet.

Updated 3/4/2018: After a suggestion to switch to a 433mhz Superheterodyne Receiver, I have been able to successfully receive the signal around 100 ft away. Thanks for everyone’s help and suggestions! I’ve updated the guide to link to the correct parts.

Hardware

Steps

  1. Connect wires to Rf receiver chip(wiring diagram). See this article for more info on gpio pins.
  2. Install Rasbian on Raspberry Pi
  3. Install Wiring Pi
  4. Install Apache and PHP on the Raspberry Pi
  5. Install php sqlite3: sudo apt-get install php5-sqlite
  6. Clone web files
    1. Install git: sudo apt-get install git
    2. Then type: sudo git clone https://github.com/timleland/temperaturesensor.git /var/www/html/temperaturesensor
  7. You should now be able to capture the temperature readings from the command line.
    1. Change to the directory: cd /var/www/html/temperaturesensor
    2. Then type: sudo ./capture
  8. Browse to Raspberry Pi ip address: http://<your-pi-ip>/temperaturesensor/ 
  9. You should see a graph with the temperature readings

Notes

  • AcuRite 606TX sends updates every 30 seconds
  • Gpio 21/27 is wiringPi pin 2.  To use a different pin, edit this line.
  • Command to compile capture.cpp: sudo c++ -std=c++0x capture.cpp -o capture -lwiringPi -lsqlite3

Let me know if you have any questions in the comments below.


Also published on Medium.

43 thoughts to “Wireless Temperature Sensor”

  1. This will prob sound silly but Bluetooth ? I am looking for a hygrometer and temperature sensor for my Steak Ager . There is a sensorpush that sends Indic to your phone out there but it’s wildly inaccurate at times . You must use a special swing device to reset the hygrometer for moisture readings to be accurately read . I would pay more if I could find one that wasn’t so buggy even if the components were costly enough to spare me having to buy endless batteries because they won’t keep a charge . They also use them for Vinotemp and cigar humidors . I just want to be able or keep an eye on things even when I am out of town but could have a next door neighbor check things if the humidity or temps started to rise . And having a system I can count on as aging meats if you get some Primal cuts can be very pricy
    Anyway hope it all goes well and keep up the search !

    1. Acurite also makes a temp/humidity sensor that looks identical to the one used in this example. It’s model 06002M.

      I use this library here: https://github.com/merbanan/rtl_433 which has the ability to decode a plethora of 433 mHz sensors including electronic car keys, weather sensors, TPMS tire sensors, etc.

  2. I love this idea. i am wanting to the same, but im currently trying it with $15 zigbee devices and a smartthings device. Only does temperature though. Id really like something that does temp and humidity. Following this article to track your success.

  3. visonic mct-340 E. As mentioned, it only does temperature though. Zigbee is so sensitive to 2.4ghz wifi it seems though. I couldnt even more it without moving the samsung smarthings hub away from my access point by about 10 feet.

  4. All hooked up but not working. I am unclear about the pinouts: What is GPIO 21/27? I am currently using pin #13 which is GPIO 27 to receive rf signals from our remote outlets. The capture.cpp code indicates that DATA_PIN = 2. How does that relate to the GPIO pinouts? Pin #2 is actually 5V and not a gpio data pin. I would very much like to get this working. What am I doing wrong. Thx.

  5. All hooked up but not working. I am unclear about the pinouts: What is GPIO 21/27? I am currently using pin #13 which is GPIO 27 to receive rf signals from our remote outlets. The capture.cpp code indicates that DATA_PIN = 2. How does that relate to the GPIO pinouts? Pin #2 is actually 5V and not a gpio data pin. I would very much like to get this working. What am I doing wrong. Thx.

    Actually I found the answer:
    https://projects.drogon.net/raspberry-pi/wiringpi/pins/
    Accordingly, I am wired correctly. However, the problem is that the receiver is not receiving rf data from my acurite remote. The weather station does, and the Raspberry Pi does receive signals from our Tekecity remote outlets. I would appreciate any help you are able to offer. Thx.

      1. I have a Raspberry Pi 2 model B and the Acurite sensor is from the 75077 Wireless Weather station. As soon as it get a little warmer I will go outside and find out what the model number is.

          1. Got it. The transmitter is model #00592TX. Is the problem w/ the transmitter or the distance from it. Both the Raspberry Pi and Weather station are approx the same distance from the transmitter. However the Raspberry Pi may have a weaker receiver. Not sure. I plan to bring the transmitter into the house to see if that helps, unless you tell me that it is the wrong model.

          2. I’ve had issues with the range currently mine will only work from about 10ft. Trying to come up with a solution to increase the range.

  6. What about the range extender? 10ft is hardly acceptable. I have ordered a different antenna for my Raspberry Pi receiver. Hope it works. I will let you know when I get and install it.

      1. Not compatible w/ mine: 00592TX. Would be too expensive. However, pls let me know if you try it and how it works. Thx, and for now I will look for alternative solutions.

  7. Great project. I have a similar project in mind but am having problems with the 433 temperature sensor that I have. My range issues with a previous 433 doorbell system were solved when I got a Super-heterodyne OOK Wireless Receiver

    The range went from about 1m to 50m and through several solid walls. Hope that helps.

          1. Not currently using an antenna no. It has an antenna out pin, but it works for my required range without. I use it to sniff a doorbell across rooms and a separate floor.

          1. Glad it helped you. I’ve started playing around with rtl_433 and a DVB usb stick now, which solved my temperature sensor problem. Just need to get my pi working with web sockets now.

  8. I have not assembled everything yet ( waiting for the RXB6 to arrive ) but is it possible to capture more than one transmitter? I have a couple of these transmitters and receivers.

  9. Is there an easy way to monitor GPIO 21/27 to see if I am actually seeing any data come in?? All I get when I start capture and view the page is some queries, but no real data.

      1. No nothing shows up. I ended up having to use php 7, would that cause a problem? I have been through the wiring several times now. Wonder if I got a bad wireless module.

  10. php5-sqlite no longer available! ARGH!
    Hi
    Brilliant tutorial, it seems php5-sqlite has been retired and you can no longer install it (due to stretch).
    How do I go about installing a different sql server?
    Cheers

    1. Hmm most likely a new version exist. Any luck finding another option? May have to change the code to work with the new versions.

  11. Is it possible to have multiple sensors on the one receiver? I’m looking at monitoring a fridge and freezer, ambient and possibly external temperatures.

  12. Tim,

    I am looking at purchasing the AcuRite 06002M Wireless Temperature and Humidity Sensor (https://www.amazon.com/AcuRite-06002M-Wireless-Temperature-Humidity/dp/B00T0K8NXC/). It looks like it uses the same frequency, but I don’t know about the format of the data that it sends. Do you know if I would have to modify your code just to get the temperature? Also, would there be a way that I could collect and log the humidity information? Thanks for your assistance.

    1. Most likely you will be able to get it to work but you will have to make some changes. My guess would be the humidity is in a similar format that the temperature is. If you can collect some data from it, let me know and I may be able to help. Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.