Raspberry Pi:

The Ultimate Beginner's Guide - Discover How To Get Started With Programming And Raspberry Projects!

Table of contents

Introduction

Chapter 1 – Overview and Benefits of Raspberry Pi

Chapter 2 – Getting Started with Raspberry Pi and Linux

Chapter 3 – Make Your First Program with Raspberry Pi

Chapter 4 – Cool Projects with Raspberry Pi

Chapter 5 – Fun Things to Do with Raspberry Pi

Conclusion

Introduction

Raspberry Pi is the most inspiring computer and it is completely opposite to tablets, phones and game consoles. It is a series of small single-board computers equal to the size of a credit card and developed in the England by the Raspberry Pi foundation.

This shiny green circuit board invites you to prod it, play with it and create different things with it. Different tools are available with it that may help you to design different software with it and you can connect your personal electronic inventions to it.

This system is cheap enough; therefore, if you accidentally break it, it will not disturb your budget to buy it again.

You can experiment it with confidence because it has lots of potential and exciting features for you. It can be helpful for you to build a supercomputer or you can use it to solve problems in supercomputer.

The use of Raspberry can reduce your cost and help you to save hundreds of dollars in the creation of new software. It can be helpful for you to teach the use of this device to your kids and it can be an excellent option for your children. If you are looking something special for your children, buy this Raspberry Pi. The 7 inch touch screen monitor enables you to work on several embedded projects.

The 800 x 480 display connects through an adapter that can handle power and signal conversion. You will require only two connections to the Pi, such as power from the GPIO port of Pi ad a ribbon cable to connect to the DSI port on all Raspberry Pis.

The operating system is completely functional and you can use it without any physical mouse or keyboard. It is an excellent system and you can use it to increase your knowledge. Software drivers are completely functional and interactive. It enables you to make your own “Internet of Things” devices and a visual display.

The purpose of this book is to educate you about this amazing system. The Raspberry Pi is full of unique features and it will be really beneficial for you to get the advantage of this unique system. Read this book and find out the benefits and uses of Raspberry Pi.

Chapter 1 – Overview and Benefits of Raspberry Pi

Raspberry Pi is a mini-computer and you can set it up as a mini server with numerous services. This is designed to improve the teachings of basic computer science in developing countries. The original Raspberry Pi and Raspberry Pi 2 have different board configurations via agreement of the licensed manufacturing. They have agreements with RS Components, Egoman and Newark element14.

In the February 2016, the foundation of Raspberry Pi announced that they had sold more than eight million devices and it is one of the best selling personal computers in the UK.

All Pis have VideoCore IV GPU (Graphics Processing Unit) and ARMv6-compatible CPU or a new ARMv7 that is compatible to quad-core one and 2 GB of RAM and 512 MB or 256 MB.

They offer a (SDHC) Secure Digital slot or a MicroSDHC for boot media and storage. You will get numerous new features in the model with the passage of time.

Benefits of Raspberry Pi

There are a few benefits of Raspberry Pi that will help you to understand its importance in a better way:

Power Consumption

The Raspberry Pi is really beneficial because it consumes only 5 to 7 watts of electricity. They consume less power than a full-size box and it can run constantly day and night. You can save electricity because these systems are affordable and of good quality.

Free from Moving Parts

Raspberry Pi uses an SD card for storage and it is fast without any moving parts. There are no fan and other similar part; therefore, there is no need to worry. Class 10 SD is the best performing card as compared to other cards. It can typically affect the boot time to increase I/O. You can check a compatibility chart to select a right value for you.

Small Form Factor

Raspberry Pi is really easy to hold in your hand. It is similar to a full-size box and can be integrated into the devices. It is completely silent and you can check several status lights on the motherboard of Pi. You can judge a clear case to see the NIC activity, power status and I/O disk.

Expansion Capabilities

There are various devices that are available for the PI at affordable prices. You can buy everything from (GPIO) I/O boards to a camera. The Raspberry Pi has two USB ports and you can add more devices by hooking up a USB hub.

Built-in HDMI Graphics

The display port on the Raspberry Pi is HDMI and it can handle resolutions up to 1920 x 1200. You can use it as a video player box and there are some converters to get the advantage of VGA compatibility. 

It is Affordable

It is affordable as compared to its similar alternatives and the revised version of Pi offers better features and specifications for its price. It offers 512 MB RAM and comes in affordable price. You can use it for business, hobby or education.

Support of a Huge Community

Raspberry PI offers phenomenal community support and it can be used for the GNU, Linux software and hardware. There are a few user forums and GNU/Linux distributions its users. The Pi may be overclocked for the problems in the performance and uses of applications.

Multiple Uses

Storage on the SD cards can be easily swapped with other SD cards running on the GNU or Linux distribution. You can set up the Pi as a server and test it out. It is really easy to swa the SD cards and use “dd” command on a Linux and GNU computer and a backup of the SD card can be created and restored as per your needs.

Drawbacks of the Raspberry PI

Along with positive things, there are a few minor drawbacks of this system:

ARM Architecture

The ARM is highly efficient and a low powered architecture and it is not an x86 and the binaries are often compiled to run on the x86 and these binaries can’t run on the Raspberry Pi. This can be a drawback, but there is good news that the entire GNU and Linux contributions are compiled for the ARM architecture. The new ones will have great features and there are only a few applications that absolutely require x86.

RAM is not upgradable

The basic components of the Raspberry are soldered to the motherboard, such as 512 MB. The GNU and LINUX can easily run on it. The Pi may handle 100 MB while operating a small server.

Chapter 2 – Getting Started with Raspberry Pi and Linux

Initially, this small size computer was designed for teaching computer science in schools and colleges, but now it is frequently used by professionals of businesses and experts. This single board is equipped with microcontroller chips and I/O connectors that attracted maximum media coverage.

What you will need to get started?

SD Card:

You can get 4 SD card of 8 GB class, preinstalled with NOOBS. It will be good to buy a card with pre-installed NOOBS or download it free from their official page.

Connectivity and Display Cables:

You may need an HDMI or DVI monitor or TV that works as a display for the Pi. You can achieve the best results with the HDMI input. You can use a standard Ethernet cable for the internet.

Keyboard and Mouse:

You can use any standard mouse or keyboard with your Raspberry Pi.

Power Supply:

You can use a 5V micro USB power cable to power your Pi device. You should be careful for your power supply and use at least 5V output because insufficient power may affect the performance of your Raspberry Pi.

Internet Connection:

You can download or update software to connect your Raspberry to the internet, either via Wi-Fi adapter or Ethernet cable. It is not necessary, but it can improve the performance of your device.

Headphones:

You can attach earphones or headphones with a 3.5mm jack and these may work well with your Pi.

Plugging in Raspberry PI

Before plugging anything to your PI, it is important to have all equipment to hand and follow these instructions:

Start your work by slotting your SD card in the right slot of SD card on the Pi.

Now plug in any USB mouse and keyboard into the USB slots on your Pi.

You should turn your monitor or TV on and then select a right input, such as HDMI 1 or DVI.

Now connect an HDMI cable from Pi to your TV or monitor.

If you want an internet connection on your Raspberry Pi to the Internet, you can plugin an ethernet cable into the port subsequent to the USB ports. If you don’t want the internet, you can skip this step. You can also plug in the USB power supply and boot your Raspberry Pi.

If you are using it for the first time, you can use Pi and NOOBS SD card. You have to select an operating system to configure it. You have to log in to your Pi with your username (pi) and password (raspberry). When you type your password, you will not see anything and there is no need to worry because it is a feature of Linux. After successful logged in, you will notice “pi@raspberrypi~$” that is a command prompt and you can load the user interface by typing “startx” and hit “Enter”.

Setup Raspberry with Basic Operating System

You can use Pi for all sorts of things and some systems may require special operating system. It is a good idea to get started with the Raspbian and a Linux version:

Prepare SD Card

You have to prepare your SD card for Pi and this may require proper formatting and put Raspbian along with the standard Pi operating system. This step may vary on the use of Linux, Mac or Windows PC.

Windows

In the first step, you have to download the latest version of Raspbian and unzip a file (.img) inside.  It can be 500MB or a little to download.

Now download win32diskimager, now unzip (.exe file) application inside.

Now insert your card with the help of a card reader into your PC.

It is time to open win32diskimager.exe to download this application. On windows 7 or windows 8 and right click to select “Run-as-administrator”.

Your system may not be able to automatically detect SD card and find a drop-down-menu find at the top corner. You have to select (Device) from this list.

In the section of the image file, you can click on the little folder icon and select .img file of Raspbian.

Now hit the “write” button and wait for the win32diskimager to complete it. After finishing it, you have to safely eject the SD card and insert it into your Raspberry Pi.

Linux

You have to download the advanced edition of Raspbian and make sure to unzip (.img file) inside. (It may be 500MB or take a little more at the time of download)

You have to open the Linux emulator of your choice and insert your card. It may mount automatically, and if it happens, you have to unmount it after noting its location, such as /dev/disk2s1. After unmounting the card, keep it in the reader.

You have to type a single line in the command line to duplicate the content of Raspbian.img-file to SD card. It may look like the following line:

Sudo-dd-if=PATH_TO_IMG_FILE-of=PATH_TO_SD_CARD_MOUNT_POINT-bs=1m

It is important to reinstate PATH_TO_IMG_FILE along with the .img-file and PATH_TO_SD_CARD_MOUNT_POINT along with the lane to the mounting point of SD card. The final command will look like this:

Sudo-dd-if=/Users/adachis/Downloads/2012-12-16-wheezy-raspbian.img-of=/dev/disk2s1 bs=1m

It is important to collect the right information because wrong information may cause data loss. You should be careful and ensure that you have selected everything right before hitting “Enter”. You may prompt for the administrator password or root-password for OS-X. Write this password and hit “Enter”.

The “dd” command may take time to copy everything on the SD card. It may look like a frozen terminal, but there is no need to worry because it is working. It may take longer than an average SD card so have patience. Once it is finished, the command prompt may return and your SD card is ready to use. Eject it carefully and attach it to your Raspberry Pi.

Chapter 3 – Make Your First Program with Raspberry Pi

There are numerous cool things that you can do with Raspberry Pi. You should start with this initial program:

You can use Python for the programming language for new students:

Initially, you have to install the Geany software and in this tutorial, the Fedora Operating System will be used:

Access the menu of Gnome system; browse the “Accessories” to select Root Terminal.
You may need to enter root password to carry on the procedure.

You have to use a command terminal that will help you to download and install the software for the programming of Geany.

You have to type “apt-get” in the command line for the installation of python-geany-xterm and push “Enter” to run-the-command.

You may get information for the use of 9MB storage space and you may get permission to continue. Now hit “Y” and push “Enter” to continue the process.

Now the installation of Geany is complete and you can close the terminal. Now you will open Geany from the system menu of Gnome by accessing the Programming and select Geany.

Now Geany window is open and you have to hit on the file menu and steer a new template to select main.py. Now you will open new Python file to create programs with its help.

Now open a new file and insert “Geany-automatically-unnecessary-code”. You will create the first program with the first line. You can delete the code to get only first line.

Keep your initial program very simple and when you will run it, it may display the first line of text.

In the second line, you can type “print” and notice the color of this word. The “print” will change to purple and it is a demonstration that Geany has recognized this function.

After print, you have to insert the space and enter the line of text that you want to display in the program in the brackets.

You have to hit the “Cogs Icon” to run your initial program.

Run program
It will be open in a “New Window” and it is a simple program and you may enjoy your success.

Congratulate yourself for this successful program.

Chapter 4 – Cool Projects with Raspberry Pi

If you want to work on cool projects, you can start with the following projects given for your guidance:

Connect with Weather Watch

You can connect your Raspberry Pi to a weather watch. If you want to try this project, you should have:

Raspberry PI with a power supply

Ethernet Connection or Wireless Connection with USB Hub

Maplin Weather Station

Directions:

Start with Setup

In the first step, create your 4GB SD card with the help of Raspbian "wheezy" image available at http://www.raspberrypi.org/downloads.

You should buy a reliable card to get plenty of storage space on this and you can use it for many years.

Now Boot the Pi with your 4GB SD card and you can use “pi as user” and “raspberry as password”.

You have to change the size of the partition to get the full capacity of the card and this can be done with the help of raspi-config-menu. If you are using ssh, you can write sudo-raspi-config in the command prompts.

Now change the default password and set a correct time zone because incorrect time may cause problems at the time of synchronization. You have to write correct time in the weather station.

If you don’t want to use the GPU, you can set the split of memory and change its value to 16. You can activate “ssh” to control the Pi with the help of another machine.

Finally, you can update the Pi with the help of “Sudo-apt-get update” commands and exit the menu.

If you want to reboot, you have to write “sudo-reboot”.

Installation of Software

You have to install pip & python-dev

Now sudo-apt-get set up python-pip

And sudo-apt-get set up python-dev

And sudo-apt-get set up python-usb

Now install pywws

You have to install the new version of pywws (http://pypi.python.org/pypi/pywws/). You should install it to the directory of weather.

cd ~

sudo-pip-install-pywws

Testing Stage

It is time to test your efforts and you have to connect the weather station to your PI with the help of a USB connection. You should test the weather station by

Sudo-python-m-pywws.TestWeatherStation

If your connection is successful, you can notice a series of Hex numbers upon testing.

Project 02: Gaming Zone

If you want to install a RetroArch on the Pi along with emulator cores, you have to get the libraries for the controlling interface of SNESDev and a graphical front. There are a few steps for the completion of this project:

If you want to obtain installation script, it is important to install dual package, such as:

Sudo-apt-get update

Sudo-apt-get install -y git dialog

To download the new setup of RetroPie script, you can setup your script with the help of:

Cd

Git clone (git://github.com/petrockblog/RetroPie-Setup.git)

Start Installation

Your script will be worked with the:

cd-RetroPie-Setup and then

chmod +x retropie_setup.sh along with

sudo ./retropie_setup.sh

You will get the following screen:

You can select between two different installations, such as:

Binaries-based-installation:

You can download pre-compiled version of RetroArch, SNESDev and Emulation Station. The alternative way of installation is faster than this way. The binaries will get updated from time to time and you may not have the latest versions of these programs.

Source-code-based-installation

With the help of this method, you may the recent resources of every program and core. It may take a few hours to compile everything, but you will need the most updated releases of every program. You can select this selection in the menu screen and the individual task will be completed with the help of a setup script:

With the help of default selection, you can install the complete set of packages.

Uses of This Program

With the help of default configuration, the Retropie can easily configure the graphical endemultionStation, such as a set of emulators may be directly used by the front end. You may start with the Emulationstation of the front end.

You have to copy files of your ROM into the “RetroPie/roms/ folders”. Keep it in mind that each emulator will have its own subfolder and the early stage of ALSA execution on the Raspberry can be expected for some creaking at the time of analog output. HDMI output may enhance your good experience. You can use an external sound card to solve any problem with ALSA implementation.

Chapter 5 – Fun Things to Do with Raspberry Pi

Raspberry Pi is a great invention and you can use it for numerous projects. It can be helpful to automate your house. There are a few fun things that you can do with Raspberry Pi:

Mini Web Browser

The Raspberry Pi is already attached to your TV; therefore, you can enjoy surfing on a big screen. You can get a better browser, such as Chromium. It will be easy by dropping it into a terminal and write “sudo-apt-get-install-chromium-browser” and hit enter.

sudo apt- get install chromium-browser

Spectrum Pi of ZX

It is a lovely keyboarded gem of rubber and it can make an amazing entrance at once. You can get one thing for your hardware, such as emulate the 8-bit beauty and write these words in the terminal and hit enter. Type these words

sudo apt-get install fuse-emulator-common

Now write “y” to verify the download file and install it. After installing the Fuse, you can go back to the prompt window and write “sudo apt-get install spectrum-roms fuse-emulator-utils”. Finally hit “Enter” and go to prompt once again to write “sudo amixer cset numid=3 2” and hit enter.

Arcade Pi

Are you interested to create a full sized cabinet for arcade? You can do this with the help of Raspberry Pi and a gaming project is given in the previous chapter for your guidance. You can make essential changes to get its long-term advantages.

Windows 3.0

If you want to get retro look, you have to run Dos 6.00 and 3.0 Windows with the help of QEMU. You can use a virtual box image and convert the raw image by writing “vboxmanage clonehd "abc.vdi" "abc.img" --format RAW” (you can replace abc with the name of your image). Now you will install QEMU and to install this, you have to write “sudo apt-get install qemu”.

It is time to convert your raw image to special qcow image of QEMU and for this purpose, you have to write “qemu- img convert -f raw abc.img -O qcow2 abc.qcow”. Now you are ready to run the required image by writing “qemu image.qcow”.  You can get perfect fun with the help of these commands.

Things You Should Connect with Raspberry Pi

There are a few things that you can connect with the raspberry because the Pi can increase the efficiency of these things:

Ultrasonic Module

You can connect the ultrasonic transducer module easily to increase its capability with the help of Pi. You may need two power pins, such as one trigger pin and 1 echo pin. You can connect it with Pi with the help of a simple Python script.

Movement Sensor

You can allow your infra-red sensors to detect the movements. This may have three pins to directly connect to the Raspberry Pi and GPIO header. It is an excellent system for security. You can make your own module with the help of Raspberry Pi commands.

Stepper Motor

You can control hardware with GPIO and the stepper model is available with controller board to interface them directly with GPIO. You can feed the sequence of input to your device to turn the motor.

Gaming Commands

Your script will be worked with the:

cd-RetroPie-Setup and then

chmod +x retropie_setup.sh along with

sudo ./retropie_setup.sh

You will get the following screen:

You can select between two different installations, such as:

Binaries-based-installation:

You can download pre-compiled version of RetroArch, SNESDev and Emulation Station. The alternative way of installation is faster than this way. The binaries will get updated from time to time and you may not have the latest versions of these programs.

Source-code-based-installation

With the help of this method, you may the recent resources of every program and core. It may take a few hours to compile everything, but you will need the most updated releases of every program. You can select this selection in the menu screen and the individual task will be completed with the help of a setup script:

With the help of default selection, you can install the complete set of packages.

Uses of This Program

With the help of default configuration, the Retropie can easily configure the graphical endemultionStation, such as a set of emulators may be directly used by the front end. You may start with the Emulationstation of the front end.

You have to copy files of your ROM into the “RetroPie/roms/ folders”. Keep it in mind that each emulator will have its own subfolder and the early stage of ALSA execution on the Raspberry can be expected for some creaking at the time of analog output. HDMI output may enhance your good experience. You can use an external sound card to solve any problem with ALSA implementation.

LCD Display

You can buy 16 or 20 characters LCD displays because these are cheap and you can hook them up to the GPIO pin on the PI. The device should have Hitachi hd44780 controller and luckily most common devices are based on this controller. You can adjust the brightness with the use of any additional component.

USB to Moduale

You can let your USB serial device to communicate with your USB interface. With the help of USB, you can plug into a laptop, tablet and PC. The pins are easy to connect with the GPIO 8 and 10 pins.

These pins can configure terminal interface and help you to access the command line of Linux from personal computer and tablet. It will help you to provide enough power to your device with the help of UB port.

WiFi Dongle

USB Wi-Fi Dongle is cheap and offers a unique way to connect your PI to the network without the use of cables. You can use it to connect to network and it is easy to configure with Wi-Fi utility.

LCD Screen

There are numerous small screens available to accept a complex input video. It is perfect to attach the video of Raspberry Pi. These screens are particularly available to reverse camera screens. These are powered from 12V and have two video inputs.

BerryClip to Buzzer Board

This is an addon board for Pu and you can directly plug it on the GPIO header and offers 6 colored LEDs, 1 momentary switch and a buzzer. You can use your preferred language and Python scripts to get its advantage.

Bluetooth Dongle

USB dongle is cheap and available online. You can use these adapters and plug it. This dongle will help you to connect to various Bluetooth devices, such as wii controllers, keyboards and mice.

You should properly learn the use of Raspberry Pi and get its long-term advantages. You can easily automate your house and control your devices. Raspberry Pi is really easy to hold in your hand. It is similar to a full-size box and can be integrated into the devices.

It is completely silent and you can check several status lights on the motherboard of Pi. You can judge a clear case to see the NIC activity, power status and I/O disk. The Raspberry Pi is really beneficial because it consumes only 5 to 7 watts of electricity.

They consume less power than a full-size box and it can run constantly day and night. You can save electricity because these systems are affordable and of good quality.

The beginner should learn the basics and understand different applications. You can perform different kinds of activities and connect it with game consoles to increase their efficiency.

There are numerous operating systems, applications and other lots of things. You should learn and understand the Linux, its uses and other things to understand this computer. It is cheap and easy to use.

Raspberry Pi is a mini-computer and you can set it up as a mini server with numerous services. This is designed to improve the teachings of basic computer science in developing countries.

The original Raspberry Pi and Raspberry Pi 2 have different board configurations via agreement of the licensed manufacturing. They have agreements with RS Components, Egoman and Newark element14.

The ARM is highly efficient and a low powered architecture and it is not an x86 and the binaries are often compiled to run on the x86 and these binaries can’t run on the Raspberry Pi. This can be a drawback, but there is good news that the entire GNU and Linux contributions are compiled for the ARM architecture. The new ones will have great features and there are only a few applications that absolutely require x86.

Conclusion

You can experiment it with confidence because it has lots of potential and exciting features for you. It can be helpful for you to build a supercomputer or you can use it to solve problems in supercomputer.

The use of Raspberry can reduce your cost and help you to save hundreds of dollars in the creation of new software. It can be helpful for you to teach the use of this device to your kids and it can be an excellent option for your children. If you are looking something special for your children, buy this Raspberry Pi. The 7 inch touch screen monitor enables you to work on several embedded projects.

The 800 x 480 display connects through an adapter that can handle power and signal conversion. You will require only two connections to the Pi, such as power from the GPIO port of Pi ad a ribbon cable to connect to the DSI port on all Raspberry Pis.

The operating system is completely functional and you can use it without any physical mouse or keyboard. It is a good computer and you can use it to increase your knowledge.

It is equally good for teachers, students and other people. You should properly learn the use of Raspberry Pi and get its long-term advantages. You can easily automate your house and control your devices. Raspberry Pi is really easy to hold in your hand.

It is similar to a full-size box and can be integrated into the devices. It is completely silent and you can check several status lights on the motherboard of Pi. You can judge a clear case to see the NIC activity, power status and I/O disk.

The Raspberry Pi is really beneficial because it consumes only 5 to 7 watts of electricity. They consume less power than a full-size box and it can run constantly day and night.

You can save electricity because these systems are affordable and of good quality. It is important to learn its important commands to make your work easy. You can follow these programs given in this book and try something new.