Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
BETTESWORTHConstruction
DIY smart home

5 Easy ESPHome Projects to Get You Started

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ESPHome is the quickest way to turn an ESP32 development board into a useful smart-home device without writing conventional C++. You describe the hardware in YAML, ESPHome builds firmware, and Home Assistant can discover the resulting sensors, switches, and controls through ESPHome’s native API. These five low-voltage projects progress from flashing an LED to monitoring temperature and humidity.

The examples assume a standard ESP32 development board, Home Assistant, a 2.4 GHz Wi-Fi network, and a solderless breadboard. ESPHome does not require Home Assistant—you can also use its command-line tools or Docker—but Home Assistant’s ESPHome Device Builder is usually the easiest starting point.

As an Amazon Associate I earn from qualifying purchases.

What you need

  • ESP32 development board with a USB data connection
  • USB cable that supports data, not charging only
  • Computer or Home Assistant host
  • 2.4 GHz Wi-Fi network
  • Breadboard and jumper wires
  • LED and a 220–1,000 ohm resistor
  • Pushbutton
  • Reed switch and magnet
  • Low-voltage PIR motion sensor
  • Temperature/humidity module, such as a DHT-style or I2C sensor

A multimeter, spare Dupont wires, an enclosure, and an external 5 V supply are optional but useful.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Every ESPHome project has two parts: firmware running on the ESP board, and ESPHome tooling running on Home Assistant, a computer, or another host. For a first board, choose a clearly identified ESP32 development board with an accessible USB port and documented pinout. Espressif’s ESP32-DevKitC is a suitable example, while ESPHome’s FAQ describes the original ESP32 as a mature general-purpose choice.

#1 Best Overall
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • ESP32 is a safe, reliable, and scalable to a variety of applications

Safety first

Keep these projects low-voltage. Never connect mains voltage directly to an ESP GPIO, and never use a breadboard for mains wiring. A GPIO cannot safely drive a motor, relay coil, lamp, or appliance without the correct driver or isolated module. Check every sensor’s supply and output voltage before connecting it to an ESP32, use a resistor with discrete LEDs, and confirm polarity and shared ground before powering the circuit. A DIY PIR is not a certified security system.

“Easy” means simple software and safe, testable hardware—not that every module has identical pinouts. Board labels are not always GPIO numbers, and pins may be reserved for bootstrapping, flash, USB, or onboard functions. Check your board’s pinout before choosing a GPIO.

Set up ESPHome and flash the first firmware

In Home Assistant, install the ESPHome Device Builder where supported, open its web interface, choose New Device Setup, enter the board’s details and Wi-Fi credentials, and create the configuration. Connect the ESP32 by USB and install the initial firmware. After the device joins Wi-Fi, add it to Home Assistant when discovered. For later changes, edit the YAML, validate it, compile it, install it, and inspect the logs before testing the hardware.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use secrets.yaml for credentials:

wifi_ssid: "Your 2.4 GHz Wi-Fi name"
wifi_password: "Your Wi-Fi password"
fallback_password: "A separate fallback password"

A reusable configuration header looks like this:

esphome:
  name: beginner-node
  friendly_name: Beginner Node

esp32:
  board: esp32dev
  framework:
    type: esp-idf

logger:

api:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Beginner Node Fallback"
    password: !secret fallback_password

captive_portal:

Change board: to match the actual board. The platform-qualified ota: syntax is used in current ESPHome documentation, but check the current documentation if your installed release reports a syntax error. The fallback access point can help when credentials are wrong, but it is not a substitute for fixing a network problem. Do not expose the ESPHome API or fallback access point directly to the public internet.

1. Control an onboard or external LED

This is the smallest useful ESPHome project: flash firmware, expose a GPIO output, and control it from Home Assistant.

Use an onboard LED

Onboard LED pins vary by board. GPIO2 is common on some boards but is not universal, and some LEDs use inverted logic. Check the pinout or use an external LED instead.

switch:
  - platform: gpio
    id: test_led
    name: "Test LED"
    pin: GPIO2
    inverted: true

Merge this block into the common configuration. Adjust both the GPIO and inverted: value as required by the board.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wire an external LED

ESP GPIO ── 220–1,000 ohm resistor ── LED anode (+)
LED cathode (−) ── GND

Never connect an LED directly to a GPIO. Toggling the resulting Test LED switch in Home Assistant should turn the LED on and off.

Rank #2
ELEGOO 3PCS ESP-32 Dev Boards, ESP-WROOM-32, USB-C, WiFi Bluetooth 4.2 | Low-power IoT Applications, Smart Devices, Automation, Wireless Communication, GPIO Headers, Simplifying Development
  • Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
  • Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
  • Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
  • USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
  • Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision

If the entity’s off state leaves the LED lit, add or remove inverted: true. If flashing fails, try a known-good data cable, select the correct board, and hold the BOOT button during connection if your board requires it.

You learn: YAML structure, board selection, Wi-Fi, the native API, GPIO output, USB flashing, and entity discovery.

2. Use a pushbutton to control the LED

Now add a physical input. The simplest arrangement uses the ESP32’s internal pull-up resistor.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
GPIO input ── pushbutton ── GND

The input reads high while the button is open and low while it is pressed. Add an ID to the LED switch, then add this binary sensor:

switch:
  - platform: gpio
    id: test_led
    name: "Test LED"
    pin: GPIO2
    inverted: true

binary_sensor:
  - platform: gpio
    name: "Desk Button"
    pin:
      number: GPIO4
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 20ms
      - delayed_off: 20ms
    on_press:
      - switch.toggle: test_led

The GPIO binary sensor documentation explains the pin modes used here. The short delays debounce mechanical contact bounce. Pressing the button toggles the LED, while the button itself appears in Home Assistant as a binary sensor.

Do not leave a digital input floating. If the state is reversed, change inverted:. Avoid pins involved in bootstrapping until you have checked the board documentation.

You learn: digital input versus output, pull-up resistors, debouncing, and a GPIO automation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Build a door or window contact

A reed switch and magnet make a useful open/closed sensor. Wire the switch in the same basic way:

Rank #3
Sale
ELEGOO ESP-32 Super Starter Kit with Tutorial Compatible with Arduino IDE | Development Board, USB-C Dual Core Microcontroller Support AP/STA/AP+STA, CP2102 Chip, WiFi, Bluetooth, 200+ parts for IoT
  • Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
  • Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
  • Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
  • Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
  • Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.
GPIO input ── reed switch ── GND

Mount the magnet and reed switch close together when the door or window is closed. Then use a semantic device class so Home Assistant presents the result as a door:

binary_sensor:
  - platform: gpio
    name: "Front Door"
    device_class: door
    pin:
      number: GPIO16
      mode:
        input: true
        pullup: true
      inverted: true
    filters:
      - delayed_on: 50ms
      - delayed_off: 50ms

The official Home Assistant setup guide uses the same pull-up and inverted-logic pattern for a contact sensor.

If the state is reversed, change inverted: true. False triggers can result from a poor magnet alignment, long unshielded wires, or a noisy input. Increase the delay, check the cable and ground connection, and verify whether your reed switch is normally open or normally closed. For long runs, an external resistor, twisted pair, shielding, or a different sensor arrangement may be more reliable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A wired contact is electrically simple but may be inconvenient to install. Once the labor, cable, and enclosure are included, a battery-powered wireless contact can sometimes be the more practical choice.

You learn: binary-sensor device classes, normally open versus normally closed behavior, and physical installation.

4. Add PIR motion detection

A PIR module can expose movement as a motion entity and trigger a low-risk demonstration such as an LED.

Wire the module

PIR VCC ── a supply suitable for that module
PIR GND ── ESP GND
PIR OUT ── ESP GPIO input

Do not assume every PIR accepts 3.3 V or produces an ESP32-safe output. Check the specific module’s electrical specifications before connecting it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure the sensor

binary_sensor:
  - platform: gpio
    id: desk_motion
    name: "Desk Motion"
    device_class: motion
    pin: GPIO27
    filters:
      - delayed_off: 2s
    on_state:
      then:
        - if:
            condition:
              binary_sensor.is_on: desk_motion
            then:
              - switch.turn_on: test_led
            else:
              - switch.turn_off: test_led

This assumes the test_led switch from the earlier project is still in the configuration. The delayed-off filter keeps the motion state active briefly after the PIR output drops.

Rank #4
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (1 PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters

PIR modules commonly need a warm-up period after power-up. They detect changes in infrared radiation, so a stationary person may eventually stop triggering one. Sunlight, heaters, fans, and movement of the module can cause false triggers, while the module’s hardware timing and retrigger controls can matter as much as the YAML.

You learn: module power requirements, motion device classes, trigger behavior, and the limits of hobby sensors.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Monitor temperature and humidity

A temperature/humidity node is the first project that produces continuing measurements rather than an on/off state. It is useful for room monitoring, but a working reading is not automatically an accurate or calibrated measurement.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DHT-style modules are inexpensive and easy to wire, but relatively slow. BME280/BME680-class I2C modules add capabilities such as pressure and generally require correct bus wiring and address selection. SHT3x/SHT4x-class devices may be preferable where measurement quality matters. Check the current ESPHome component catalog for the exact module and syntax supported by your installed version.

DHT-style example

sensor:
  - platform: dht
    pin: GPIO17
    temperature:
      name: "Room Temperature"
    humidity:
      name: "Room Humidity"
    update_interval: 60s

Confirm the exact DHT model and current platform syntax in ESPHome before flashing.

I2C example

i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true

sensor:
  - platform: bme280_i2c
    temperature:
      name: "Room Temperature"
    pressure:
      name: "Room Pressure"
    humidity:
      name: "Room Humidity"
    address: 0x76
    update_interval: 60s

SDA and SCL pins depend on the board. A module may use address 0x76 or 0x77; scan: true helps identify it in the logs.

Keep the sensor away from sunlight, radiators, vents, condensation, and the ESP board’s warm voltage regulator. Avoid sealed enclosures unless airflow is intentional. Treat hobby modules as suitable for casual room monitoring, not laboratory instruments.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You learn: sensor components, update intervals, I2C wiring and addresses, placement, and data-quality limitations.

Best Value
HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA for Arduino IDE
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Ultra-Low power consumption, works perfectly with the Arduino IDE
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • ESP32 is a safe, reliable, and scalable to a variety of applications

A repeatable test loop

Use the same process for every project:

  1. Validate the YAML.
  2. Compile the firmware and correct any board or component errors.
  3. Install it by USB for the first flash.
  4. Read the ESPHome logs.
  5. Test the physical input or output at the desk.
  6. Confirm the entity and state in Home Assistant.
  7. Restart the device and test again.
  8. Only then try an OTA update.

USB is the best recovery method. OTA is faster, but it depends on working Wi-Fi, network discovery, and a compatible firmware image. Keep the board physically accessible and retain the last working YAML.

Troubleshooting by symptom

The board will not flash

  • Replace the cable with a known-good USB data cable.
  • Confirm that the board is powered and the selected board definition is correct.
  • Install the required USB-serial driver if your computer needs one.
  • Select the correct serial device and use the BOOT/FLASH button procedure.
  • Disconnect components that may pull a bootstrapping pin into the wrong state.

It flashes but does not join Wi-Fi

Check the SSID, password, YAML secrets, 2.4 GHz availability, signal strength, router client isolation, and distance from the access point. Use the fallback AP and captive portal when available, but remember that it only helps you regain access; it does not repair every network issue.

Home Assistant does not discover it

Confirm that api: is present, the ESPHome integration is installed, and Home Assistant and the device can communicate across their network segments. Check firewall and VLAN rules and inspect the logs. Discovery can take several minutes; the command-line guide documents the upload and discovery flow. If necessary, add the device manually by hostname or IP.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The YAML validates but the hardware does not

Check GPIO numbering, inverted logic, pull-up or pull-down configuration, supply voltage, sensor bus and address, shared ground, and whether the chosen pin is used by flash, USB, boot circuitry, or another onboard function. A successful compile proves the configuration is syntactically valid; it does not prove that the wiring is safe or correct.

OTA fails

Reconnect by USB, check the device’s current IP or hostname, inspect logs to see whether it remains online, and simplify recent changes. Avoid changing Wi-Fi and hardware configuration in the same update.

What to build next

Once one of these nodes is reliable, add a Home Assistant automation, a display, or a Bluetooth proxy. Move to relay-controlled equipment only after learning about drivers, isolation, enclosures, current ratings, and electrical regulations. For ready-made examples, browse ESPHome’s project catalog, which includes hardware such as the M5Stack Atom Echo, ESP32-S3-BOX-3, Home Assistant Voice Preview Edition, and Bluetooth-proxy boards.

For Home Assistant, the native ESPHome API is normally simpler than MQTT. MQTT is useful when several systems need the same broker-based messages, but the ESPHome MQTT documentation warns that enabling MQTT without a functioning native API client can cause periodic reboots unless the API or reboot timeout is configured appropriately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.