ESP32 & ESP8266

Hide an ESP32-C3 IR Blaster Inside a Walnut for Smart Home Control

Want a smart-home gadget that nobody notices sitting on the shelf? Grab an ESP32-C3 dev board, two or three IR LEDs, a 100-ohm resistor, a pair of small neodymium magnets, and an empty walnut shell. That is the entire parts list behind a build documented by maker [JSK-koubou] on YouTube, and it is a good weekend-sized project if you already have an ESP32 lying around from a breadboard experiment.

What the walnut actually does

The shell splits along its natural seam into two halves. [JSK-koubou] hollowed each side, glued small neodymium magnets along the seam so the halves snap shut, mounted LEDs at a few points on the inside, and dropped an ESP32-C3 in the middle with its USB port still reachable for power and reflashing. The walnut sits on a shelf and joins the house Wi-Fi network. When a home automation hub sends it a command over MQTT, the ESP32-C3 fires its IR LEDs at whatever gear in the room only understands infrared, an old TV, a window AC unit, a fan, anything the maker never bothered to swap for a Wi-Fi version.

The technical part: turning GPIO pins into remote-control signals

An ESP32-C3 is a single-core RISC-V chip running at up to 160MHz with built-in Wi-Fi and Bluetooth LE, and it runs its logic at 3.3V, so the IR LED needs a current-limiting resistor rather than a direct GPIO connection. Most IR remotes, and the receivers built into TVs and air conditioners, expect a 38kHz carrier: the GPIO pin does not just toggle on and off, it pulses at that frequency while encoding the actual remote-control bits on top, in either the NEC or Sony protocol depending on the target device. Libraries like IRremoteESP8266 or the newer IRremote handle that carrier generation and protocol encoding in software, so you send a call like `irsend.sendNEC(0x20DF10EF)` instead of bit-banging timing by hand. The gotcha most people hit first: picking a GPIO pin that is free during boot. GPIO9 on the ESP32-C3 is a strapping pin, and driving it high on some boards during power-up can interfere with flashing, so pick a neutral pin like GPIO4 or GPIO5 for the LED output instead.

Build your own version

You do not need the walnut shell part to get the useful half of this project working. Solder an IR LED and its resistor to any free GPIO pin on an ESP32-C3, flash IRremote or IRremoteESP8266, and pair it with Home Assistant over MQTT to start bridging non-connected gear into your automations. An ESP32-C3 dev board runs a little over ₱300 at circuit.rocks, so the whole build costs less than a fast-food meal. Watch [JSK-koubou]’s build video for the full walnut-shell assembly, or skip straight to wiring an LED to a spare board if the enclosure part is not your focus.

Frequently Asked Questions

What does the walnut-shell IR blaster actually control?

Anything in the room that only takes infrared commands and was never replaced with a Wi-Fi version, things like an older TV, a window air conditioner, or a standalone fan. The ESP32-C3 gets a command over MQTT from a home automation hub and translates it into an IR signal those devices already understand.

What parts and cost are involved if I want to build one?

An ESP32-C3 dev board, one or two IR LEDs, a current-limiting resistor around 100 ohms, and an enclosure of your choice (a walnut shell is optional flair). The ESP32-C3 board alone runs a little over PHP 300 at circuit.rocks, so the electronics cost well under PHP 500 total before you add a case.

What will I learn if I build this?

You will practice driving a GPIO pin through a transistor or resistor to switch an LED, generating a 38kHz carrier signal with a library instead of bit-banging timing by hand, and wiring an ESP32 into MQTT so it can talk to a home automation hub. It is a solid first project for understanding how microcontrollers bridge old hardware into modern smart-home setups.

This article was inspired by reporting from Hackaday. Find the parts and modules to build it at Circuitrocks.

// written by Ann Arandia

Ann Arandia covers community projects and maker events for the Circuitrocks blog. She writes about local workshops, kid-friendly electronics, and the Philippine maker scene — the people, the meet-ups, the projects that come out of them.