In the year 2025, I have worked on projects that were in my mind since long time. Specifically, I wanted to work on PCB creation to hone my PCB design skills. I thought that LEDs would be a nice thing to start with. Apart from adding LEDs I decide to add some sensors to it. Such as Microphone and Accelerometer to make use of it to create ML models. At the same time, I wanted to explore different types of RGB LEDs provided by Wurth electronics.
So, I decided to create a PCB with ESP32-S3 based module. The Wroom-1 module has ESP32-S3 dual core SoC with different peripheral supports. Also, this device is more suitable for tiny-ml applications due to presence of hardware accelerator, FPU support and enough RAM memory support. It has WiFi and BLE connectivity that makes it possible to connect this device with phone or other applications to control the LEDs or other peripherals connected to it.
For the PCB design part I decided to use KiCad software. KiCad is open-source and has features that makes it possible to create from simple to more complex PCBs involving high speed interfaces and impedance-controlled tracks. As I wanted to create a 4-layer PCB, it was possible with KiCad free of charge to create a schematic and layout of the board. Once that is done, I can send my design files and BOM in a separate MS-Excel file to NextPCB to manufacture PCB for me.
Design in KiCadThe first part in KiCad is to create a schematic. It is a circuit diagram for our design.
The first part is to add the module and the required circuit diagram around the module. For any design, it is a good idea to follow the chip vendors recommendations for creating the circuit. For ESP32 Espressif has hardware design guides for the same. It would help to properly boot the dev kit and various other functions of the design. Mainly the following
- Properly controlling the boot mode of the device to boot from SPI flash or load new code.
- Control the impedance traces of USB differential pair to ~50 ohms.
- Add the auxiliary crystal clock and components such as decoupling capacitors around the module power traces.
- Connect appropriate pins from the module to the peripherals.
The next important part is to look at the power section of the PCB. This PCB will require 3.3V for ESP32 module. But at the same time, it requires 5V supply for the LEDs. This 5V we can get from the USB supply itself and use the same to convert to 3.3V power supply. In this design, I have used NCP1117 from on-semi to power supply the device. You can choose any device that fits to your need. One advantage of using LDO is that we are reducing complexity involved in the design of DC-DC converters circuits at the cost of less control on power supply functions.
The next section that is required and kind of must for the project is how to convert the voltage between 5V and 3V3? The answer is level convers like the TXS0108EPWR that could convert the required voltage levels.
These level converters on one side connect to ESP32-S3 GPIO pin that is 3v3 tolerant and on the other side it connects to 5V LED light. This way the data signal for RGB LEDs that is coming from I2C, SPI, I2S or any other interface capable of driving these LEDs and which can generate accurate signal gets through the LED chip.
Also, make sure that the level converter that you have selected is capable of handling high speed data at a given speed without deteriorating the original signal. (So that LEDs are properly started).
The following diagrams shows the LEDs are connected in series. There are some LEDs that require clock signal as well. Overall, this is similar to how you would use ws2812b kind of LEDs. I have used following LEDs from Wurth.
- Würth Elektronik 1315050930002
- Würth Elektronik 1313210530000
- Würth Elektronik 1312020030000
- Würth Elektronik 1312121320437
- Würth Elektronik 1315050930246
- Würth Elektronik 1311610030140
As I have mentioned before, I have sensors connected to ESP32 module. The sensors are Microphone (I2S) and IMU (I2C). The schematic is as follows.
After the schematic is completed, it is time to create layout in KiCad. I have used 4-layer design in KiCad.
After the layout the final step is to generate the Gerber files in KiCad and send that to NextPCB to create PCB.
After ordering the PCB I received the board in nice safe package from NextPCB. It has five PCB samples with two PCBA.
For most of my project requirements, I have used MicroPython as it is easy, efficient and fast to work with. Fortunately, there are plenty of open-source library already available for esp32.
You can download the firmware for Micropython and flash it to your board using the following two commands. I am using Windows cmd for doing that.
esptool erase_flash
esptool --baud 460800 write_flash 0 \ESP32_GENERIC_S3-20251209-v1.27.0.binOnce downloaded successfully, you can open a program like Thonny to start coding. Below is the result of simple Micro Python code that when run will turn on the LEDs with different colors.
There are many ways to control these RGB LEDs. It's not possible to test all the ways to control these LEDs in limited time. I have tried some and some I may try in the future. The one in bold format, I have tried.
- Using wireless technologies such as Bluetooth or Wi-Fi
- Using some motion or proximity-based solution such as PIR motion sensor
- Using Gesture based sensors such as camera or hand gesture sensors
- Using other radio technologies such as ESP-NOW and keyboard
- Voice controlled applications such as onboard microphone or Alexa integration
- Using some environment sensors data to visualize this on LEDs
1 > I have tried to create a simple code to control the LEDs using BLE application.
The application is able to control different colors of the LED light. Mainly, there are three BLE characteristics to control the color of the LED.
2 > These LEDs can also be controlled using ESP-Now. It is a connectionless wireless protocol to send data packets. Which eventually could be used to control the LEDs. Here is a simple demo to convert the LEDs using remote keypad, that sends data over peer t peer ESP-NOW connection.
3 > Gesture based LED light control.
It is possible to control the brightness of the LED using some gestures. For example, using some hand gestures. It is possible to also control different parameters of the LED light using gestures. I have trained a machine learning model using Edge Impulse and Seeed Grove Vision AI module to create a ML model that is able to control the brightness of the LEDs.
Five means increase the brightness.
Punch means decrease the brightness.
improve-grove-vision - Dashboard - Edge Impulse
Microphone interfaceI have attached stereo microphones to the device over I2S bus. I thought that this can be used to control the ESP32 using voice keyword commands. There are some options to train a ML model using the data collected from these microphones such as ESP-SR and ESP-ADF. There are many things that one can do with voice commands. Also, one can add Alexa skills to the device to have more control. Simply put the possibilities are endless.
Adding Effects to LEDsEffects are ways to make LEDs more interactive. There are many different kinds of effects that are possible with LEDs such as fading, cycling, breathing, etc. I have tried to include most of them in one code for simplicity.
Have a look
Creating 3D device Enclosure.One of the things that was missing in the end was to have a 3D printed enclosure. Hence, I used tinkercad.io to create a 3D model of the PCB. For transparent design, I used transparent material for top.














Comments