6142

This ESP32-C3 Color Detector demonstrates how accurate and efficient color recognition can be achieved using a dedicated TCS34725 optical sensor. With real-time RGB detection, instant LED feedback, and a wireless smartphone interface, the project provides a practical and low-cost solution for a wide range of embedded electronics applications.

 Color detection is a fundamental task in many embedded systems – from industrial sorting machines to smart home lighting and DIY electronics. When using a microcontroller (MCU) like the ESP32, there are two common approaches:
  1. Camera‑based detection
  2. and Optical sensors with integrated color filters
 The first system uses a camera module to capture an image, then the MCU or a connected computer runs algorithms. This way consumes much more processing power, memory, and energy. Optical sensor contain photodiodes with red, green, blue, and clear filters, plus an analog-to-digital converter. The MCU reads the intensity of each channel via I²C.
This method is fast, low‑power, and works well, and no complex image processing is required. The project presented in this video uses a second, more efficient approach, using a dedicated color sensor to achieve real-time, accurate readings with minimal resources.
parts-20260717131037.jpg
  The hardware implemented in this project is:
  - ESP32‑C3 – a compact, Wi‑Fi enabled RISC‑V chip. It handles sensor reading, PWM generation for the RGB LED, and runs a web server.
  - Color sensor board TCS3472 which should be close to the target object to exclude ambient light. The sensor has a built-in white LED to illuminate the sample.
  - A common‑cathode RGB LED connected to three PWM pins. The LED mirrors the detected colour, providing immediate visual feedback.
  - And Smartphone connected to Wi-Fi Acces point created by ESP32C3

inside-20260717131105.jpg

The components are mounted in a suitable housing and the sensor is protected from external light influence. As for the code, it consists of two parts. Calibration code and functional code.
codes.jpg
The calibration code is used in a way that a white paper is placed in front of the sensor, and the values ​​for R, G and B are recorded on the Serial Monitor. Then these values ​​are placed in the main code at the beginning where the constants are defined. The main code has a part for controlling the sensor and the local RGB LED, as well as generating a web interface for displaying the results on a smartphone.
  Now let's see how the device works in real conditions. By turning on the device, the white LED inside the sensor is activated, whose function is to illuminate the object in order to read its color. The detected color is immediately displayed on the RGB LED placed close to the sensor.
on-led.jpg
The device also has the option to display the result on a smartphone. For this purpose, we need to connect the smartphone to the Wi-Fi network with the name "ESP32_Color_Detector" and the password "12345678". Now we need to enter the address of the access point generated by ESP32 in a web browser, which is 192.168.4.1. Here a graphical interface opens where we can see the read color as well as the individual values ​​of the Red, Green and Blue colors. in a range from 0 to 255.
on-smartphone.jpg
On the lower half of the display we also have a graphical display of these values ​​and their representation in terms of wavelength.
And finally a short conclusion. This efficient ESP32-C3 color detector utilizes a dedicated TCS3472 optical sensor to provide fast, real-time, and accurate color readings without demanding heavy processing power. With its instant local RGB LED feedback and an interactive smartphone web interface, the project serves as a highly practical and low-power solution for embedded color detection.