This is the board of raspberry pi. The raspberry pi has 40 pins and it has 26 GPIO pins and 3 power and many other pins.
Here the pin description of Raspberry Pi:-
LED Blinking using a Raspberry Pi is a simple and popular project for beginners in the field of electronics and programming. It involves connecting an LED to one of the GPIO (General Purpose Input/Output) pins of the Raspberry Pi and controlling its on and off state using Python programming.
Here are the steps to perform LED Blink using a Raspberry Pi
- Gather the required components: Raspberry Pi board, breadboard, LED, resistor (220 Ohm), jumper wires.
- Connect the LED to the breadboard. Connect the anode (longer leg) of the LED to the positive rail of the breadboard, and connect the cathode (shorter leg) of the LED to a 220 Ohm resistor.
- Connect one end of the resistor to the cathode of the LED and the other end to the negative rail of the breadboard.
- Connect the jumper wires to the GPIO pin of the Raspberry Pi. Use a female to male jumper wire to connect the positive rail of the breadboard to the 3.3V pin of the Raspberry Pi. Use another female to male jumper wire to connect the negative rail of the breadboard to the GND pin of the Raspberry Pi.
- Connect a male to male jumper wire to the GPIO pin that you want to use for the LED. Connect the other end of the jumper wire to the anode of the LED.
- Open the Python editor on the Raspberry Pi and write the Python code to control the GPIO pin. Here is a sample code to blink an LED connected to GPIO pin 17:
Save the Python file and run it using the commandpython filename.py
in the terminal. - Save the Python file and run it using the command
python filename.py
in the terminal. - The LED connected to the GPIO pin 17 will blink on and off every second.
Note: Always use a resistor in series with the LED to limit the current flowing through the LED and prevent it from burning out. Also, be careful while connecting the components to the Raspberry Pi and follow the proper wiring diagram to avoid damaging the board.
Comments