Two different sensor projects that can be used standalone or with Home Assistant
Watch the video: https://youtu.be/DV3xqJKjhDA
Disclaimer: These devices are not for any safety, medical, or critical usage. It's for hobby education and experimentation only!
This one is designed to be inexpensive and easy to build. The parts should cost around $25. It measures temperature and humidity, and can publish the sensor readings to Home Assistant.
- Raspberry Pi Pico 2W microcontroller
- The case is based on a "2 Inch 22.5 Degree PVC Elbow Pipe Fitting" like this one
- Display (optional) Adafruit 0.96" 160x80 Color TFT Display - ST7735
- 12mm x 12mm momentary tactile button (optional)
- Some wire or ribbon cable, 28AWG or similar
- 3cm x 7cm proto board (only one board needed per sensor)
- SHT40 Temperature and Humidity Sensor (or SHT41, SHT45)
- M2 x 12 self tapping screws (optional) - 4 pieces to secure top and bottom to case
If not using the display, you can use an LED instead:
- bi-color LED
- two 470 ohm resistors
3D print the top, bottom, and insulator. Then use the photos below to help assemble the unit. The file schematic-mini.pdf shows how to wire everything together.
Download and install Circuitpython for the Pico 2W. This code was developed and tested on version 9.2.7, but should work on newer versions.
Copy all of the files in the mini folder to the root of your Pico. (This includes all of the code and icons needed to run the project) You'll be replacing the default code.py file if it already exists.
You will need to find and download the font file Helvetica-Bold-16.bdf to the root of the Pico as well. (I can't host it here due to its proprietary nature.)
Edit the settings.toml file with your WiFi SSID and password.
Add the following libraries to the Lib folder on the device: (You can find them in the bundles for version 9.x)
- adafruit_bitmap_font
- adafruit_minimqtt
- adafruit_display_text
- adafuit_ticks
- adafruit_st7735r
- adafruit_sht4x
- adafruit_connection_manager
Provide 5v 1A or greater to the Pico's micro usb port to power the device and start the code automatically. Update the settings file to publish via MQTT.
This one has up to ten sensors and is a more advanced project. The full code and some build suggestions are in this repo, but you'll need to improvise a little bit for best results.
- Raspberry Pi Pico 2W microcontroller
- The case is based on a "Reducing" pipe fitting, like this one
- 12mm x 12mm momentary tactile buttons (three)
- Some wire or ribbon cable, 28AWG or similar
- Swirly Aluminum Grids (mix and match, cut to size if needed)
- Basic PIR Sensor like the BL412
- Adafruit EYESPI breakout board For connecting display ribbon cable to the Pico
- MAX 4466 electret microphone
- Tiny Code Reader from Useful Sensors
- Adafruit MiCS5524 gas sensor
- DPS 310 Pressure sensor
- Accelerometer
- VEML7700 Lux Sensor
- SCD 40 CO2 sensor
- Adafruit PMSA003I Air Quality Breakout
- 4 channel I2C-safe logic level converter
- Adafruit 1.28" 240x240 Round TFT LCD
- Qwiic/STEMMAQT connectors/cables to connect the sensors together
- M2.5 spacers, standoffs and hardware for mounting sensors
- 3cm x 7cm proto board - cut as needed
- 5V, 4A power supply
- The top dome (optional) is a CCTV clear dome like this one
Optional:
- blue LED and resistor
- acrylic security camera dome
3D print the control panel, bottom bracket, and clips. Then use the photos below to help assemble the unit. The file schematic-maxi.pdf shows how to wire everything together.
Download and install Circuitpython for the Pico 2W. This code was developed and tested on version 9.2.7, but should work on newer versions.
Copy all of the files in the maxi folder to the root of your Pico. (This includes all of the code and icons needed to run the project) You'll be replacing the default code.py file if it already exists.
You will need to find and download the font file Helvetica-Bold-16.bdf to the root of the Pico as well. (I can't host it here due to its proprietary nature.)
Edit the settings.toml file with your WiFi SSID and password.
Add the following libraries to the Lib folder on the device: (You can find them in the bundles for version 9.x)
- adafruit_bitmap_font
- adafruit_bus_device
- adafruit_display_shapes
- adafruit_minimqtt
- adafruit_display_text
- adafruit_imageload
- adafruit_dps310
- adafruit_pm25
- adafruit_register
- adafuit_ticks
- adafruit_gc9a01a
- adafruit_lis3dh
- adafruit_scd4x
- adafruit_veml7700
- adafruit_connection_manager
Provide 5v 4A or greater to the Pico's VSYS pin to power the device and start the code automatically. Update the settings file to publish via MQTT. Note that most of the I2C sensors need to be powered by the 5V supply and then connected to the Pico through the logic level shifter. (See the schematic) When trying to power everything on the I2C bus with 3V, the sensors would brown out every few seconds. Make sure the sensors you choose are all 5V tolerant. (The ones in the parts list are.)
You will need an MQTT broker running on your network. Mosquitto is a good choice!
Then, add the sensors and binary sensors to your configuration.yaml file in Home Assistant.
For an example of the House Map dashboard configuration, see the house-map.txt file in this repo. Note that it uses an image uploaded to the Home Assistant media folder.









