I Made My Dumb AC Smart for ₹600 (and Learned to Respect Hardware)
By Harshil Patel · · 7 min read · ESP32, Hardware, IoT
How I turned a basic Samsung split AC into a phone-controlled, scheduling, energy-tracking smart AC with a single ESP32 and an IR LED — including the MOSFET-vs-transistor bug that nearly ended the project.
My AC is not smart. It's a perfectly good Samsung split unit, but its entire intelligence lives in a plastic remote that I lose behind the couch at least twice a week. Every summer I have the same thought walking home in 40°C heat: why can't I just tell it to start cooling before I get there?
Flagship smart ACs can do that. Mine cost a fraction of theirs and it's not going anywhere for years. So this year I stopped wishing and decided to bolt the intelligence on myself — for the price of a couple of pizzas.
The Itch, and a Naive Plan
The whole idea rests on one boring fact: my AC already has a wireless interface. It's called the infrared remote. If I could get a microcontroller to speak IR, I could impersonate the remote and command the AC from anything on my Wi-Fi.
So I bought the cheapest parts that could possibly work: an ESP32 DevKit v1, one IR transmitter, and a handful of jumper wires, resistors, and transistors.
The plan in my head was textbook. A GPIO pin can only push a few milliamps, and I wanted range, so I'd drive the IR LED through a transistor: pin toggles the transistor, transistor switches the higher current through the LED, LED blasts IR at the AC. Clean. Standard. What could go wrong?
The Failure I Want to Warn You About
I wired it all up, flashed firmware that sent a Samsung "power on" frame, and pointed it at the AC.
Nothing. No beep, no cold air, no blinking anything — IR is invisible, so I couldn't even see whether the LED was firing. I did what everyone does: checked the code, the pin number, the resistor, re-flashed, swapped jumpers, aimed a phone camera at the LED to catch the faint IR flicker. It stayed dark. Hours went by. I started wondering if I'd fried the pin.
The culprit was sitting in my hand the whole time. The little three-legged part I'd grabbed as my "transistor" was actually a MOSFET, not the NPN transistor my circuit assumed. They look nearly identical, but they switch on completely different principles — a bipolar transistor is current-driven through its base, a MOSFET is voltage-driven through its gate — and their pinouts don't line up. My circuit was feeding the right signal to the wrong kind of pin. The LED never stood a chance.
That's the emotional low point of every hardware project, and if you build anything physical you will meet it: the bug isn't in your code, it's in your assumptions about a component you never thought to question.
The Breakthrough: Stop Being Clever
Once I understood the problem, I could have sourced the correct transistor and rebuilt the driver stage. Instead I asked a simpler question: do I even need the driver?
The AC sits in the same room as the ESP32. I didn't need whole-house range — I needed to reliably hit a receiver window ten feet away. So I ripped out the transistor entirely and wired the IR LED straight to the ESP32 through a single current-limiting resistor. I rewrote the firmware around that direct connection, flashed it, and pointed it at the AC one more time.
Beep. The AC turned on.
I have rarely been that happy about a single beep. The whole system — Wi-Fi, IR protocol, the AC's decoder — worked end to end. Fewer parts, less to go wrong, and plenty of range for a same-room mount. Sometimes the senior-engineer move is to delete the sophisticated thing you were proud of.
From Blinking an LED to an Actual Product
Getting the AC to respond was the hard 20%. The fun 80% was turning "I can send one command" into something I'd actually want to use every day. I paired with Claude Code for the build — I made the accounts, designed the UI, and decided which features mattered; it did a lot of the heavy lifting on firmware and integrations, which let me spend my attention on product decisions instead of boilerplate.
What came out the other side is a web app that runs on the ESP32 itself, served over local Wi-Fi with no cloud in the middle:
- Full control — power, temperature, mode, and fan, plus one-tap presets
- Countdown timers — "off in 45 minutes"
- Weekly schedules — "on at 24° cool, 10 PM, weeknights"
- Multi-step programs — sleep curves like 60 min at 24° then 25° then 26° then off
- A live 24-hour cost timeline that projects when the AC switches and what it costs
- 30 days of energy and cost stats in kWh and rupees
- Filter reminders, safety auto-off, and optional Alexa / Google voice control
It even installs to your phone's home screen as a PWA and works offline. That's a feature list I'd expect on an AC costing many times mine.
Two engineering ideas from this build surprised me.
IR is write-only. Infrared is a one-way street — the ESP32 can tell the AC what to do, but it can never read the AC's real state. So the device only ever knows what it last commanded. That single fact shapes everything downstream: the energy stats, for example, honestly track commanded on-time, not real compressor duty.
Defer hardware work to the main loop. The 38 kHz IR signal is bit-banged in software with microsecond timing. If a web request tried to fire IR directly from a different task mid-transmission, the waveform would shred. The rule that fixed it: web and cloud handlers only ever mutate state and raise a flag; the actual IR send happens exclusively in the Arduino loop, on one cooperative task. A clean boundary between "decide what to do" and "touch the hardware" made the whole thing reliable.
What It Cost, and How You Can Build One
The best part: this is genuinely cheap and genuinely clonable. The whole build lands around ₹600–700 — an ESP32, an IR LED, some jumpers and resistors. You almost certainly already own the other two ingredients: a phone and a Wi-Fi router. No hub, no subscription, no vendor app, no account required.
What Hardware Taught Me
Software fails politely — a wrong value throws a stack trace that points at the line. Hardware fails silently. A MOSFET where you wanted a transistor gives you no error, no log, just an LED that stays dark and an evening of doubting yourself.
- Verify your physical parts before you debug your code — the universe will happily let you chase a firmware bug that was never there
- Ship in layers: I set out to make one LED blink an AC awake, and earned everything else one working beep at a time
- The senior move is often deleting your cleverest idea the moment a simpler one works
Turns out the smartest thing in my smart AC was knowing when to keep the circuit dumb.