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
- Connect wires to Rf receiver chip(wiring diagram). See this article for more info on gpio pins.
- Install Rasbian on Raspberry Pi
- Install Wiring Pi
- Install Apache and PHP on the Raspberry Pi
- Install php sqlite3: sudo apt-get install php5-sqlite
- Clone web files
- Install git: sudo apt-get install git
- Then type: sudo git clone https://github.com/timleland/temperaturesensor.git /var/www/html/temperaturesensor
- You should now be able to capture the temperature readings from the command line.
- Change to the directory: cd /var/www/html/temperaturesensor
- Then type: sudo ./capture
- Browse to Raspberry Pi ip address: http://<your-pi-ip>/temperaturesensor/
- 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.LY, Weather Extension, and Link Shortener Extension. If you are interested in the tech I use daily, check out my uses page.
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 !
Thanks! Do you know of a cheap temperature sensor that is bluetooth?
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.
That’s neat how is the range of the Realtek RTL2832 receiver ?
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?
Add an extender to your receiver?
I’m considering buying this extender and placing it near the pi to see if it would boost the signal. Is that what you mean?
Yes I think so. I used to use an extender to my router in the barn and it worked great
Thanks
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.
Thanks what zigbee devices are you using?
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.
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.
21/27 references the raspberry pi pins. Pin 2 is for wiringpi https://projects.drogon.net/raspberry-pi/wiringpi/pins/
Use this to reference the pi pins https://timleland.com/wp-content/uploads/2014/12/Raspberry-Pi-GPIO-Pin-Layout.png
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.
Ok good. It is confusing especially with the different versions of raspberry pi’s. Which accurite temperature sensor are you using?
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.
Ok thanks
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.
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.
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.
Yes let me know for sure. 10ft is not enough. In my post I mentioned that I’m kinda stuck and haven’t found a good solution. Thinking about trying this https://www.amazon.com/AcuRite-06053M-Wireless-Extender-Sensors/dp/B01HEHZXPS//ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=timlelcom-20&linkId=54b6819b9f318dde0c6d4b32476b9770
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.
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.
Thanks for sharing! The link you posted did not work. Mind sharing a new one?
My mistake. This is the one I got, but you could search others.
https://www.ebay.co.uk/itm/Super-heterodyne-OOK-Wireless-Receiver-Module-WH-UK-Interference-433MHZ-116dBm/321759158573?epid=1788680937&hash=item4aea57212d:g:ehcAAOSwEppUR2NH
It works well for me, and I run it from the 3.3V pin of a Pi Zero.
Did you have to use an antenna?
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.
This worked! I bought the SMAKN RXB6 433Mhz Superheterodyne Wireless and it works over 150ft away. Thanks!
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.
Thanks!
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.
Yes you should be able to capture multiple temperature sensors. I have 2 working now. Each one sends an code that identifies it.
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.
Nothing shoes up in the terminal when the capture program is running? It should log the temperature readings.
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.
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
Hmm most likely a new version exist. Any luck finding another option? May have to change the code to work with the new versions.
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?
Unfortunately, with a different sensor, you probably will have to change the code to get it to work. Take a look at these post on different sensors https://rayshobby.net/wordpress/reverse-engineer-wireless-temperature-humidity-rain-sensors-part-1/
This model appears to be the same as the one I used: https://amzn.to/2SxEsLI
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.
Yes you can use multiple. They should have different ids.
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.
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!
This post may be helpful https://rayshobby.net/wordpress/reverse-engineer-wireless-temperature-humidity-rain-sensors-part-2/
Is there any alternative sensor? Because the AcuRite 606TX is not available on amazon anymore…
You could try this model but no guarantee https://amzn.to/2SxEsLI
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!
Awesome glad you got it to work! You should be able to use python and connect to the sqlite database and trigger events. Take a look at https://ifttt.com/ You could probably send the data and trigger events using ifttt
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!
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.
Has something happened to your Github page? I’m afraid I’m getting a 404 error when I try to reach it.
Link?
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?
No I have not.
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.
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.
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.
That should be fine. Let me know how it goes.
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.
Oh good thanks for sharing
Can I use a Raspberry Pi Zero W rather than the Raspberry B3?
Most likely as long as it has gpio pins
So, in theory, the PiZero W (which has GPIO pins) should connect to the Super Heterodyne receiver (https://amzn.to/2FbPgfp) and talk to the Acurite 06002M (https://www.amazon.com/AcuRite-06002M-Wireless-Temperature-Humidity/dp/B00T0K8NXC/)and provide temperature and humidity readings?
Yes it should. Good luck!
Tim, has anyone modified your temperaturesensor.cpp code to support the Acurite 6002 Temp+Humidity sensor?
Check out this post. It may give you some more info for humidity https://rayshobby.net/wordpress/reverse-engineer-wireless-temperature-humidity-rain-sensors-part-2/. It should be possible though
Thanks. That code (http://raysfiles.com/rpi/humidity_display.cpp) looks like it will decode the temperature and humidity but how does that work if you want to use multiple Acurite 06002 sensors? I don’t see anything in the code that can distinguish one sensor from another. Is a unique id transmitted with the readings?
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.
Sounds like a neat project 👍
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.
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 😁
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.
Hey Tim, I tried to get code from Github but it appears not to be there any more. is it possible to repost to Github?
Hi Jim, what link is not working? Did you try this? https://github.com/timleland/temperaturesensor
Tim, down load files fine. My problem is access rights to /var/www/html on my Pi. I’m a total Pi Newbie
Are you using sudo when running commands?
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.
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
That’s awesome glad it has worked for some many years!