KS019 WiFi IR Remote

Background

Almost every device in a typical living room — air conditioners, soundbars, TVs, Blu-ray players, projectors — speaks IR. That’s great until you want to fold them into a home automation setup, at which point you hit a wall: how do you send an IR command from software? The KS019 solves that. It’s an ESP8266-based board that lets you point any IR remote at it, decode exactly what protocol and codes it’s sending, and then fire those codes on demand over WiFi. No cloud, no proprietary hub — just a small PCB you flash yourself and wire into whatever automation stack you’re running.

Hardware

The brains is an ESP8266 — handling WiFi, MQTT, and IR signal generation all in one chip. The IR LED sits on GPIO16 and the IR receiver on GPIO14. Three indicator LEDs tell you what’s happening at a glance: a power LED, a heartbeat status LED on GPIO5 that blinks to confirm the firmware is alive, and a dedicated IR transmit LED that fires each time a code goes out. A micro-USB connector handles both power and programming — plug in, hit upload from the Arduino IDE, done. No FTDI adapter, no boot button gymnastics. An RTS/DTR auto-reset circuit handles bootloader entry automatically. IR transmission has been tested at 10 m between two KS019 units. The board is 33 × 31 mm, prototyped at JLCPCB, and designed in Altium. Print files for a snug enclosure are included.

KS019 Rev 4 top
Top
KS019 Rev 4 bottom
Bottom
KS019 top
Top
KS019 bottom
Bottom

Enclosure

A custom enclosure keeps the PCBA clean and mountable. Validated on a Prusa MK3S+ using eSUN PLA+ filament — no supports required, PCBA drops straight in. Should be printable on any FDM machine.

Enclosure assembled
Assembled
Enclosure assembled alternate view
Assembled (alternate view) — ignore the long legs of the IR receiver protruding in the 3D model
Enclosure base
Base
PCB in base
PCB in base

Arduino IDE setup

If you haven’t used an ESP8266 with the Arduino IDE before, you’ll need to add board support and a couple of libraries. One-time setup:

  1. Open File → Preferences and add the following URL to the Additional boards manager URLs field:
    http://arduino.esp8266.com/stable/package_esp8266com_index.json
  2. Open Tools → Board → Boards Manager, search for esp8266, and install the package from ESP8266 Community.
  3. Select Tools → Board → ESP8266 Boards → Generic ESP8266 Module.
  4. Open Sketch → Include Library → Manage Libraries, search for IRremoteESP8266 by David Conran, and install it.
  5. For the MQTT-based sketches (MideaSend, PanasonicSend): in the same library manager, search for MQTT by Joel Gaehwiler (256dpi) and install it. Note: this is not PubSubClient — the sketches use MQTTClient.h from the arduino-mqtt library.

Firmware workflow

The IRremoteESP8266 library does the heavy lifting — it decodes and encodes a huge range of IR protocols, including the AC-specific ones that carry full unit state (mode, temperature, fan speed, swing) rather than just raw on/off codes. Adding a new device is a two-step process:

  1. Capture: flash IRrecvDumpV2 to the KS019 and point the original remote at the IR receiver (GPIO14). Each button press is decoded and printed over serial — protocol name, bit count, address, command, and a ready-to-paste sendXxx(…) call.
  2. Replay: drop those values into a transmit sketch. For AC units, the library manages the full state frame so you’re not manually constructing 200+ bit packets.

Deployments

Three transmit sketches have been written so far — each targeting a different device and protocol:

MideaSend

Targets a Midea split AC using the Coolix protocol. Listens over MQTT and responds to ON / OFFON sends a fully encoded Coolix frame set to 23°C, cool mode, auto fan. A straightforward starting point if you want to adapt it to your own Coolix-compatible unit.

PanasonicSend

Targets a Panasonic split AC using the kPanasonicRkr model variant. Worth understanding the AC protocol here: unlike a TV where each button sends an independent code, AC remotes transmit the entire unit state in every frame. The library handles this correctly — a single ON command encodes mode, fan speed, temperature, and swing into one complete frame. Auto swing enabled on both vertical and horizontal axes.

SonySend

Targets a Sony soundbar using codes captured from a Sony RMT-AH412U remote. Unlike the AC sketches, this one skips MQTT and is driven directly from the Serial Monitor — type a command name and hit Enter. Handy for quick testing or for setups where serial is more convenient than WiFi. Type help for a full command list.

All codes were captured with IRrecvDumpV2. A useful Sony quirk: decodeSony() stores results.value in the same bit order that sendSony() expects, so you can replay the raw captured value directly without any bit manipulation. The table below lists all captured codes — 15-bit for core amp functions, 20-bit for extended settings.

CommandBitsDataFunction
power150x540CPower toggle
volup150x240CVolume up
voldown150x640CVolume down
mute150x140CMute
swplus150x1D0CSubwoofer level up
swminus150x5D0CSubwoofer level down
input150x4B0DInput select
menu150x770DMenu
up / down150xF0D / 0x4F0DNavigation
standard200xB8116Standard sound mode
music150x490DMusic sound mode
cinema150x610DCinema sound mode
autosound200xF4116Auto sound mode
voice200x9C114Voice mode
night150x20DNight mode
play200x5C110Play/Pause
prev / next200xC110 / 0x8C110Previous/Next track
back200xBE110Back
dimmer150x40DDisplay dimmer
enter150x180CEnter/OK

Testing

Before shipping, each unit goes through a loopback test that exercises every functional path: USB power, status LED, WiFi, MQTT, IR transmit, and IR receive. You need two KS019 boards — one as the unit under test (UUT), one as a known-good IR witness receiver — placed 10 m apart.

  1. Load the UUT with PanasonicSend firmware. Power via USB and confirm the status LED is flashing — this validates USB power and firmware boot.
Unit under test powered with PanasonicSend firmware, status LED flashing
  1. Use MQTT Explorer to publish ON to the AC topic. If the UUT has joined the WiFi network and its MQTT subscription is live, it will fire the IR code immediately.
MQTT Explorer publishing ON
  1. Load a second KS019 with IRrecvDumpV2 firmware and open its Serial Monitor at 115200 baud. This unit acts as the IR receive witness.
Second unit running IRrecvDumpV2
  1. Confirm IR reception on the witness unit: the Serial Monitor on the second KS019 should decode the incoming Panasonic AC frame — protocol, model, temperature, fan speed, swing. A clean decode here proves the UUT’s WiFi, MQTT stack, and IR transmitter are all working.
Serial Monitor decoding the received Panasonic AC IR code
  1. Test the UUT’s IR receiver: reflash the UUT with IRrecvDumpV2 and fire some IR codes at it from any remote. A decode on the Serial Monitor confirms the receiver path is good. At this point every functional block has been exercised.
  2. Ship: leave IRrecvDumpV2 loaded as the as-shipped firmware — it’s the most useful starting point for a new setup. Pack the PCBA into an anti-static bag.

Notes

IRremoteESP8266 covers an impressive range of consumer IR protocols and is actively maintained. For anything exotic it doesn’t recognise, the raw timing capture in IRrecvDumpV2 lets you record and replay arbitrary signals — you lose protocol decoding but you can still brute-force replay any code.

The RTS/DTR auto-reset circuit is one of those things that sounds minor until you’ve spent five minutes holding a wire across GPIO0 while trying to reflash. If you’re designing your own ESP8266 board, put this in from day one.

Sony SIRC is spec’d to repeat each transmission at least twice; three is more reliable. The repeat parameter in sendSony(data, bits, 2) handles this — pass 2 and the library sends three copies total.

← All posts
← KS043 StanLink