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.


Thanks for reading. Make sure you follow me on Twitter to stay up to date on the progress of my side projects T.LYWeather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.  

81 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.

      1. Bob, That looks like a handy library. What hardware are you using to capture the 433 mHz. What board (raspberry pi, arduino) what RF reciever?

  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. Ok good. It is confusing especially with the different versions of raspberry pi’s. Which accurite temperature sensor are you using?

      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.

    1. Yes you should be able to capture multiple temperature sensors. I have 2 working now. Each one sends an code that identifies it.

  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.

      1. When I used the commands given in the tutorial I got this version of PHP: PHP Version 7.0.30-0+deb9u1
        I then changed the php5-sqlite command to php7-sqlite which installed.
        I don’t seem to be capturing any data though. I am using “AcuRite 06044M 06044M Wireless Temperature Humidity Monitor Sensor” from Amazon which seems to be the wrong item…
        I’m trying to figure out what I can do to make it work.
        Is there some sort of listener you use to figure out what data is being sent out? I saw a website with soldering an aux jack to the sensor but that seems drastic. Any tips for me on this?

  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!

  13. Hi Tim,

    I just set everything up and it is working great. Could you recommend a way to integrate the data being collected into a python script? That’s the only language I know as of now and I’d love to use these sensors and your code to trigger some events based on temperature in different zones. I’m not quite sure how to go about it as I am still relatively new to developing things like this. Any guidance is much appreciated. Love the project!

  14. I’m working on my build today and possibly next weekend if I run out of time this morning. Thank you for posting this description of your process. I have a few questions:

    1. How long have you been using your temperature sensors?
    2. Do you have an estimate for battery life of the sensors?
    3. What is the max number of sensors you have hooked up to the Pi? Is there an upper limit?

    Thanks again!

    1. I’ve been using them for since this post. They appear to last for months. Right now I have 3 sensors total. Not sure on how many is possible but I would assume they get unique ids that would not overlap.

  15. Thanks for sharing this tutorial. Anyway, it was a bit too technical for me. When looking for alternatives, I found this service called meazurem. Have you tried that?

  16. This works great! I am having a bit of a problem where I’m getting mostly good data but every once in a while I get a randomly high or low figure like so:
    387 11011111 77°F 25°C 06/06/2019 5:51:07 PM
    386 11011111 77°F 25°C 06/06/2019 5:50:36 PM
    385 11011111 77°F 25°C 06/06/2019 5:50:05 PM
    384 11011111 77°F 25°C 06/06/2019 5:49:34 PM
    383 11011111 77°F 25°C 06/06/2019 5:49:03 PM
    382 11011111 77°F 25°C 06/06/2019 5:48:32 PM
    381 10010101 397.4°F 203°C 06/06/2019 5:48:17 PM <———-
    380 11011111 77°F 25°C 06/06/2019 5:48:01 PM
    379 11011111 77°F 25°C 06/06/2019 5:47:30 PM

    Then it goes back to normal. Is there a way to ignore the temp if it isn't within a certain range of the last 2 readings? That was if there is a 5c or 10c change in a few minutes it would ignore it?

    Am I barking up the wrong tree here? Should I put an antenna on the receiver? I have the receiver and sensor with 5 feet of each other and I'm using the recommended items.

    1. Glad you got it to work! It could be interference from another device but you definitely can put in a check to not log it if its outside a range.

      1. Thank you for the fast answer! I also wanted to mention that I needed to replace the sudo apt-get install php5-sqlite with sudo apt-get install php7.0-sqlite to get it to install properly on my system. I’ll write back with my solution for the errant temp readings once I figure it out.

    2. I’m answering my own question here in case someone runs into the same problem. It turns out that my receiver was receiving reflected signals off of a large metal filing cabinet. Once I turned the receiver around all of the incorrect readings went away.

  17. Tim, has anyone modified your temperaturesensor.cpp code to support the Acurite 6002 Temp+Humidity sensor?

  18. Nice work. I wonder if anyone’s decoded the 433Mhz signals from an Acurite 5 in 1 weather station (wind speed, wind direction, precip. temp, humidity)? The base unit is okay, and has additional sensors for indoor temp, humidity and barometric pressure, but I don’t really want to attach my portable Pi-based air quality monitoring system to the USB cord from the base unit.

  19. Isn’t it bad to connect the data output of this 5V device to a GPIO pin on the Raspberry Pi? I’ve heard they can only handle 3.3V maximum and that you need a voltage divider to connect the data pin to the GPIO. I’m afraid that I damaged my Raspberry Pi by following these pinout directions.

    1. Hey Mike,

      I ran this for several months without issue. The SMAKN wireless receiver says 3-5V. Disclaimer: I am not responsible for damaging your pi 😁

  20. I just got this going today (2020-Feb-21) using this tutorial. I didn’t change my install of apache or php, and to install wiring pi I just used apt install wiringpi.

    I’m very new at this–I tried starting the capture script at reboot using cron, but that doesn’t work–no updates to the database show up on the page. Do you have any pointers?

    Also, where might I look to introduce human-readable labels to each sensor name? I think I’d add a lookup table for each sensor ID.

    Finally, how might I scan for other brand signals on the same band? Do I need to create a separate sniffer, or just use the receiver I already have hooked up to read the Accurite?

    Thanks for any pointers you have to offer, and thanks for putting all this detail out there in the first place.

  21. Tim, thanks for your help so far.
    Yes, I copied: sudo git clone https://github.com/timleland/temperaturesensor.git /var/www/html/temperaturesensor and then got an error “could not read remote repository”, Please make sure you have the correct access rights and the repository exists” I then downloaded from the Git hub and tried to copy to /var/www/html but had error. I cannot copy or rename to the /var/www/html folder.
    I should be able to right click, change permissions but that does not allow me to copy files to the /var/www/html folder.

  22. Hi Tim
    I just want to say a big thanks – i have been running your scripts for years for the 5 fridge / freezers i have.
    The system is so stable running on a Raspberry Pi 3 and I easily modified the script as in the UK, i could not get the same make of monitors as the ones you used.
    For everyone, one this i would recommend – for the sensors, use lithium AA batteries. These have not given me any issue with the low low temperatures.
    Thanks again
    Christian

Leave a Reply

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