Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Yes. An ESP32 running ESPHome can replace several single-purpose smart-home gadgets when the job is sensing, switching or triggering simple automations. The most practical builds are a room thermostat, a smart plug or relay controller, a wall button or light controller, a door/window contact sensor, and a plant monitor or watering controller. The ESP32 and its sensors or actuators provide the electronics; a 3D printer makes the enclosure, wall plate, bracket or bezel.
These projects are best treated as low-voltage prototypes and custom local devices. For anything connected to mains electricity or HVAC wiring, use a certified switching/interface module inside a mechanically safe enclosure. A printed shell protects parts and determines fit, but it does not make an uncertified circuit safe.
As an Amazon Associate I earn from qualifying purchases.
Recommended Free Tools
What can an ESP32 and 3D printer replace in a smart home?
An ESP32 is useful wherever a commercial gadget mainly measures a value, changes a state or sends an automation event. ESPHome lets the device run on your local network, receive over-the-air updates and operate without a vendor cloud. The printer supplies the physical parts that are difficult to buy in the exact shape you need: sensor covers, wall plates, brackets, bezels and custom enclosures.
Choose ESPHome when a quick local prototype and Home Assistant integration are the priority. Choose the Arduino ESP32 Matter stack when standardized device types and interoperability with Matter controllers matter more. Matter documentation covers thermostat, on/off plug, generic-switch, contact, humidity, light, occupancy and temperature-related endpoints. A device can therefore be useful on its own, while a dashboard remains optional for scenes, history and notifications.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
At-a-glance comparison
| Build | What the ESP32 does | What the printed part does | Primary concern |
|---|---|---|---|
| Room thermostat | Reads temperature, accepts setpoints and drives a low-voltage HVAC interface | Wall enclosure, display bezel and button surround | HVAC compatibility, calibration and safe low-voltage interfacing |
| Smart plug or relay controller | Switches a relay and reports state | Insulating enclosure, cable strain relief and mounting | Certified switching hardware, isolation and mains clearances |
| Door/window sensor | Reads a magnetic reed switch and sends open/closed events | Two-piece case that aligns the magnet and switch | Battery life, radio range, debounce and alignment tolerance |
| Wall button or light controller | Interprets presses or controls a compatible relay/dimmer | Button cap, wall plate and mounting frame | Tactile feel, gesture design and certified line-voltage interface |
| Plant monitor or watering controller | Samples soil moisture and drives a low-voltage pump | Probe holder, electronics box and tubing brackets | Sensor drift, water containment and pump reliability |
1. Build a room thermostat
A thermostat is the closest direct replacement for a basic connected thermostat. Connect an ESP32 to a temperature/humidity sensor such as a BME280 or DHT22, then add a small display and buttons if occupants need to see or change the setpoint locally. Espressif’s Arduino Matter documentation includes a MatterThermostat endpoint with temperature control and setpoints.
Build sequence
- Mount the sensor away from the ESP32 regulator, display backlight and direct sunlight so self-heating does not bias the reading.
- Configure the temperature entity, target setpoint and a sensible deadband or hysteresis. Hysteresis prevents rapid heating and cooling calls when the measured temperature hovers around the target.
- Add buttons or a rotary input for setpoint changes, and verify that the display shows the measured value, target and operating state clearly.
- Connect only to the HVAC control interface specified by the equipment manufacturer. Use a certified low-voltage interface or relay module with the required voltage, current and isolation ratings.
- Test calls for heat or cooling with the HVAC disconnected, then test each operating mode while watching for unexpected short cycling.
The printed enclosure can hold the display behind a bezel, space the buttons at a comfortable height and provide a wall-mount pattern. Vent the sensor area without exposing the board to dust or accidental contact. A thermostat case should be easy to remove for calibration and service, and cable entry should not pull on the terminal block.
Compared with a store-bought thermostat, this build offers local automations and a shape suited to the room, but it does not automatically provide HVAC certification, a guaranteed control algorithm or compatibility with every furnace and heat pump. Treat temperature accuracy, calibration, control hysteresis, display/input design and low-voltage safety as separate acceptance tests.
2. Build a smart plug or relay controller
An ESP32 can operate a relay and report its state, making it suitable for a smart-plug-style controller, fan control or other simple on/off load. ESPHome supports switch entities and local network operation. The practical route for anything involving line voltage is to integrate a certified smart-plug or relay module rather than designing the mains section yourself.
Build sequence
- Prototype the logic with an LED or other low-voltage load. Confirm that the ESP32 boots, receives commands and reports the actual switch state.
- Choose a certified module whose voltage, current, load type and isolation ratings match the intended appliance. Motors, heaters and LED drivers can have inrush or inductive behavior that differs from a resistive test load.
- Set an explicit boot state. A fail-safe choice may be off, but the correct behavior depends on whether the load is a pump, alarm, ventilation fan or other safety-related device.
- Provide a physical manual override and a way to see whether the relay is energized. Keep low-voltage wiring separated from the module’s line-voltage terminals.
- Use an enclosure with strain relief, protected terminals and the clearances specified by the module and local electrical rules. Test temperature under the maximum permitted load.
The printer is useful for a mounting cradle, cable exits and a cover that cannot be installed in a way that exposes live parts. It is not an insulating certification. Do not put an unprotected mains board in a printed box and call it a safe smart plug. Keep early prototypes on low-voltage loads, and have line-voltage work performed or checked by a qualified person where required.
Compare this project on load rating, isolation, enclosure clearance, manual override, boot behavior and local-versus-cloud operation. A cloud account may be convenient, but local control keeps a switch usable when an internet service is unavailable.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
3. Build a door or window contact sensor
A magnetic reed switch and matching magnet give the ESP32 a simple open/closed input. The Matter contact-sensor endpoint can represent that state to compatible controllers, while ESPHome can publish a binary sensor and trigger notifications or automations.
Mechanical and electrical details
- Place the reed switch in one printed half and the magnet in the other. Model a positive stop so the two pieces return to the same position every time.
- Measure the switch’s activation distance and leave adjustment slots in the mount. Frames are rarely perfectly square, and a few millimeters of tolerance can prevent false openings.
- Use a pull-up or pull-down arrangement appropriate to the input and add software debounce. A door can bounce electrically as it closes, producing several events unless the state is filtered.
- For a battery device, wake on a GPIO transition, transmit the event and return to deep sleep when the hardware and firmware support that pattern. A continuously connected sensor consumes more energy.
- Test the radio path with the door closed, not just on a workbench. Metal frames, foil insulation and the final enclosure can reduce range.
The two-piece printed case is the main advantage over a generic sensor: it can match a narrow frame, hide screws and preserve the exact magnet gap. Choose a material and sealing approach suitable for condensation or splash exposure, but do not assume an outdoor enclosure is waterproof merely because it has a lid. Compare battery life, radio range, debounce behavior, mounting tolerance and weather exposure with the requirements of the opening.
4. Build a smart button or light controller
A printed wall button can turn a press into an automation event or operate a compatible light module. Espressif documents MatterGenericSwitch for short-, long- and multi-press gestures, and Matter lists on/off, dimmable and color-light endpoints. That means one small control can trigger scenes, while a separate certified relay or dimmer handles the actual line-voltage load.
Plan the interaction first
- Assign one action to a short press, a different action to a long press and, only if users can remember it, a third action to a multi-press.
- Decide whether the ESP32 is switching a local low-voltage load or merely sending an event. Event-only buttons can be battery powered; a relay or dimmer normally needs continuous power.
- Choose a tactile switch, spring, rocker or printed cap that gives a clear click and does not bind against the wall plate.
- Debounce the input and provide feedback through an LED or the controlled light so a press is not ambiguous.
- For mains lighting, use a certified dimmer or smart module rated for the lamp type. A printed button plate cannot replace the required electrical isolation.
Make the wall plate removable without tearing out the wires, leave room for the ESP32’s USB connector during development and include mounting features that match the electrical box or surface anchors. Compare tactile feel, number of gestures, power source, relay/dimmer compatibility and whether the button controls a local load or only triggers an automation.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →5. Build a plant monitor or watering controller
A capacitive soil-moisture sensor avoids some of the rapid corrosion associated with exposed resistive probes. The ESP32 can sample moisture, report plant condition and drive a low-voltage pump through an appropriate transistor, MOSFET or relay driver. ESPHome documents an ESP32 Smart Plant arrangement with soil-moisture, battery-voltage and solar-charge connections, while the practical project set includes plant watering.
Build sequence
- Calibrate the sensor in the actual potting mix at dry and adequately watered conditions. Treat the result as a relative moisture value, not a universal percentage.
- Choose a sampling interval that gives useful data without wasting battery. There is rarely a reason to run a pump immediately after a single noisy sample; require a sustained dry condition.
- Drive the pump from a separate 5 V or 12 V supply as appropriate, with a driver and suppression components suitable for the pump. Do not power a pump directly from an ESP32 GPIO.
- Limit run time and add a maximum daily watering allowance. A stuck sensor, empty reservoir or blocked tube should not run the pump indefinitely.
- Use a reservoir-level check or a visible refill indicator, route tubing so it cannot siphon unexpectedly and test for leaks before installing electronics nearby.
Print a probe holder that keeps insertion depth consistent, an electronics box above the spill zone and brackets for tubing. Keep water and mains power physically separated; a low-voltage pump supply is preferable for a first build. Compare sensor drift and corrosion resistance, sampling interval, battery or solar budget, reservoir size, pump noise and overflow protection. Plant species, soil mix and pot size determine the useful threshold, so copy neither a threshold nor a watering schedule blindly.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Parts, tools and enclosure planning
A sensible starter inventory includes an ESP32 DevKit board, breadboard, jumper wires and a data-capable USB cable. Sensor modules can include a BME280 or DHT22 for temperature and humidity, a PIR sensor for occupancy-triggered automations, a magnetic reed switch with magnet and a capacitive soil-moisture sensor. Keep suitable 5 V or 12 V supplies available for pumps or LED strips, and select drivers, connectors and fuses to match each load.
Official ESP32-DevKitC documentation is the reference for the board’s power, USB and pin arrangement. Check the exact board variant before assigning GPIOs: labels and available pins differ, and some pins have boot or input-only constraints. Draw the wiring, mark power and ground, and reserve test points before printing a final case.
Print only the mechanical parts: sensor covers, wall plates, brackets, bezels and electronics enclosures. Select filament, wall thickness, fasteners and sealing for the installation’s heat, UV, impact and moisture exposure. Those choices are site-specific. A snap fit that works indoors may loosen in heat; a sealed box may trap heat; and a case that looks closed may still admit water through a cable opening. Make a cheap fit-check prototype before committing to a decorative final print.
Software, updates and interoperability
ESPHome is the quickest route from wiring to a local sensor, switch or automation. Its configuration describes components, exposes entities over the local network and supports over-the-air updates. The ESPHome approach is explicitly aimed at building a needed device yourself and running it on your own network without the cloud.
Arduino ESP32 Matter is a better fit when a thermostat, on/off plug, generic switch, contact sensor, light or related endpoint must be recognized by Matter controllers. Confirm the endpoint and command model before designing the user interface; a generic switch that emits gestures is not the same thing as a dimmer that directly controls brightness. Home Assistant is an optional dashboard and automation layer, not a prerequisite for the ESP32 device to sense or switch locally.
For every build, document the firmware version, pin map, calibration values and recovery method. Verify OTA updates on a spare unit before updating a device mounted behind a wall plate. If Wi-Fi is unavailable, decide whether the device should retain a safe local behavior, queue an event, or remain off. Local operation is an advantage, but it still requires reliable power, radio coverage and a controller when scenes or history are desired.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Safety and practical limits
These are appropriate as low-voltage prototypes and custom local devices. A 3D-printed enclosure is mechanical protection only. For mains loads, use a certified relay or smart-plug module, preserve the clearances and strain relief specified by that module, prevent access to live terminals and follow local electrical rules. No particular DIY printed design should be treated as certified.
HVAC terminals also require care: identify the control voltage and equipment behavior, use an interface rated for it and avoid connecting an ESP32 GPIO directly to an unknown terminal. Keep pumps, reservoirs and wiring arranged so a leak cannot reach energized equipment. Before handing a device to another person, test power-loss recovery, sensor failure, stuck-button behavior, maximum run time and the result of a lost network connection.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Is building one cheaper than buying one?
The electronics cost is not a fixed figure. An ESP32 board, sensor or actuator, enclosure hardware, power supply and printer material all contribute, and certified switching modules can cost more than bare relay boards. Your time for wiring, calibration, firmware and troubleshooting is also part of the project. Compare the complete bill of materials and the value of local control or a custom shape with a ready-made product; do not assume a printed enclosure automatically lowers the total cost.
Frequently Asked Questions
Can I run these ESP32 projects without Home Assistant?
Yes. ESPHome devices can expose sensors, switches and automations on the local network without a Home Assistant dashboard or cloud account. A controller is still useful for scenes, history and notifications, but the device itself can continue basic local operation.
Which ESP32 board should I use for a first project?
An ESP32 DevKit development board is the simplest starting point because it exposes power, ground and GPIO pins for breadboard wiring. Select the exact board variant after checking its pinout, boot-pin behavior and USB interface; the official ESP32-DevKitC documentation is the authoritative reference for that hardware.
How do I make an ESP32 sensor battery-powered?
Design around deep-sleep intervals, a regulator with low quiescent current and a battery budget that includes Wi-Fi startup peaks. Door sensors usually need less energy than a display, pump or continuously connected thermostat, so power architecture should be chosen per project. Test the finished enclosure and radio path, since retries and weak signals increase consumption.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Can an ESP32 directly replace a smart thermostat?
It can replace the sensing, setpoint and automation functions of a basic thermostat when paired with a compatible certified low-voltage HVAC interface. It does not automatically provide equipment certification or universal compatibility. Verify the HVAC control voltage, hysteresis, wiring and recovery behavior before connection.
Can I use a bare relay board for a mains smart plug?
Not as a safety assumption. Keep prototypes on low-voltage loads unless the switching hardware is certified for the intended mains voltage, current and load type. Use the module’s required clearances, enclosure, strain relief and manual-isolation provisions, and follow local electrical rules.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
How far apart should the reed switch and magnet be?
Use the activation distance specified for the particular reed switch and leave adjustment tolerance in the printed mount. Door and window frames vary, so a slotted or shimmed two-piece case is more reliable than a fixed gap copied from another design. Test the closed and open states after final mounting.
How should I handle button presses?
Define the actions before printing the wall plate. A short press, long press and multi-press can map to different automation triggers through MatterGenericSwitch, but every additional gesture increases the learning burden. Debounce the input and provide clear feedback.
Can a soil-moisture sensor decide when to water automatically?
It can provide a useful input, but calibrate it in the actual soil and require a sustained dry reading. Add a maximum pump run time, reservoir or leak checks and a daily limit. Moisture thresholds vary with plant, pot and soil, so there is no universal value.
Can a 3D-printed enclosure be used outdoors?
Only after selecting material, wall thickness, sealing method and mounting appropriate for the site. UV, heat, impact and water exposure vary by location, and no single enclosure dimension is universally safe. Protect electronics, route cable entries carefully and validate the finished case in its actual environment.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11What should happen if Wi-Fi goes down?
Choose the behavior per device. A thermostat or plant controller may retain a safe local schedule, while a remote button may simply queue no event until connectivity returns. Define and test the boot state, network-loss behavior and power-loss recovery instead of leaving them to defaults.
Do I need a 3D printer for these projects?
No. The printer is valuable for custom sensor covers, wall plates, brackets, bezels and enclosures, but cardboard prototypes, off-the-shelf boxes or laser-cut panels can validate the electronics first. Print the final part only after the board, connector and cable clearances are proven.
The Bottom Line
An ESP32 and a 3D printer are a practical substitute for several single-purpose smart-home gadgets when the task is local sensing, switching or a simple control event. Start with a low-voltage thermostat, contact sensor, button or plant monitor; use ESPHome for the fastest local build and Matter when standardized interoperability is the priority. Treat certified relay hardware, enclosure clearances, water separation, calibration and failure behavior as part of the design—not as finishing touches.
Quick Recap
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.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitches

