Skip to content

Five Dollar Sensor

You'll build a sensor the shops don't sell from a five dollar microcontroller board and a sensor module, and have it show up on your dashboard like you bought it.

About

At some point you'll want a sensor nobody makes: the temperature inside the compost bin, whether the mailbox lid opened, how full the water butt is. An ESP32 board is about five dollars, sensor modules are one to three dollars each, and ESPHome turns them into a device your hub recognizes without you writing a program, just a short config file. If you'd rather write the code yourself, that's Microcontrollers & Robotics; here the board is a device for your hub. This is low-voltage work, 3.3 and 5 volts over USB, so the worst you can do is break the board. Keep it that way: nothing here touches mains, and if your idea needs mains, use a smart plug instead. Soldering helps and isn't required, since most boards and modules come with pin headers and jumper wires.

At a glance

Per requirement
35 XP
Completion bonus
300 XP
Requirements
6
Takes
Two weekends, then a month
Skill level
Intermediate (months of practice)
Cost
Cheap (under $10)
Supplies
You need some
Where
At home
Other people
On your own
Locked for now
Earn two more Uncommon badges in Smart Home to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Flash ESPHome onto an ESP32 board from the browser and see it join your network. The ESPHome web installer works from a Chromium browser over USB. Give the device a name you'll recognize in a year. Take a screenshot of the device appearing in your hub with its Wi-Fi signal shown. Photo
  2. 2
    Wire a temperature and humidity module and read it on the dashboard. A DHT22 or a BME280 on three or four jumper wires. Match the pin names in your config to the pins you actually plugged into, because that's the whole debugging story. Take a photo of the wiring and a screenshot of the reading. Photo
  3. 3
    Add a second input that's a switch or a count: a reed switch, a button or a float. A reed switch on the mailbox lid, a float switch in the water tank, or a tilt switch on a bin lid. Binary sensors are where the useful ideas are. Film the physical thing moving and the dashboard changing. Video
  4. 4
    Put it in a box and power it somewhere it will live. A food container with a hole for the USB cable is a fine enclosure, and a phone charger is a fine power supply. Outdoors needs a sealed box with the sensor poking out, the board above any water line, and the charger indoors. Take a photo of the finished device in place. Photo
  5. 5
    Log it for a month and build one automation on it. Mailbox opened means a notification. Compost above 60 C means turn it. Tank below a quarter means a reminder. Take a screenshot of the month's graph and the automation. Photo
  6. 6
    Publish the config so someone else could build it. Post the config file, the parts list with prices, and one photo of the wiring somewhere public, like a gist, a forum post or the ESPHome community site. Take a screenshot of the post. Photo