# Indoor & outdoor temperature sensor project

**URL:** https://forum.core-electronics.com.au/t/indoor-outdoor-temperature-sensor-project/17531
**Category:** Projects
**Created:** [9 July 2023 12:13 UTC](https://forum.core-electronics.com.au/t/indoor-outdoor-temperature-sensor-project/17531 "2023-07-09T12:13:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mark240472](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/mark240472/32/8440_2.png) [@Mark240472](https://forum.core-electronics.com.au/u/Mark240472)
#### Post date: [9 July 2023 12:13 UTC](https://forum.core-electronics.com.au/t/indoor-outdoor-temperature-sensor-project/17531/1 "2023-07-09T12:13:13Z")

</div>

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](https://github.com/mark-gladding/weatherstation)

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.

---

<div class="post-metadata">

### Author: ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)
#### Post date: [10 July 2023 02:36 UTC](https://forum.core-electronics.com.au/t/indoor-outdoor-temperature-sensor-project/17531/2 "2023-07-10T02:36:11Z")

</div>

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

> **[GitHub - JamesFarra/modbus-tmp117: My TMP117 Modbus implementation](https://github.com/JamesFarra/modbus-tmp117/tree/main)**
>
> main

Here’s the “finished product”:

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/3/374412eda33a851a00d3a6927de95ed1d76d7cd5.jpeg)  
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).

[http://180.150.77.76:3000/d/Z1FN6JZRz/temperature-logger?orgId=1&refresh=1m](http://180.150.77.76:3000/d/Z1FN6JZRz/temperature-logger?orgId=1&refresh=1m)  
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 😉

## Differences

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

---

<div class="post-metadata">

### Author: ![Mark240472](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/mark240472/32/8440_2.png) [@Mark240472](https://forum.core-electronics.com.au/u/Mark240472)
#### Post date: [10 July 2023 12:48 UTC](https://forum.core-electronics.com.au/t/indoor-outdoor-temperature-sensor-project/17531/3 "2023-07-10T12:48:29Z")

</div>

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.
