Indoor & outdoor temperature sensor project

I’ve been working on a project to monitor the indoor temperature of my home office and compare this with the outside temperature. I built my home office during the lockdown period and took a lot of care with the insulation and installed a large north facing double-glazed window to help with passive heating. It always feels warm but I wanted to gather some hard data. Now it would have been very easy to buy an off the shelf weather station but I wanted an excuse to do a project, so I quickly concluded nothing was quite right for my “special” requirements.

I ended up using a couple of Pico Pi W’s running MicroPython which periodically upload readings to the cloud. The inside unit has a display attached and cycles between showing the inside temperature and the outside temperature.

I use Grafana cloud to create a graph which compares the two temperatures over a 24 hour period which can be viewed on my phone or laptop.

A more detailed description of the project and the associated source code is available here: Internet connected temperature sensors using MicroPython on a Pico Pi W

I had a few challenges along the way, especially around powering the outdoor unit from a battery. I know many others have done similar projects and would be interested to learn about their solutions.


Hi Mark,

This is a fantastic write-up! You’re definitely right in that temperature monitoring seems to be a hot topic (groan), maybe something to do with how it relates to human comfort. Since you mentioned being interested in other people’s similar projects, I thought I’d chime in with my own. I got about 3k words into my writeup before I got into a project trance and just finished the thing, but I’ve uploaded what I have to GitHub, and will finish it off Soon™.

Here’s the “finished product”:

A board that talks over RS485/modbus to a Pi, based on an ATtiny. There’s a C script that runs on the Pi to query 4 sensors on the bus, and save a line to a CSV, then exit. It uses a library with macros for the Pi GPIO pins for toggling the read/write pin on the RS485 chip, and some serial code I stole borrowed from the link at the bottom of the writeup on github. The rest was written from scratch.

Cron runs that once a minute, and it’s had one missed measurement in months, and is resistant to power failures (cron gets started on boot). Grafana runs locally on the Pi. and uses a “CSV data source” pointed at an Apache instance on the Pi that serves the csv file (useful if you want to wrangle the raw data in Excel or OSS equivalent).
Very rough, no HTTPS, and I don’t have an apache routing system just yet. If you poke around you might find my photography site or a few other open ports, but nothing of interest.
uname/pw is guest/guest, and is set up so that you can’t mess with my grafana :wink:


  • Your system definitely seems to reflect both the sensible/easy way of getting temperature data, as well as the conventional setup of using a hosting service. I had wires in my walls from the first iteration of this back in 2019 or so, so one of my constraints was to use them (the Pico W didn’t exist then!). My project also reflects areas I’d like to learn more in or where my interest lies, like embedded linux, bare metal C on microcontrollers, wired communication, self hosting, that kind of thing. For me a project is 99% learning 1% thing at the end.
  • I used TMP117s as the extra accuracy is needed when the goal is to build a thermal model. but I don’t have humidity/pressure data.
  • You have the luxury of building an insulated room :wink: Australia in particular needs more people with that mindset.

Please let me know if you have any questions, this is a personal project so while it contributes to the forum, I won’t spend ages gushing about it if there isn’t interest, more of a “just get it up there” thing.


Hi James,
Thanks for sharing your project. I really enjoyed reading your write up on github. As a purely software guy, I was particularly impressed by your custom board designs and RS485/Modbus implementation.
Using the Pi as a server to host Grafana makes a lot of sense for your application. I can see how you can extend the Pi server to provide the user interface and control of the A/C unit.

The temperature logs were interesting. I was surprised to see the slab was over 19 degrees. The thermal mass must be providing a useful source of heat. The graphs clearly show where the air conditioner cycles on and off and where the passive heating from the sun gives you a good bump in temperature.

Good luck with your Mechatronics degree and keep posting on your progress.