This is a project to create a smart LED Reading Light using an ESP32 Devkit1. It will allow you to control the on/off state and brightness level of an LED strip, making it an ideal solution for a reading light in your bedroom. This README includes the steps for setting up the project, including the necessary code and hardware setup.
- On/Off control.
- Brightness control (+ and - buttons).
- ESP32 Devkit1
- LED strip
- 3 push-buttons
- Resistors
- Breadboard and wires
A detailed schematic of how to connect the LED strip and the push buttons to the ESP32 Devkit1 will be added here.
- PlatformIO IDE
- ESP32 Board definitions for PlatformIO IDE
- LED Control library (recommend FastLED)
Source code files are available in the src
directory of this repository.
-
Install PlatformIO IDE: Download and install the PlatformIO IDE from PlatformIO's official website.
-
ESP32 Board definitions: Add ESP32 board definitions to your PlatformIO IDE. Follow this guide for detailed instructions.
-
Download and Install Libraries: Open PlatformIO IDE and navigate to PIO Home > Libraries. Search for
FastLED
and install the latest version. -
Load Source Code: Clone this repository and open the PlatformIO project located in the
src
directory in PlatformIO IDE. -
Upload the Code: Connect the ESP32 Devkit1 to your computer using a USB cable. Select the correct board (
esp32dev
) and port, then click onUpload
.
- Press the On/Off button to toggle the LED strip on or off.
- Use the + and - buttons to increase or decrease the brightness of the LED strip.
If you encounter any problems, please check the following:
- Connections: Ensure all hardware components are properly connected as per the schematic.
- Code Upload: Ensure there are no errors during code upload.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to reach out if you have any questions or need further assistance in setting up this project.