DIY Smart Touch Lamp Project and Integration Tips

Hey everyone, I wanted to share my recent project converting a regular lamp into a smart touch-controlled lamp. It was a fun DIY project that combined hardware hacking with Home Assistant integration. Here’s how I did it and some tips for those looking to try something similar!

The Project

I started with a basic 3-way bulb lamp and decided to give it a smart upgrade. After some research, I settled on using an ESP32-S3 chip from M5Stack and a small relay module. The goal was to create a touch-sensitive lamp that could be controlled without any external buttons or switches.

The process involved a bit of wiring and some clever casing modifications. I had to cut the hot wire and reroute it through the relay, attach a touch sensor wire to the lamp, and fit everything into a compact box. It was a bit tight, but with some careful cutting and cable management, it all fit nicely!

Integration with Home Assistant

Once the hardware was set up, the next step was integrating it with Home Assistant. I used the ESPHome add-on to flash the ESP32-S3 chip with custom firmware. The code included features like touch sensitivity adjustments, long-press actions, and even the ability to disable the touch feature remotely. This was especially useful for my wife, who was concerned about accidental touches during cleaning.

I also set up some automations in HA to enhance functionality. For example, a long press on the lamp triggers the overhead light in the room, and there’s an automation that disables all touch lamps during cleaning sessions to prevent unwanted toggles.

Tips and Tricks

  1. Touch Sensor Calibration: The ESP32-S3’s touch sensor was much more reliable than the older ESP32 models I’ve used. However, it’s crucial to calibrate the threshold value to avoid false triggers. I found that logging the sensor values during initial setup was super helpful.
  2. Compact Enclosures: Finding the right enclosure size was a challenge. I ended up modifying a small box by cutting out some internal mounts to save space. Using tie-wraps helped keep the wires neatly organized inside.
  3. Automation Synergy: Integrating the touch lamp with other devices in the room (like the overhead light) added a whole new layer of convenience. It turned a simple lamp into a versatile control hub!

Final Thoughts

This project was a great way to dive deeper into ESP32 programming and Home Assistant automation. It’s satisfying to see how a bit of hardware tweaking and software customization can transform a regular lamp into a smart, interactive device. Plus, my wife is thrilled with the result—no more visible buttons cluttering the desk!

If anyone has similar projects or tips for improving touch sensitivity or integration, I’d love to hear about them! Happy tinkering! :rocket: