This project demonstrates interfacing LEDs with a push button using an ESP8266 (D1 R1). The LEDs are connected to pins D1, D2, D3, and D5, while the push button is connected to pin D4 for changing LED lighting modes.
_____________________
| | |
| D1 | D2 |
|__________|__________|
| | |
| D3 | D6 |
|__________|__________| ____________
| | | | |
| D4 | GND |---------- | ESP8266 |
|__________|__________| |____________|
- D1, D2, D3, D5: Pins connected to LEDs.
- D4: Pin connected to the push button.
- GND: Ground connection.
- ESP8266: Wemos ESP8266 Wi-Fi Board (D1 R1)
Follow these steps to set up the circuit:
Connect the components as follows:
- Connect LEDs (3.3V Red, Green, Blue, Yellow LEDs) to pins D1, D2, D3, and D5 on the ESP8266 board.
- Connect the push button to pin D4 on the ESP8266 board.
- Connect the negative (shorter) lead of each LED to the ground (GND) on the breadboard to complete the circuit.
For detailed connections and pinouts, refer to the component directories in the components
folder.
You will need the following components:
- Wemos ESP8266 Wi-Fi Board (D1 R1): Microcontroller board.
- Specifications:
- Microcontroller: ESP8266 (D1 R1)
- Clock Speed: 80MHz (up to 160MHz)
- USB Converter: CH340G
- Operating Voltage: 3.3V
- Flash Memory: 4MB
- Digital I/O: 11
- Analog Inputs: 1
- Communications: I2C, Serial, SPI
- WiFi: Built-in
- Specifications:
- LEDs: For lighting effects.
- Specifications:
- Type: 3.3V LEDs (Red, Green, Blue, Yellow)
- Specifications:
- Push Button: For mode switching.
- Male to Male Jumper Wires: For connecting components.
To connect LEDs on a breadboard, follow these steps:
- Insert the LEDs into the breadboard, ensuring the longer lead (positive) is on one side and the shorter lead (negative) is on the other side.
- Connect the positive (longer) lead of each LED to a digital pin on the ESP8266 board (D1, D2, D3, D5).
- Connect the negative (shorter) lead of each LED to the ground (GND) on the ESP8266 board.
For detailed specifications and connection diagrams of LEDs, refer to the LED component directory in the components
folder.
This directory contains information about the ESP8266 microcontroller board.
- Microcontroller: ESP8266 (D1 R1)
- Clock Speed: 80MHz (up to 160MHz)
- USB Converter: CH340G
- Operating Voltage: 3.3V
- Flash Memory: 4MB
- Digital I/O: 11
- Analog Inputs: 1
- Communications: I2C, Serial, SPI
- WiFi: Built-in
For more details, refer to Wemos ESP8266 Wi-Fi Board (D1 R1) Details
This directory contains information about the LEDs used in the project.
- Type: 3.3V LEDs (Red, Green, Blue, Yellow)
For more details, refer to LED Details
This directory contains information about the push button used in the project.
For more details, refer to Push Button Details
This directory contains information about the male to male jumper wires used in the project.
For more details, refer to Jump Wires Details
This directory contains information about the breadboard used in the project.
- Type: Full-size Breadboard
- Total Holes: 830
- Spacing: 2.54mm (0.1")
- Dimension: 16.5x5.5cm
- Common Rating: 1A @ 5V or 5 Watt
For more details, refer to Breadboard Details
Before uploading the code to the ESP8266 board, make sure you have the Arduino software installed. You can download it from the Arduino website.
- Open the Arduino software.
- Connect your ESP8266 board to your computer using a USB cable.
- Select the correct board and port from the Tools menu.
- Open the Arduino code file
LED_Button_Interfacing.ino
from this repository. - Click the Upload button to compile and upload the code to your ESP8266 board.
Make sure your code is properly commented and formatted for better understanding.
The Arduino code for this project can be found here.
Make sure your code is properly commented and formatted for better understanding.
This repository is open-source and is licensed under the MIT License. Feel free to use, modify, and share these programs as you see fit. Refer to the LICENSE file for full details.
Disclaimer: The code provided in this repository is for educational purposes. While efforts have been made to ensure correctness, it may not be suitable for production use. Use the code at your own risk.