pico-thermo
A MicroPython app to read data from BME280 sensor and send it to Home Assistant.
Hardware
The following hardware is what I used for a deployment:
- Raspberry Pi Pico 2 W: https://www.amazon.com/dp/B0DRJXPPWL
- The W is VERY important, as without networking it can't reach Home Assistant!
- Also a Raspberry Pi Pico W should work too, but I haven't tested it yet
- Waveshare Bosch BME280 sensor: https://www.amazon.com/dp/B07Q47DFXS
- Elegoo SSD1306 LCD: https://www.amazon.com/dp/B0FSRQG23K
Most (or all?) of these components can be swapped for equivalent components. You just need to make sure the code is compatible with whatever board you choose (not likely), is a genuine BME280 sensor, and an SSD1306 display.
Support for other hardware types may come in the future, but if there's a specific sensor or board you're interested in, please submit an issue or pull request!
Prototyping
To help with debugging/testing deployments, I also used these components:
- Elegoo 400-pin Breadboard: https://www.amazon.com/dp/B01EV640I6
- Freenove Raspberry Pi Pico Breakout Board: https://www.amazon.com/dp/B0BFB53Y2N
- Elegoo 20cm Jumper Cables 120 count: https://www.amazon.com/dp/B01EV70C78
These are not necessary to run the app, but can be useful for testing and/or flashing several nodes.
Software Deployment
Requirements
- MicroPython - MicroPython downloads
- mpremote - MicroPython remote serial tool
- (Linux users) Your user should be a part of the
dialoutgroup
Steps
- Connect your BME280 sensor and SSD1306 display to your Pico.
- You may need a breadboard for this, else you can use splitters.
- Connect your Pico to your PC via a micro-USB to USB type-A cable.
- Flash your Raspberry Pi Pico with MicroPython.
- This has been tested with MicroPython 1.29, but other versions should work.
- Clone this git repository:
git clone https://git.metaunix.net/BitGoblin/pico-time. cdinto the repo:cd pico-time.- Copy
config.example.pytoconfig.pyand edit the settings to match your environment. - Copy the Python code over to the Pico:
mpremote cp main.py :main.pympremote cp config.py :config.py
- Reset the Pico:
mpremote reset
If it worked you should see the display show a message about connecting to WiFi, then eventually a readout of the current temperature to the SSD1306 display. If it failed, you can monitor the app via mpremote repl or using an IDE like Thonny.
License
This project is made available under the BSD 3-Clause license.