Community project

QAM LED Remote Control

Photo of QAM LED Remote Control
Generated with AI

ROMMEL GUMABOL VENTENILLA

Published November 27, 2026

This project builds a QAM (Quadrature Amplitude Modulation) infrared remote control system using an ESP32 to transmit encoded commands and receive them back to control RGB LEDs. The transmitter uses a ROM-based address generator and clock divider to modulate infrared signals, while the receiver demodulates the QAM signal using in-phase and quadrature sampling to decode button presses. The guide includes a complete parts list, wiring diagrams for both transmitter and receiver circuits, ROM programming instructions, and step-by-step assembly from preparing the transmitter memory through final testing.

Builders will learn how QAM encoding works in practice, how to interface the ESP32 with discrete logic components and infrared optoelectronics, and how to implement coherent demodulation on a microcontroller. The firmware handles symbol timing, I/Q demodulation, nearest-neighbor decoding, and LED control logic.

Wiring diagram

Wiring diagram for QAM LED Remote Control
Loading diagram…

Gather all the parts

QtyComponent
1

Push Button

red

Momentary push button switch

1

Push Button

green

Momentary push button switch

1

Push Button

blue

Momentary push button switch

1

Push Button

off

Momentary push button switch

1

Resistor

22 Ω

Through-hole resistor (current-limiting in series with an LED)

1

Vishay TSAL6200

940 nm infrared LED

1

Vishay TEFT4300

Analog infrared phototransistor

1

Resistor

15 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Ceramic Capacitor

10 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Resistor

330 Ω

Through-hole resistor (current-limiting in series with an LED)

1

LED

red

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

Resistor

330 Ω

Through-hole resistor (current-limiting in series with an LED)

1

LED

green

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

Resistor

330 Ω

Through-hole resistor (current-limiting in series with an LED)

1

LED

blue

Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.

1

USB-C 5V Adapter

USB-C wall adapter delivering regulated 5 V to the board's USB or VBUS rail. Default wired power source for desktop / stationary projects.

1

TI SN74HC4060N (DIP-16)

Fixed-function infrared transmitter logic

1

Microchip AT28C64B-15PU (DIP-28)

Fixed-function infrared transmitter logic

1

TI SN74HCT244N (DIP-20)

Fixed-function infrared transmitter logic

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Resistor

15 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

150 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Ceramic Capacitor

1 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Resistor

10 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

10 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

10 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

10 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

8.2 kΩ (1%)

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

4.12 kΩ (1%)

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

2.05 kΩ (1%)

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

1.02 kΩ (1%)

Through-hole resistor (current-limiting in series with an LED)

1

Resistor

33 kΩ

Through-hole resistor (current-limiting in series with an LED)

Assemble it in 4 steps

1. Prepare the transmitter memory

Use an AT28C64B-compatible parallel EEPROM programmer to write data/qam-at28c64b.hex (Intel HEX format) starting at address zero, then verify the chip. This is waveform data, not microcontroller firmware. Deploy does not write this chip.

2. Build the transmitter clock and address wiring

On a separate breadboard, follow the transmitter wiring exactly. Numbers on the three chips are physical pin numbers counted from the notch. Place the three 100 nF capacitors close to their chips. Use the 5 V adapter with its own regulated 5 V USB source. Do not link either transmitter rail to the ESP32.

3. Wire the buttons and infrared LED

The buttons connect their address input to transmitter ground when pressed. The four weighted resistors meet at tx_limit.P1; tx_limit.P2 goes to the IR LED cathode. Its anode goes to transmitter 5 V because the buffer sinks current. Hold one button at a time for about half a second. Do not point the IR emitter into anyone's eyes.

4. Wire the receiver and test

Connect the detector collector to GPIO32, with 15 kΩ to 3V3, and both 33 kΩ and 10 nF to GND. Never connect the detector input to 5 V. Connect its emitter to GND. Connect outputs GPIO18 (red), GPIO19 (green), and GPIO23 (blue) to its LED anode through its own 330 Ω resistor, and each cathode to GND. Plug the ESP32 into USB and press Deploy. Let it start with the transmitter idle, then test a few centimeters apart indoors.

Review all connections

1. Connections between "detector" and "ESP32"

FunctiondetectorESP32
analogCGPIO 32
groundEGND

2. Connections between "rx_load" and "ESP32"

Functionrx_loadESP32
powerP13V3
digitalP2 → Vishay TEFT4300 CEXT

3. Connections between "rx_bias" and "ESP32"

Functionrx_biasESP32
digitalP1 → Vishay TEFT4300 CEXT
groundP2GND

4. Connections between "rx_filter" and "ESP32"

Functionrx_filterESP32
digital1 → Vishay TEFT4300 CEXT
ground2GND

5. Connections between "r_red" and "ESP32"

Functionr_redESP32
digitalP1GPIO 18

6. Connections between "led_red" and "ESP32"

Functionled_redESP32
digitalANODE → Resistor P2EXT
groundGNDGND

7. Connections between "r_green" and "ESP32"

Functionr_greenESP32
digitalP1GPIO 19

8. Connections between "led_green" and "ESP32"

Functionled_greenESP32
digitalANODE → Resistor P2EXT
groundGNDGND

9. Connections between "r_blue" and "ESP32"

Functionr_blueESP32
digitalP1GPIO 23

10. Connections between "led_blue" and "ESP32"

Functionled_blueESP32
digitalANODE → Resistor P2EXT
groundGNDGND

11. Connections between "clock" and "ESP32"

FunctionclockESP32
digital16 → USB-C 5V Adapter +5VEXT
digital8 → USB-C 5V Adapter GNDEXT
digital12 → USB-C 5V Adapter GNDEXT
digital7 → Microchip AT28C64B-15PU (DIP-28) 10EXT
digital5 → Microchip AT28C64B-15PU (DIP-28) 9EXT
digital4 → Microchip AT28C64B-15PU (DIP-28) 8EXT
digital6 → Microchip AT28C64B-15PU (DIP-28) 7EXT
digital14 → Microchip AT28C64B-15PU (DIP-28) 6EXT
digital13 → Microchip AT28C64B-15PU (DIP-28) 5EXT
digital15 → Microchip AT28C64B-15PU (DIP-28) 4EXT

12. Connections between "rom" and "ESP32"

FunctionromESP32
digital28 → USB-C 5V Adapter +5VEXT
digital27 → USB-C 5V Adapter +5VEXT
digital14 → USB-C 5V Adapter GNDEXT
digital20 → USB-C 5V Adapter GNDEXT
digital22 → USB-C 5V Adapter GNDEXT
digital23 → USB-C 5V Adapter GNDEXT
digital2 → USB-C 5V Adapter GNDEXT
digital11 → TI SN74HCT244N (DIP-20) 2EXT
digital12 → TI SN74HCT244N (DIP-20) 4EXT
digital13 → TI SN74HCT244N (DIP-20) 6EXT
digital15 → TI SN74HCT244N (DIP-20) 8EXT

13. Connections between "driver" and "ESP32"

FunctiondriverESP32
digital20 → USB-C 5V Adapter +5VEXT
digital1 → USB-C 5V Adapter GNDEXT
digital19 → USB-C 5V Adapter GNDEXT
digital10 → USB-C 5V Adapter GNDEXT
digital11 → USB-C 5V Adapter GNDEXT
digital13 → USB-C 5V Adapter GNDEXT
digital15 → USB-C 5V Adapter GNDEXT
digital17 → USB-C 5V Adapter GNDEXT

14. Connections between "ir_tx" and "ESP32"

Functionir_txESP32
digitalANODE → USB-C 5V Adapter +5VEXT

15. Connections between "clock_bypass" and "ESP32"

Functionclock_bypassESP32
digital1 → USB-C 5V Adapter +5VEXT
digital2 → USB-C 5V Adapter GNDEXT

16. Connections between "rom_bypass" and "ESP32"

Functionrom_bypassESP32
digital1 → USB-C 5V Adapter +5VEXT
digital2 → USB-C 5V Adapter GNDEXT

17. Connections between "driver_bypass" and "ESP32"

Functiondriver_bypassESP32
digital1 → USB-C 5V Adapter +5VEXT
digital2 → USB-C 5V Adapter GNDEXT

18. Connections between "osc_r" and "ESP32"

Functionosc_rESP32
digitalP1 → TI SN74HC4060N (DIP-16) 10EXT
digitalP2 → Resistor P1EXT

19. Connections between "osc_guard" and "ESP32"

Functionosc_guardESP32
digitalP2 → TI SN74HC4060N (DIP-16) 11EXT

20. Connections between "osc_c" and "ESP32"

Functionosc_cESP32
digital1 → TI SN74HC4060N (DIP-16) 9EXT
digital2 → Resistor P2EXT

21. Connections between "btn_red" and "ESP32"

Functionbtn_redESP32
digitalSIGNAL → Microchip AT28C64B-15PU (DIP-28) 3EXT
groundGND → USB-C 5V Adapter GNDEXT

22. Connections between "pull_red" and "ESP32"

Functionpull_redESP32
digitalP1 → USB-C 5V Adapter +5VEXT
digitalP2 → Microchip AT28C64B-15PU (DIP-28) 3EXT

23. Connections between "btn_green" and "ESP32"

Functionbtn_greenESP32
digitalSIGNAL → Microchip AT28C64B-15PU (DIP-28) 25EXT
groundGND → USB-C 5V Adapter GNDEXT

24. Connections between "pull_green" and "ESP32"

Functionpull_greenESP32
digitalP1 → USB-C 5V Adapter +5VEXT
digitalP2 → Microchip AT28C64B-15PU (DIP-28) 25EXT

25. Connections between "btn_blue" and "ESP32"

Functionbtn_blueESP32
digitalSIGNAL → Microchip AT28C64B-15PU (DIP-28) 24EXT
groundGND → USB-C 5V Adapter GNDEXT

26. Connections between "pull_blue" and "ESP32"

Functionpull_blueESP32
digitalP1 → USB-C 5V Adapter +5VEXT
digitalP2 → Microchip AT28C64B-15PU (DIP-28) 24EXT

27. Connections between "btn_off" and "ESP32"

Functionbtn_offESP32
digitalSIGNAL → Microchip AT28C64B-15PU (DIP-28) 21EXT
groundGND → USB-C 5V Adapter GNDEXT

28. Connections between "pull_off" and "ESP32"

Functionpull_offESP32
digitalP1 → USB-C 5V Adapter +5VEXT
digitalP2 → Microchip AT28C64B-15PU (DIP-28) 21EXT

29. Connections between "dac0" and "ESP32"

Functiondac0ESP32
digitalP1 → TI SN74HCT244N (DIP-20) 18EXT
digitalP2 → Resistor P1EXT

30. Connections between "dac1" and "ESP32"

Functiondac1ESP32
digitalP1 → TI SN74HCT244N (DIP-20) 16EXT
digitalP2 → Resistor P1EXT

31. Connections between "dac2" and "ESP32"

Functiondac2ESP32
digitalP1 → TI SN74HCT244N (DIP-20) 14EXT
digitalP2 → Resistor P1EXT

32. Connections between "dac3" and "ESP32"

Functiondac3ESP32
digitalP1 → TI SN74HCT244N (DIP-20) 12EXT
digitalP2 → Resistor P1EXT

33. Connections between "tx_limit" and "ESP32"

Functiontx_limitESP32
digitalP2 → Vishay TSAL6200 CATHODEEXT

Deploy the firmware

#include <Arduino.h>
constexpr int8_t cosine[] = {8,6,0,-6,-8,-6,0,6};
constexpr int8_t sine[] = {0,6,8,6,0,-6,-8,-6};
constexpr uint8_t leds[] = {18,19,23}, codes[] = {0x39,0xA6,0x5B,0xC4};
void waitFor(uint32_t t) { while (int32_t(micros()-t)<0) {} }
struct IQ { int32_t i,q; };
IQ readSymbol(uint32_t t, uint16_t slot) {
  IQ r={0,0};
  for (uint8_t n=0;n<16;++n) {
    waitFor(t+uint32_t(n)*slot+slot/2);
    int x=analogRead(32);
    r.i+=int32_t(x)*cosine[n%8]; r.q+=int32_t(x)*sine[n%8];
  }
  return r;
}
int nearest(float a) {
  int k=a < -2 ? 0 : a < 0 ? 1 : a < 2 ? 2 : 3;
  return fabs(a-(2*k-3)) <= 0.85f ? k : -1;
}
void receive(uint32_t t, uint16_t slot) {
  auto ref=readSymbol(t,slot); t+=16UL*slot;
  float ri=ref.i, rq=ref.q, mag=ri*ri+rq*rq;
  if (mag<40000) return;
  uint16_t data=0;
  for (uint8_t n=0;n<4;++n,t+=16UL*slot) {
    auto r=readSymbol(t,slot);
    float re=(r.i*ri+r.q*rq)/mag, im=(r.q*ri-r.i*rq)/mag;
    int i=nearest(3*(re-im)), q=nearest(3*(re+im));
    if (i<0 || q<0) return;
    data=(data<<4)|(i<<2)|q;
  }
  uint8_t code=data>>8;
  if (uint8_t(data)!=uint8_t(~code)) return;
  for (uint8_t k=0;k<4;++k) if (code==codes[k]) {
    for (uint8_t j=0;j<3;++j) digitalWrite(leds[j],j==k);
  }
}
void setup() { analogReadResolution(10); analogSetPinAttenuation(32, ADC_11db); for (auto p:leds) pinMode(p,OUTPUT); }
void loop() {
  static int32_t baseline=-1;
  int x=analogRead(32);
  if (baseline<0) baseline=int32_t(x)*256;
  int dark=baseline/256;
  if (dark-x<18) { baseline+=(int32_t(x)*256-baseline)/16; return; }
  uint32_t start=micros();
  int peak=dark-x;
  while (micros()-start<22000) {
    int depth=dark-analogRead(32);
    uint32_t end=micros();
    if (depth>peak) peak=depth;
    if (depth<peak*4/5) {
      uint32_t duration=end-start;
      if (duration>=5000 && duration<=20000 && peak>=40) {
        uint16_t slot=duration/16;
        receive(end-100,slot);
      }
      break;
    }
  }
  // Wait for the rest of a partial or valid packet before looking for another marker.
  while (micros()-start<55000 && dark-analogRead(32)>8) {}
}
// Receiver wiring: detector on GPIO32, indicators on GPIO18, GPIO19 and GPIO23.

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik