Introduction: Your First Project in Raspberry Pi | LED Blinking

Picture of Your First Project in Raspberry Pi | LED Blinking

If you are new to Raspberry Pi, then you are in the right place. Here in this tutorial, we will do our first Raspberry Pi project. Whenever we learn some new programming language, we do the "Hello World" program to get started. But for electronics, LED blinking is the most fundamental program to start with.

Before we proceed, we would like to clarify some points:

  1. We will be using Raspberry Pi 3. But the process will be same for all other versions of Raspberry Pi.
  2. We will use Raspbian OS in Pi, But you can use any other OS also.
  3. If you have just bought a Raspberry Pi and don't know anything, then go through the links given below. We have made other tutorials also about monitoring the desktop or installing the operating system.
  4. Check our website for more projects and tech feeds. We have recently launched it in Diwali. Hope you will like it. www.being-engineers.com
  5. If you like to check out Raspberry Pi in details, then go to this link - http://being-engineers.com/lets-gets-started-with-...
  6. We have made a separate video demonstrating the whole process step by step. So you can watch that also for reference. -

LINKS

So, let's begin.

Step 1: Things You Will Need

Picture of Things You Will Need

You will need the following components other than Raspberry Pi setup.

  1. Blue 5mm led (X1)
  2. 100

    Resistor (X1)
  3. Jumper wires
  4. Breadboard

Here is the buying link for Raspberry Pi : http://amzn.to/2eangv9

Step 2: Setup Your Pi and Do the Wiring

Picture of Setup Your Pi and Do the Wiring

Follow the following steps -

  • Install OS in SD Card and insert it in Pi.
  • Connect mouse and keyboard to the Raspberry Pi.
  • Connect a monitor (Or you can use other devices as a monitor using WiFi network. Go to the links given above to know more).
  • Power up the device.
  • Connect two jumpers at Pin 3 and Pin 9.
  • Take a breadboard and connect a LED in blank dots with a 100

    resistor connected in series with it (connect the resistor with the negative terminal).
  • Connect pin 3 jumper to the positive terminal and the other jumper to the open side of the resistor.

Now you are set to start coding.

Step 3: Do the Coding and DONE!!

Picture of Do the Coding and DONE!!

At the desktop go to menu > Programming > python 3.

Create a new file and write the following code there.

After this, save and run your code. Now you should see the LED blinking in the breadboard.

Look at the video for detailed process. We have tried to clearly explain the project, but if you have any doubt or have any problem executing the project, then feel free to ask us in the comment section below.

Peace! ;)

Comments

candh (author)2017-08-12

hey, this might be a dumb question but how did you determined that you need a 100 ohm resistor? Some other tutorials use 330 ohm resistors. how do we calculate this?

Being Engineers (author)candh2017-08-15

As you can see I have used white led, the forward voltage drop of white/blue led is around 3.3v. The current draw will be around 20mA for this blue/white led. The supply is 5v. So for perfect condition we need to drop the extra 1.7v (5v-3.3v) across the series resistor. From ohm's law, V = IR. Here I will be 20mA as said earlier. Voltage drop(V) has to be 1.7v. So R will be V/I, i.e 1.7v/20mA. That gives 85ohm. So I used nearest one which I had that is 100ohm. The current draw and forward voltage drop of each led is different. For white and blue they are same, again for red and green they are same. Search in google. Hope you understood how to determine the resistance value

Shazzam10 (author)2016-12-25

can you use wires with alligator cilps instead of a breadboard

Yes obviously you can as far you are connecting the wires correctly.

thanks did not want to magle my pi

dbuckley6 (author)2016-11-14

There is no code visible after "write the following code"...at least not visible on my mobile device. An oversight perhaps?

The code is uploaded with the name blink_led.py. You can find it at the end of the instructable.

About This Instructable

2,784views

81favorites

License:

Bio: We run YouTube channel and provide some video tutorials on electronics and programming and also videos on cool projects - how to make them, tech news ... More »
More by Being Engineers:How to Use Mobile Hotspot to View Raspberry Pi Desktop in Android MobileIOT Based Surveillance Camera || Raspberry Pi + Pan-Tilt Arrangement + Cayenne + Webcam ServerHow to Communicate With Arduino From a Python Script
Add instructable to: