Coder Social home page Coder Social logo

jayesh-jainx / esp8266-led-interfacing-with-button Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8.05 MB

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.

License: MIT License

C++ 100.00%
arduino esp8266 iot-projects iotproject microcontroller programmingproject wifi embeddedproject iotdevelopment electronicsproject led led-controller led-interface nodemcu-esp8266

esp8266-led-interfacing-with-button's Introduction

ESP8266 LED Interfacing with Button ๐Ÿ’ก๐Ÿ”˜

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.


Connection Diagram


                               _____________________
                              |          |          |
                              |    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)

Setup Steps ๐Ÿ› ๏ธ

Follow these steps to set up the circuit:

1. Circuit Connection

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.

2. Components Required ๐Ÿงฐ

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
  • LEDs: For lighting effects.
    • Specifications:
      • Type: 3.3V LEDs (Red, Green, Blue, Yellow)
  • Push Button: For mode switching.
  • Male to Male Jumper Wires: For connecting components.

Connecting LEDs on Breadboard ๐Ÿž๐Ÿ’ก

To connect LEDs on a breadboard, follow these steps:

  1. 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.
  2. Connect the positive (longer) lead of each LED to a digital pin on the ESP8266 board (D1, D2, D3, D5).
  3. 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.

Components ๐Ÿงฉ

Wemos ESP8266 Wi-Fi Board (D1 R1) ๐Ÿ’ก

This directory contains information about the ESP8266 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

For more details, refer to Wemos ESP8266 Wi-Fi Board (D1 R1) Details

LED ๐Ÿ’ก

This directory contains information about the LEDs used in the project.

Specifications

  • Type: 3.3V LEDs (Red, Green, Blue, Yellow)

For more details, refer to LED Details

Push Button ๐Ÿ”˜

This directory contains information about the push button used in the project.

For more details, refer to Push Button Details

Male to Male Jumper Wires ๐Ÿš€

This directory contains information about the male to male jumper wires used in the project.

For more details, refer to Jump Wires Details

Breadboard ๐Ÿž

This directory contains information about the breadboard used in the project.

Specifications

  • 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

Code ๐Ÿ’ป

Arduino Software

Before uploading the code to the ESP8266 board, make sure you have the Arduino software installed. You can download it from the Arduino website.

Uploading Code

  1. Open the Arduino software.
  2. Connect your ESP8266 board to your computer using a USB cable.
  3. Select the correct board and port from the Tools menu.
  4. Open the Arduino code file LED_Button_Interfacing.ino from this repository.
  5. 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.

Screenshots ๐Ÿ“ธ

Connection Diagram

License ๐Ÿ“

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.