Introduction
This article demonstrates how to make a smart traffic system using Raspberry Pi and Python.
Learn how to use the GPIO pins on your Raspberry Pi to interface with electronic components, such as LEDs, Buzzer and buttons.

Prerequisite
Hardware
As well as a Raspberry Pi with an SD card and the usual peripherals, you'll also need:
- 1x Solderless breadboard
- All king of jumper leads
- 1x Tactile button
- 3x LEDs (Red, Green, and Yellow)
- 3x 330 ohm Register
- Buzzer
- Button
Software
Raspberry Pi needs NOOBS OS. NOOBS is a way of making setting up a Raspberry Pi for the first time much, much easier. You won't need network access, and you won't need to download imaging software. Just head to the download page, grab a copy of the NOOBS zip file and unpack it onto a freshly formatted 4GB (or larger) SD card. Once you have installed an operating system, your Pi will boot as normal.

GPIO pins
One powerful feature of the Raspberry Pi is the row of GPIO pins along the top edge of the board. GPIO stands for General-Purpose Input/Output. These pins are a physical interface between the Raspberry Pi and the outside world.

If you don't have a pin label, then this can help you to identify the pin numbers

3.3 volts
Anything connected to these pins will always get 3.3 v of power.
5 volts
Anything connected to these pins will always get 5 v of power.
GND
Zero volts, used to complete a circuit
GPIO
These pins are for general-purpose use and can be configures as input or output pins
ID_SC/ID_SD/DNC
Special purpose pins.
Lighting an LED
LEDs are delicate little things. if you put too much current through them they will pop. To limit the current going through the LED, you should always use a register in series with it.
Long leg an LED to the Pi 3.3v and the short leg to a GND pin. Automatically LED will turn ON

If you connect special purpose(GPIO) pin are connect to a long leg, make sure to write the import code.

Switching an LED on and off
GPIO Zero is a new Python library which provides a simple interface to everyday GPIO component. It comes installed by default in Rasbian.
Open IDLE(Integrated Development Environment), which you can use to write and run code.





Hadshana KamalanathanPosted Jul 21, 2018, 10:25 AM
Thanks for sharing
Amir KhanPosted Jan 25, 2018, 5:43 AM
Best of luck ravi....you are doing well
Reshwanth SPosted Dec 29, 2017, 7:58 AM
Good information bro thanks for sharing it