The ESPHome powered multisensor

Disclosure: This post contains affiliate links. If you click through and make a purchase, I’ll earn a commission, at no additional cost to you. Read my full disclosure here.
Advertisement

Building a multisensor is one of the first things you should when starting off with ESPHome. The sensors are cheap, the wiring isn’t complicated, and you get your first taste of creating custom firmware for an ESP8266 or ESP32 using ESPHome. And if you need a little help to get going, there are projects such as the one by WhoTheHeck freely available.

Advertisement

Multisensors built using ESPHome can measure just about anything you want to be measured. Most of the time you will only be interested in the temperature, humidity, and maybe the air quality or brightness. Realistically, those are all the metrics you need inside your smart home. But you will find sensors supported by ESPHome which can detect incoming thunderstorms, react to gestures, and measure the field strength of magnets.

The ESPHome multisensor featured in this article measures temperature, humidity, air quality, brightness, and senses movement. It also has an RGB LED which indicates the air quality whenever movement is detected. The project is also built to be expanded with external sensors which can be attached using 3-pin JST connectors.

Advertisement

Required components for this project

This project uses run-of-the-mill sensors which can be found for little money on online marketplaces. It is designed to fit on a standard 70×50 mm prototype PCB, but the creator has also made PCB files available for those that want to order a custom PCB. Going down that route makes the soldering much easier.

At the heart of this project is an ESP8266. You could, of course, swap the ESP8266 for an ESP32 if you wanted features such as Bluetooth tracking. But if the ESP8266 has everything you need, there is no reason to go with the more expensive option. If you do choose to go with an ESP8266 and want to use the PCB files provided by the creator, make sure you don’t purchase a mini-board. The PCB is designed to be used with a full-length ESP8266 (such as the one linked below).

Advertisement

JST connectors

Used to connect external sensors to the multisensor.

Fresnel lens

Used to cover up and diffuse the RGB LED as well as the light sensor.

ESP8266

The WiFi enabled microcontroller at the heart of the ESPHome multisensor.

SHT31 – Temperature and humidity

SHT31

A high-quality temperature and humidity sensor.

The SHT31 is a high-quality temperature and humidity sensor. It has an excellent ±2% relative humidity and ±0.3 °C accuracy for most uses. While I didn’t feature it in my list of recommended temperature and humidity sensors, it is an exquisite choice, though it isn’t used in DIY projects as frequently as the BME280.

CCS811 – Air quality

CCS811

Keeps an eye on nasty VOCs in your smart home.

The CCS811 is a VOC and eCO2 sensor. It monitors air quality using a gas sensor that can detect a wide range of Volatile Organic Compounds (VOCs) and is intended for indoor air quality monitoring. The configuration of this sensor isn’t quite as easy as the others, as you will have to set a baseline in order to get good measurements.

BH1750 – Ambient light

BH1750

A light sensor which will help Home Assistant decide whether to turn on the lights.

The BH1750 is a simple ambient light sensor. It will tell you how bright a room currently is. That value can in turn be used to decide whether lights should be turned on when movement is detected or not.

AM312 – Motion sensor

AM312

Detects movement in a room by measuring infrared light.

The AM312 is a cheap motion sensor which can be configured as a binary_sensor in ESPHome. This binary sensor will turn to on whenever movement is detected.

WS2812B – RGB LED

WS2812B

A lot of RGB for very little money.

The WS2812B is a popular, individually addressable RGB LED. For this project, only a single chip is needed and not an LED-strip. This LED will display the current air quality, which is read from the CCS811 sensor whenever the AM312 sensor senses movement using different colours.

Building the ESPHome multisensor

As with just about any DIY electronics project, this one uses a 3D-printed enclosure. You will either need a 3D printer of your own or have access to a place which will print the enclosure for you. The designer of this project has made his files for the enclosure available to download on GitHub. There is even a part that will help you in the assembly of the multisensor.

Fresnel lenses, which are usually used to cover motion sensors, are used to cover up the WS2812B LED and BH1750 sensor. These are placed in the openings on the front of the enclosure.

Advertisement

Once you’ve got all the parts ready, it is time to solder. As alluded to earlier, you will have a much easier job soldering a custom-printed PCB than a prototype board. If you’ve never soldered before, you will find many different guides on YouTube. Soldering isn’t as complicated as you might think it is. And by using a custom PCB, you’ll have a hard job making any errors.

Creating the firmware using ESPHome

The creator of the project has also made their YAML code available for others to use. But I’d suggest you try coding it yourself if this is your first ESPHome project. To accomplish that, all you have to do is visit the ESPHome website and look up the configuration of each sensor.

There are a few nice features to be found in this firmware. For example, the RGB LED is configured fully in the firmware and doesn’t use any Home Assistant automation to change to the appropriate colour. There is also a text sensor which will tell Home Assistant the air quality of the room the multisensor is located in.

Advertisement

Start making now

Projects such as this multisensor are a great way of getting into ESPHome and DIY electronics in general. A multisensor was the first thing I built from scratch, and it was a very enjoyable thing to do. With just a few cheap sensors and an ESP8266, you can make your smart home just a little bit smarter all on your own.

Everything coming to the Home Assistant dashboard in version 0.117

You will soon be able to control your Xbox using Home Assistant

Advertisement
Liam Alexander Colman, the author and maintainer of Home Assistant Guides.

About Liam Alexander Colman

Liam Alexander Colman has been using Home Assistant for various projects for quite some time. What started off with a Raspberry Pi quickly became three Raspberry Pis and eventually a full-blown server. I now use Unraid as my operating system, and Home Assistant happily runs in a Docker container. My personal setup includes many Zigbee devices as well as integrations with existing products such as my Android TV box. Read on to find out more on how I got started with Home Assistant.

Leave a comment

Advertisement
Share to...