Skip to content

alanb128/ha-environmental-sensors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Environmental sensors

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!

Mini-sensor

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.

Hardware List

If not using the display, you can use an LED instead:

  • bi-color LED
  • two 470 ohm resistors

Assembly

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.

Software

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

Operation

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.

Maxi

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.

Hardware List

Optional:

  • blue LED and resistor
  • acrylic security camera dome

Assembly

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.

Software

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

Operation

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

Connecting to Home Assistant

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.

About

Stylish devices packed with sensors that work alone or with Home Assistant.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages