GithubHelp home page GithubHelp logo

simple-rpi-led-project's Introduction

Simple Raspberry Pi LED Project

A basic Raspberry Pi project to control two LEDs (red and green) using GPIO pins.

Contents

Introduction

This project demonstrates how to control two LEDs connected to GPIO pins on a Raspberry Pi. The LEDs (red and green) alternate between being turned on and off in a continuous loop.

Prerequisites

Hardware Requirements

  • Raspberry Pi (any model with GPIO pins, I have used Raspberry Pi Model B with 512 MB memory)
  • Breadboard
  • Two LEDs (red and green)
  • Two Resistors (appropriate values for the LEDs, > 200 ohms should provide a safe current for the LED)
  • Jumper wires

Software Requirements

  • Raspbian OS installed on your Raspberry Pi
  • Python installed on your Raspberry Pi
  • Basic knowledge of Raspberry Pi GPIO and Python

Hardware Setup

  1. Identifying GPIO's on your RPi:

    a. The first step in identifying GPIO pins is to refer to the pinout diagram of your specific Raspberry Pi model. Pinout diagrams provide a visual representation of the Raspberry Pi's GPIO pins, their numbers, and their corresponding functions. You can find official pinout diagrams on the Raspberry Pi website

    b. More info at pinout.xyz

  2. Connect LEDs to GPIO pins:

    a. Connect the anode (longer leg) of the green LED to GPIO pin 17.

    b. Connect the cathode (shorter leg) of the green LED to a resistor (e.g., 220 ohms).

    c. Connect the other end of the resistor to the ground (GND) pin on the Raspberry Pi.

    d. Connect the anode of the red LED to GPIO pin 27.

    e. Connect the cathode of the green LED to a resistor (e.g., 220 ohms).

    f. Connect the other end of the resistor to the ground (GND) pin on the Raspberry Pi.

  3. Ensure proper connections:

    • Double-check your wiring to ensure all connections are secure.
    • Confirm that the GPIO pins match the ones specified in the code.

Hardware setup:

Hardware setup

Installation and Usage

  1. Move to a folder where you want to copy the project folder on Raspberry Pi.
    Clone the repository to your Raspberry Pi:

    git clone https://github.com/nithishravella10/simple-rpi-led-project.git
    
  2. Navigate to the project directory:

    cd simple-rpi-led-project
    
  3. Run the project:

    python simple-rpi-led-project-rev1.py

Conclusion

This simple Raspberry Pi LED project demonstrates the basics of controlling LEDs using GPIO pins. Through the hardware setup and code implementation, you've gained hands-on experience with Raspberry Pi GPIO and Python programming. Next step is to try something more advanced, like controlling these LEDs remotely. Keep exploring and use ChatGPT for more fun!

simple-rpi-led-project's People

Contributors

nithishravella10 avatar

Watchers

 avatar

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.