Introduction
The goal of this project was to create a circuit that uses wireless communication using two ESP32 microcontrollers. ESP32 boards have a special communication protocol called ESP-NOW, which allows them to send information to each other relatively easily. I wanted to control the color of an RGB LED using a remote control circuit. The LED would be connected to one ESP32, which in this case would be the receiver, and the control circuit would be connected to another ESP32, which would be the transmitter. An RGB LED contains a red, green, and blue LED inside of them. They are able to produce a wide range of colors by adjusting the ratio of the brightness of the red, green and blue light. The strength of each of these colors is usually represented by a number from 0 to 255. I wanted to change the LED color between red, green, and blue presets. I also wanted the ability to customize the color of the LED with any ratio of the three colors. I also wanted to have an LCD display for my transmitter that would show what mode the circuit was in, as well as the current red, green and blue values. This was my first time using ESP32 boards and LCD displays. Some resources that were very helpful for learning the ESP-NOW protocol and LCD displays can be found at the bottom of this page.
Design
An image illustrating the schematic diagram for the transmitter and receiver boards can be seen below. On the transmitter board, I have the red button, green button, blue button, and custom button connected to pins 33, 25, 26, and 27 respectively. I have three 10k Ohm potentiometers to determine the red, green, and blue values when the system is in custom mode. The first terminal is connected to 3.3 V, and the third terminal is grounded. The voltage reading is taken from the middle terminal. The very last button turns the LED off. I use the I2C communication protocol for the LCD display. VSS is grounded, VDD is connected to 5V. SDA, the data pin is connected to pin 21 and SCK, the clock pin, is connected to pin 22. The ESP32 designates these pins for I2C communication. On the receiver board, I connected the red pin of the RGB LED to pin 13 of the ESP32. I connect the green and blue pins to pin 12 and 14 respectively. I connect each of these pins in series with a resistor. These values were chosen experimentally to what I thought provided an appropriate balance of color once I finished the program and boards.

Program
Similar to the timer, the circuitry involved in this project is simple because the program on the microcontroller handles almost all of the logic. The circuitry I build can be simplified to just inputs, outputs, and displays. I developed and uploaded to program to the ESP32 using Arduino IDE. The program below is the sketch I uploaded to the ESP32 I used as a transmitter. Scroll through the PDF to view the whole program:
Below is the program I uploaded to my receiver ESP32:
Building

The image above shows my receiver board. The 1k resistor on top is connected to the red LED pin. The wire directly below it is connected to the common cathode of the RGB LED. The 3k resistor second from the bottom is connected to the green pin of the LED, and the 4.7k resistor is connected to the blue pin. The jumper cables in the image are connected to the pins of the microcontroller indicated in the design and the program above.

The image above shows my transmitter board. The controls on the board in descending order are the red button, the green button, the blue button, the custom mode button, the custom red control, the custom green control, the custom blue control, and the off button. The LCD display can be seen resting on the binding posts of the board, and the ESP32 can be seen resting half-off the top of the board.
Final Demo and Conclusion
In the video below, I demonstrate the project working. The system defaults to being off. I then click the red, green, and blue buttons in that order. After that, I click the custom button. When I do this, all of the potentiometers are set to read the minimum value of 0. I then increase the red potentiometer from 0 to 255. When the red potentiometer is at 255, I increase the green potentiometer from 0 to 255. When this happens the LED color ranges from red to orange to yellow. Once the green value is at 255, I decrease the red value from 255 to 0. After this, I increase the blue value from 0 to 255. This causes the color to change to turquoise. When the blue value is at 255, I decrease the green from 255 to 0. Then I increase the red from 0 to 255, to create purple. After this, I decrease blue from 255 to 0, which makes the light pink before going back to red. After this, I turn up the green and blue LEDs to create a color that is closest to white.

I was very happy to have completed this project because I've never used an ESP32 or an LCD display before. I've also never used a 2.4 GHz band for wireless communication either. One thing I would change is I would invest in better RGB LEDs. The emitters for each color are rather large. Because of this, the colors didn't blend quite as well as I would like them to. Now I want to do a project where I use a Bluetooth connection or connect the ESP32 to an actual WiFi network. The ability of the board to do these things makes it far more interesting to me than the Arduino Uno.
