How to Make an ESP32 Smart Home Automation System Using KME Smart

by Pro Maker_101 in Circuits > Electronics

25 Views, 1 Favorites, 0 Comments

How to Make an ESP32 Smart Home Automation System Using KME Smart

This DIY Wireless Device That Makes Life Easier

In this project, I will show you how to build an ESP32-based smart home automation system using KME Smart Control relays. This system allows you to control home appliances using manual switches, a mobile app, and an IR remote from anywhere.

I used KME Smart Control for reliable relay control, along with an IR hub to control a BLDC fan with speed control.

The project also includes a DHT11 temperature and humidity sensor for environmental monitoring.This DIY project is simple, safe, and beginner-friendly, making it perfect for anyone interested in smart home automation.

Supplies


  1. ESP32 Development Board
  2. Custom PCB (From NEXTPCB)
  3. HF46F 5V Relays
  4. ULN2003 Driver IC
  5. Optocouplers (PC817) – 4 Nos
  6. DHT11 Temperature & Humidity Sensor
  7. TSOP1738 IR Receiver
  8. IR Transmitter LED
  9. Hi-Link 5V AC–DC Power Supply Module
  10. Resistors:
  11. 330Ω – 4 Nos
  12. 4.7kΩ
  13. 1kΩ Resistor Array
  14. Diodes (1N4007) – 4 Nos
  15. Manual Switches
  16. Terminal Blocks
  17. Connecting Wires

Order Custom PCB From NextPCB

IMG_3447.PNG
IMG_3448.PNG
Screenshot 2026-01-01 at 7.43.39 PM.png
Screenshot 2025-12-21 at 9.41.29 AM.png

After completing the PCB design, the Gerber files were sent to NextPCB, and an order was placed for a White solder mask with Black silkscreen.

Click the NextPCB link below & Get instant Quote NOW:https://www.nextpcb.com/?code=Promaker101

The PCBs were delivered within a week, and the quality was excellent — clean silkscreen, precise solder masks, and accurate dimensions.

In addition, I want to introduce HQDFM, NextPCB’s free Design for Manufacturing (DFM) software, which has been extremely helpful in my projects. HQDFM allows PCB designers to visualize and verify their designs before production, saving time and avoiding potential errors.

https://www.nextpcb.com/dfm


💡 Tips

  1. HQDFM offers online Gerber viewing and basic DFM reports, which are great for quick checks.
  2. For full DFM analysis and PCBA insights, download the desktop version.
  3. Using HQDFM ensures your designs are optimized for manufacturing and reduces production errors.

With over 15 years of PCB industry experience, NextPCB and HQDFM are reliable tools for budget-friendly, high-quality PCB production — a great way to bring your ideas to life efficiently!

📎 Circuit diagram and Gerber files are attached for reference.

Place All Components on the PCB

IMG_3449.PNG
IMG_3450.PNG
IMG_3451.PNG
IMG_3452.PNG
IMG_3453.PNG
IMG_3454.PNG
IMG_3455.PNG
IMG_3458.PNG

Place all components on the custom PCB according to the circuit diagram.


Start with resistors and diodes, followed by ICs, optocouplers, and ULN2003.

Then place the HF46F 5V relays, ESP32, IR receiver, IR transmitter, and terminal blocks.


Before soldering, always check the orientation of each component.


🔧 Use of Each Component


  1. ESP32 – Main controller with WiFi, handles logic, relays, and IR control
  2. HF46F 5V Relays – Switch AC/DC loads safely
  3. ULN2003 IC – Drives relay coils and protects ESP32 pins
  4. Optocouplers (PC817) – Provide electrical isolation for safety
  5. TSOP1738 IR Receiver – Receives IR remote signals
  6. IR Transmitter LED – Sends IR commands to control BLDC fan
  7. Hi-Link 5V Power Module – Converts AC mains to stable 5V DC
  8. Diodes (1N4007) – Flyback protection for relay coils
  9. 330Ω Resistors – Current limiting for optocoupler LEDs
  10. 4.7kΩ Resistor – Sensor/data line stabilization
  11. 1kΩ Resistor Array – Pull-up and signal conditioning
  12. Terminal Blocks – Safe and easy wiring connections

Solder All Components

IMG_3459.PNG
IMG_3460.PNG
IMG_3461.PNG
IMG_3462.PNG
IMG_3463.PNG

Once all components are placed correctly on the PCB, it’s time to solder them.


  1. Trim the excess legs of components after inserting them into the PCB.
  2. Solder each pin carefully, making sure the joints are shiny and solid.
  3. After soldering, use a brush and isopropyl alcohol (IPA) to clean the PCB. This removes flux residue and keeps your board neat.
  4. Inspect all solder joints to ensure there are no short circuits or cold joints

💡 Tips

  1. Solder small components first, then ICs, relays, and larger components.
  2. Keep high-voltage (relay) and low-voltage (ESP32) areas separate.
  3. Use enough flux if needed for better soldering.
  4. Work in a well-ventilated area when using IPA.


Connect the DHT11 Sensor

IMG_3470.PNG
IMG_3472.PNG
IMG_3473.PNG

For accurate temperature and humidity readings, especially if the sensor is placed outside the main PCB:

  1. Connect the DHT11 sensor wires to the PCB terminals according to the circuit diagram.
  2. Make sure the wires are long enough to place the sensor in the desired location.
  3. For the 3 DHT11 pins, ensure no short circuits.
  4. Use sleeving / heat shrink tubing on each pin to prevent accidental contact.
  5. Double-check the data, VCC, and GND connections before powering up.


Make Enclosure for the PCB

IMG_3474.PNG
IMG_3475.PNG
IMG_3476.PNG

After assembling and testing the PCB, it’s time to make a protective enclosure:

  1. Measure the PCB size accurately, including height with components.
  2. I used 3mm acrylic sheets laser-cut from a shop to make a custom enclosure.
  3. You can also use a 3D printer to make the case.
  4. Make sure to cut holes for terminals, IR receiver, and IR transmitter so wires and signals can pass through easily.
  5. Assemble the enclosure, keeping the PCB secure inside without pressing on the components.


Program the ESP32 Using KME Smart

IMG_3477.PNG
IMG_3478.PNG
IMG_3479.PNG
IMG_3480.PNG
IMG_3481.PNG
IMG_3482.PNG

Now that your PCB and enclosure are ready, it’s time to program the ESP32 and configure the dashboard:


  1. Connect the ESP32 to your PC using a USB cable.
  2. Open the KME Smart and download the KME Config Tool for Windows
  3. Launch the KME Config Tool.
  4. Select the correct COM port for your ESP32.
  5. Configure the firmware update and click Upload.
  6. Wait until it reaches 100% completion.
  7. After firmware update, you can add the layout in the app:
  8. Set up relays, IR hub, DHT11 sensor (temperature & humidity), and other devices.
  9. Configure input and output pins according to your circuit connections.
  10. Once all settings are done, click the Upload button in the tool to finalize the setup.


Final Setup and Test With KME Smart App

IMG_3483.PNG
IMG_3484.PNG
IMG_3485.PNG
IMG_3486.PNG
IMG_3487.PNG
IMG_3489.PNG
IMG_3490.PNG

Now that the ESP32 is mounted on the PCB using the female headers, we can do the final testing and setup:


  1. Connect the power supply:

  2. Connect the L (live) and N (neutral) wires to the PCB terminal block.
  3. Make sure the connections are secure and insulated.
  4. Install the KME Smart App:

  5. Download from Google Play Store(Android) or Apple App Store.(IOS)
  6. Sign up or log in.


  1. Add your device:

  2. Click the “+” button in the app.
  3. Select Add Device.
  4. Enter your WiFi SSID and password.
  5. Click Next.


  1. Connect ESP32 via Smart Connect:

  2. Press the BOOT button on ESP32 for 2 seconds.
  3. The app will auto-connect the ESP32.
  4. Your layout (relays, IR hub, DHT11 sensor, etc.) will appear automatically from the configuration.


  1. Add BLDC fan remote control:

  2. On the IR Hub, add 6 switches in the KME app.
  3. Configure Switch 1:

  4. Press Speed 1 on the fan remote.
  5. ESP32 receives and stores this signal.

  6. Repeat for other speeds / switches if needed.
  7. Control via app:
  8. Now, when you click a switch in the KME app, the signal is sent via IR transmitter to the fan.

You can control the fan from anywhere — no physical remote is needed.


Connect Manual Switches and Control Anywhere

IMG_3491.PNG
IMG_3492.PNG
IMG_3493.PNG
IMG_3494.PNG
IMG_3496.PNG
IMG_3498.PNG
IMG_3499.PNG

Now that your ESP32 PCB and app are ready, we can connect manual switches and load terminals for full control:


  1. Connect Manual Switches:
  2. Connect one side of each manual switch to the input pins on your PCB.
  3. Connect the other side to the corresponding load terminals (lights, fan, etc.).
  4. Control Options:
  5. You can now control devices:
  6. Manually using switches
  7. Via KME Smart App from anywhere
  8. Using IR Hub for remote-controlled devices, like your BLDC fan


  1. How the IR Hub & Fan Works:
  2. The IR Hub receives input from the app or manual setup.
  3. When you click a switch in the app, the ESP32 sends the stored IR signal via the IR transmitter.
  4. The fan receives this signal and changes speed or turns on/off as configured.
  5. All signals are stored in ESP32 memory during setup, so no remote is needed anymore.


Watch and Enjoy

This DIY Wireless Device That Makes Life Easier

Your ESP32 smart home automation system is now fully set up and working!

  1. You can control devices manually, via the KME Smart App, or through the IR hub for remote-controlled fans.
  2. Check all relays, sensors, and switches to ensure everything works correctly.
  3. Now your home is smart, and you can control devices from anywhere.


🎥 Watch the detailed video demonstration here