The goal is: a wifi control-unit for LED panels that are operated with an infrared remote control. The controller reacts to MQTT commands (on, off, etc.) and cyclically reports the brightness of the room.
I recently saw a interesting LED panel in the online store of Mömax (order the panel here | This hack will work with most infrared controlled LED panels). Briefly the facts about the panel:
- Name: Cornelius
- Article nr: 8227071401
- 40 watts
- 3000k – 6000k
- 3400 lm
- dimmable
The only problem: The thing is not smart at all and could only be operated by a infrared remote control. For 79€ still a good deal… and we’ll bring intelligence into the lamp with this circuit.

So what do you see here?
- U1 is a Wemos D1 mini.
https://wiki.wemos.cc/products:d1:d1_mini - U2 is a Gy-030 Lux sensor for measuring light intensity (I had this laying around. You can use whatever sensor you want.) Get one here!
- R1, R2 (value depending on your ir LED’s), R3 (value depending on the transistor you’ll use) are , you guessed it, resistors 🙂
- Q1 is a transistor
- DC1 is a power jack

How it works:
The Wemos D1 sends the brightness levels to your smart home at intervals. At the same time, the D1 subscribes to a topic and listens for changes in this topic. When the smarthome sends a command (on, off, brighter, darker etc.) to the controller, a corresponding infra-red code is transmitted to the panels via the IR-LEDs. The brightness sensor monitors whether all this has worked.
#include <Arduino.h> #include <IRremoteESP8266.h> #include <ESP8266WiFi.h> #include <WiFiClient.h> #include <IRsend.h> #include <Wire.h> #include <PubSubClient.h> //enter you wifi credentials and mqtt broker ip address below const char* SSID = "your_ssid"; const char* PSK = "your_password"; const char* MQTT_BROKER = "1.1.1.1"; byte gy30ICAdress = 0x23; //Adress of the brightness sensor byte buffer[2]; //Array to buffer values const uint16_t kIrLed = 15; // ESP8266 GPIO pin to use for turning leds on and off (D2). 15 IRsend irsend(kIrLed); // Set the GPIO to be used to sending the message. WiFiClient espClient; PubSubClient client(espClient); char msg[50]; unsigned long lastMsg = 0; //pretty straight forward... let's connect to a wifi / wait until //we're connected. void setup_wifi() { delay(10); Serial.println(); Serial.print("Connecting to "); Serial.println(SSID); WiFi.begin(SSID, PSK); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } //before we're collectiong data from the light sensor, //we need to initialize it void initSensor(){ Wire.beginTransmission(gy30ICAdress); Wire.write(0x10); //set the accuracy of the sensor Wire.endTransmission(); } //here we handle messages received by the mqtt broker void callback(char* topic, byte* payload, unsigned int length) { Serial.print("Received message ["); Serial.print(topic); Serial.print("] "); char msg[length+1]; for (int i = 0; i < length; i++) { Serial.print((char)payload[i]); msg[i] = (char)payload[i]; } Serial.println(); msg[length] = '\0'; Serial.println(msg); if(strcmp(msg,"on")==0){ irsend.sendNEC(0x44BB30CF); Serial.println("Sent LEDS on"); } else if(strcmp(msg,"off")==0){ irsend.sendNEC(0x44BB8877); Serial.println("Sent LEDS off"); } } void setup() { Serial.begin(115200); irsend.begin(); Wire.begin(); initSensor(); setup_wifi(); client.setServer(MQTT_BROKER, 1883); client.setCallback(callback); } int readSensor(){ byte value = 0; Wire.beginTransmission(gy30ICAdress); Wire.requestFrom(gy30ICAdress, 2); while(Wire.available()) { buffer[value] = Wire.read(); value++; } Wire.endTransmission(); return value; } //here we read the sensor data int getSensorValue(){ int value = 0; if (readSensor() == 2){ value = ((buffer[0] << 8) | buffer[1]); Serial.println(value); } return value; } //we are (re)connecting to wifi and the broker and subscribe //to basement/office/toplight topic void reconnect() { while (!client.connected()) { Serial.print("Reconnecting..."); if (!client.connect("ESP8266Client")) { Serial.print("failed, rc="); Serial.print(client.state()); Serial.println(" retrying in 5 seconds"); delay(5000); } } client.subscribe("/basement/office/toplight"); Serial.println("MQTT Connected..."); } void loop() { if (!client.connected()) { reconnect(); } client.loop(); unsigned long now = millis(); if (now - lastMsg > 3000) { lastMsg = now; itoa(getSensorValue(), msg, 10); client.publish("/basement/office/lightintensity", msg); } }
We’re using this libraries for our sketch:
- PubSubClient by Nick O’Leary
- IRremoteESP8266 by David Conran
Ok, but how do I know which data I need to send via IR you may ask? Good question! Many cheap panels are using the NEC standard. I reverse-engineered the codes for my panel with the original remote. Here are the codes i’m using:
44BB30CF Turn on
44BB8877 Turn off
44BB18E7 Brighter
44BBF807 Darker
44BBE01F more cold
44BBF00F more warm
What is missing? Yes… a nice case for our controller. I came up with the following design:

After etching and soldering the PCB and printing the case:

Btw… I used four LED’s because I have four panels in my office. An here we go… we made our panels smart. It’s an easy task, to control the panel with any kind of smarthome, now!
Have fun!