How to Setup your Raspberry Pi
2016-07-27 | By All About Circuits
Courtesy of All About Circuits - Raspberry Pi is a miniature computer with ports that can be connected to different peripheral devices. It has an HDMI port to connect a monitor, USB ports for a keyboard and mouse, and an ethernet port to connect to the internet.
In this tutorial, you’ll learn how to connect your Raspberry Pi to your computer so you can boot up its operating system.
Hardware and Software
- 1 x Raspberry Pi
- 1 x Ethernet Cable
- 1 x Laptop or Desktop PC
- 1 x SD card (needs to be at least 4GB)
- 1 x Micro USB cable
Before we move on, you’ll need to download some free software. Here are the programs you’ll need to download:
Raspbian OS: When you buy Raspberry Pi, you have option (on some stores) to buy it with a pre-installed OS on your SD card. Otherwise you can download the zip-file form which includes the image of the Raspbian OS that you’re going to write on your SD card.
SDFormatter: SD card association has nice software that can be used to format your SD Card.
Win32DiskImager: In order to write the Raspbian OS on to your SD card, you will need Win32DiskImager utility. You can download it from Sourceforge.
Advanced IP Scanner: You’ll need this to find your Raspberry Pi’s IP address when you’ll connect it to your computer
PuTTy: PuTTy is the SSH client that will be used to connect to Raspberry Pi.
VNC: Last is VNC server.
Once you download the software, unzip and install them.
Installing the OS
1. Insert your SD card into the SD card reader and see which letter is assigned to the drive.
2. Open Win32DiskImager, you may need to be logged into the administrator account on your computer.
3. Select the image of Raspbian that you extracted.
4. Select the your SD card’s device letter in the device box. Make sure that you select the correct drive letter, otherwise it will ruin your hard drive.
5. Click “Write” and wait for the write to complete.
6. Exit the imager and eject the SD card, then plug it into your Raspberry Pi.
Note: After you write the OS, you’ll notice that there are only a few MBs leftover in your SD card, this is because of the partition; the rest of the free space is hidden. You can fix this after we connect to our Raspberry Pi.
Sharing Internet Over the Ethernet Port
*If you have a Raspberry Pi 3, use this tutorial to configure Wi-Fi and Bluetooth
Now that your SD Card is ready, insert it into your Raspberry Pi. Attach the Micro USB Power Cable as well. You will also need to attach your Raspberry Pi to you PC or laptop with ethernet cable.
You can now share your PC’s WiFi internet with your Raspberry Pi using Connection Bridge. Follow the steps below:
1. On your computer, go to the “Network and Sharing Center”, then go to “Change adapter settings” in the left column. You will see multiple connections in this window.
2. What we’re doing here is making a bridge between the WiFi and Ethernet connection. Select your WiFi, then hold Ctrl, then select your Ethernet
3. Right click on any of them (with both the Wifi and Ethernet selected as mentioned in the previous step) and select “Bridge Connections”.
4. Wait until Windows bridges the connections.
5. If successful you’ll notice another connection called “Network Bridge” in your adapter settings.
Checking for your Raspberry Pi’s IP Address
This part is simple, make sure that your Raspberry Pi is connected to your PC and the Ethernet cable is also plugged in. If everything is working fine you’ll see leds blinking on your board.
1. Run “Advanced IP Scanner” and click “Run”
2. It will take some time and you’ll see a list of devices connected to your network.
Connecting to Raspberry Pi through PuTTy
Alright! Before moving forward, a quick summary what you’ve done so far:
- Installed the OS.
- Shared the internet using your ethernet cable.
- Learned the IP address of your Raspberry Pi.
Next you will be connecting your Raspberry Pi and adjusting some final settings. After that, you’ll be ready to go!
1. Run PuTTy
2. Enter your Raspberry Pi’s IP address, (This was found using the “Advanced IP scanner”, from the previous section).
3. Expand the “Connection” category on the left side of the menu, then expand the “SSH” category beneath it, then go to “X11” and check “Enable X11 Forwarding”.
4. You can now open the connection.
5. A terminal window will pop up. To connect your Raspberry Pi, you will need to fill out these fields to login.
Login: pi Password: raspberry
6. Once you enter the login credentials, you will connect to your Raspberry Pi terminal window. Enter the RASPI-CONFIG window and hit enter. RASPI-CONFIG is the software configuration tool for Raspberry Pi.
7. Go to “Expand Filesystem.” After a few blinks, you’ll see that your partitions are resized and the partition issue mentioned while installing the OS is gone.
8. Reboot your Raspberry Pi (You may need to restart your PC as well) and re-connect like you just did.
9. Enter the “sudo apt-get update” and “sudo apt-get upgrade” commands in the Raspberry Pi terminal. This will upgrade all of the software installed in the system and finalize the OS installation.
Connecting to Raspberry Pi through VNC
It’s now time to install VNC on your Raspberry Pi. At this point, you should have already installed VNC on your computer.
1. Connect to your Raspberry Pi through PuTTy.
2. Write sudo apt-get install tightvncservern in the Raspberry Pi terminal window.
3. Once the VNC is installed, run this command “vncserver :1”. This will start the VNC server. You’ll be prompted to enter a password, you can enter any 8 digit password. This password will be used to connect to this VNC server on your PC.
4. Run VNC viewer on your computer.
5. Enter the IP address of your VNC server. This is your Raspberry Pi’s IP address. The port number is shown at the end of the IP address. Click “Connect”. You will receive a warning message, but just click “Continue”.
6. Enter your 8 digit password and hit enter.
Now you can use your Raspbian like a normal OS and start coding!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.