An Introduction to Raspberry Pi

Shivamshivanshu
Electronics Club IITK
6 min readSep 26, 2020

An article to help readers get started with Raspberry Pi for projects.

Introduction

Raspberry Pi is a series of low-cost single-board computers which comes with built-in features such as WIFI and Bluetooth and some USB and HDMI ports. We can connect a display, USB keyboard and mouse to the system.

These mini-computers are highly flexible in the areas where they can be used such as embedded system, weather reports and small security system. It is highly recommended for beginners to explore this excellent device to be able to do projects like WIFI Hacker, AD-Blocker and a working server that has some practical relevance!!

This is Raspberry Pi 4 Model B:

Getting Started

This document is divided into three sections as per the relevance of the project and need. The subsections are as follows:

  1. Installing Raspbian on Raspberry Pi 3
  2. Using SSH(Secure Shell) remote access and VNC remote access
  3. GPIO Programming

Prerequisites

Few prerequisites are:

  1. A functional Raspberry Pi
  2. A micro SD card of 8 GB or more and a Card Reader
  3. USB keyboard and mouse
  4. A working computer
  5. Stable power supply to power the machine
  6. Internet

Installing Raspbian on Raspberry Pi 3

A step by step procedure of process which tells you how to get started with Raspberry Pi is in this link.

Downloading the main Raspbian image file.

  1. Head over to this link to download the Full Version of Raspbian OS (This should be around 2.4 GB).
  2. Download the ZIP file by clicking on Download ZIP to start the download.

NOTE: The Torrent Link is much faster than the direct download option. You might try that option.

Downloading the Raspberry Pi Imager

  1. Head over to this link to download the Raspberry Pi Imager as per your current available system.
  • Windows
  • macOS
  • Ubuntu

2. Install the Imager to your system.

NOTE: We will be demonstrating the installation on Windows.

Writing the Disk Image to SD Card

  1. Insert SD card into your computer via a Card Reader.
  2. Open Raspberry Pi Imager and select the SD card with CHOOSE SD CARD option. Select the SD card from the menu appeared.
  3. Go to CHOOSE OS option. Select Use Custom option. A dialog box will appear. Navigate to the zip file of NOOBS which was downloaded.
  4. Click on WRITE option and let the procedure to finish.
  5. When prompted as done, safely eject the SD card from the reader.

Powering up your Pi device

  1. Attach the SD memory card to the USB slot of your Pi. Connect Pi to the laptop using the Ethernet cable(RJ45 STRAIGHT).
  2. (IMPORTANT)Follow these steps on your laptop/PC before powering ON your Pi.
OPEN CONTROL PANEL > NETWORK AND SHARING
GOTO YOUR CONNECTION (WIRELESS)
CLICK ON THE CONNECTION ICON AND GOTO PROPERTIES
CLICK ON SHARING.
CLICK TO ENABLE INTERNET CONNECTION SHARING (IMPORTANT).
CLICK OK.
  1. Insert power adaptor and Ethernet cable to Raspberry Pi and Laptop. Power on the device. An Unidentified Network should appear as Local Area Connection.
  2. Connect the keyboard, mouse, and HDMI display if you want. Remember that the external screen only needed to run the Pi for the first time.
  3. Click on it and select Properties and select Internet Protocol Version 4. Note the IP Address shown. The IP settings, in general, are as follows.
IP Address  : 192.168.43.1 (for wlan or WiFi)
Subnet Mask : 255.255.255.0
  1. Download a network utility tool Advanced IP Scanner to find the exact IP of the Raspberry Pi.
  2. Open Advanced IP Scanner and give the scan range as 192.168.43.1-254. Generally, your device should be listed as follows:
Name : raspberrypi
IP : 192.168.43.X {where X varies from system to system}
Note down all the details.
  1. Turn Off your Pi device and take out the SD card to plug it back to your computer to create a blank file to turn on SSH.
  2. Note the drive letter of SD card on the computer. Open cmd and type the following command, where K is your drive letter. This enables SSH in your device on start-up.
echo>K:\ssh

Insert the SD card back to the Pi device and plug back the Raspberry Pi to the computer.

Connecting SSH and VNC

  1. Download and Install an open-source software called PuTTy from This and VNC Viewer from this.

NOTE: Download putty.exe file under Alternate Binary Files 64-bit or 32-bit and Standalone 64-bit for VNC viewer.

2. Open PuTTy and follow the steps below

SELECT THE SSH OPTION FROM OPTIONS AND SET PORT TO 22
WRITE THE IP OF YOUR RASPBERRY PI WHICH WAS NOTED EARLIER

3. Click OK to connect to Raspberry Pi via SSH.

4. If prompted with login credentials, the default credentials are

Username : pi
Password : raspberry

5. Once you are connected to Raspberry Pi via SSH, follow the procedure below in shell. These settings help you to connect to the device via SSH and VNC.

1. Type sudo raspi-config in shell
2. A menu will appear, goto Interfacing Options( Option Number 5)
3. Choose SSH and choose "Enable Option"
4. Choose VNC option and enable this as well.
5. Goto Finish.

6. Close Putty and open VNC viewer. Enter the IP address of Raspberry Pi in the top search option and press enter.

7. And you are done!

GPIO Programming

GPIO, or General-Purpose Input/Output, is a feature in most modern embedded computer hardware and a crucial part of many embedded systems.

The most common functions of GPIO pins include:

  • Being configurable in software to be input or output
  • Being enabled or disabled
  • Setting the value of digital output.
  • Reading the value of digital output.
  • Generating an interrupt when the input changes the value

These pins are used with digital data which is typically referred to as High voltage and Low voltage. Various discrete levels of voltages cannot be used with these pins.

Please refer to this article for more info on the basics of GPIO Pins.

GPIO programming is usually done with Python using RPi.GPIO which can be installed via terminal.

sudo apt-get install python-dev
sudo apt-get install python-rpi.gpio

The best way to learn Raspberry Pi and IoT is via small projects and by having fun. We recommend you to check out this link to browse some fabulous projects to start with. Choose any of them and have fun. (^_^)

Foot Note

For Linux and macOS, connecting is even easier. Just use Advanced IP Scanner/Nmap or any tool you wish to scan for Raspberry Pi and use the following command.

ssh pi@<IP>

We also recommend you to check out this article from Electronics Club IIT-B for some extra insights.

  • Raspberry Pi has a limitless scope with the projects and stuff you can do with it, ranging from Robotics to Ethical Hacking. The purpose of this article is to get you started with Raspberry Pi so that you can explore this fantastic little tool under the guidance of the Electronics Club.
  • Happy Learning :)

--

--