Introduction to Raspberry PI, Input Sensor & PCB
Raspberry Pi- You can visit the official site of raspberry pi to search for additional information
Lets start now:
What is Raspberry PI?
Raspberry Pi is a small single-board computer
It is developed in UK by Raspberry Pi foundation
It is very popular in robotics
It does not include peripherals (mouse, keyboard etc)
It has different models such as
Raspberry Pi 1 Model B, B+, A, A+
Raspberry Pi 2 Model B, version 1.2
Raspberry Pi 3
Raspberry Pi Zero version 1.2, 1.3, W(wireless)
Detail Diagram Of Raspberry PI 3 B+?
What’s inside Raspberry PI 3 B+?
Quad Core 1.2GHz Broadcom BCM2837 64bit CPU
BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board
40-pin extended GPIO
4 USB 2 ports
4 Pole stereo output and composite video port
Full size HDMI
CSI camera port for connecting a Raspberry Pi camera
DSI display port for connecting a Raspberry Pi touchscreen display
Micro SD port for loading your operating system and storing data
Upgraded switched Micro USB power source up to 2.5A
A. Setting up workstation:
1. Make bootable SD card
2. Download Etcher from https://etcher.io/
3. Download raspbian OS from https://www.raspberrypi.org/downloads/raspbian/
4. Download Raspbian Stretch With Desktop image file (.img)
5. Use etcher to make SD card bootable
B. Making Head-Less Raspberry Pi:
1. What is Head-Less Raspberry Pi
Process of using raspberry pi via network connection without a keyboard or display
2. What do we need?
1. SSH Client
1. Putty for windows
2. SSH client for MAC & Linux
2.Remote Access Software
1.tightvncserver in raspberry pi
First connect Ethernet cable + power supply (USB or Adapter)
1. Install PuTTY
What is PuTTY?
PuTTY is a free and open-source terminal emulator, serial console and network file transfer application.
Support SCP, SSH, Telnet, rlogin, and raw socket connection
2. First we need IP Address of raspberry Pi; we can get that in three way
– From router (after connecting to router go to DHCP table)
– From raspberry host; here we can use ping command in terminal
– Manual entry in comdline.txt file [eg. ip = 192.168.1.168]
1* Getting IP address of Raspberry PI from router [keep a note your mac ID as well as your IP from router]
use terminal to get IP address of raspberry pi
[ping raspberrypi.mshome.net or ping raspsberrypi.local]
For mac & linux [UNIX SYSTEM]
What is SSH?
The SSH protocol (also referred to as Secure Shell) is a method for secure remote login from one computer to another
It provides several alternative options for strong authentication
it protects the communications security and integrity with strong encryption
* to obtain IP address use previous technique (router, host ping, manual set IP to cmdline.txt)
cmd > sudo raspi-config
VNC SERVER AND VIEWER
1. Install VNCViewer
( https://www.realvnc.com/en/connect/download/viewer/ )
What is VNC?
Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer
It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.
VNC SERVER AND VIEWER
VNC Connect consists of two apps, VNC Server and VNC Viewer:
VNC Server enables you to connect to your Pi from a desktop computer or mobile device, watch its screen in real-time, and exercise control as though you were sitting in front of it.
VNC Viewer enables you to connect to and control a desktop computer (or another Pi) from your Pi, should you want to.
1. Using in-built VNC server
– To enable vncserver in raspberry pi we have to enable vnc server from raspi-config
– *note you have to be super user to change config file
2. Steps of using vncserver in raspberry pi if VNC server is not installed in raspberry pi
To enable vncserver in raspberry pi enter vncserver :1 command
Now, Password for VNC server
This only required one time.
Uses 8 character password.
* Configure Resolution in raspberry pi
This configure Graphic resolution of the raspberry pi we need to configure /boot/config.txt file (you can use different text editor here we use nano here)
Where different parameter is needed to update
Different parameter need to be added (here “#” means comment)
hdmi_ignore_edid=0xa5000080 (edid i.e. Extended display identification data )
(this means it will ignore all the default display output)
hdmi_group=2 (set output group to video buffer when using VNC client other wise remove this line)
hdmi_mode=85 (this set the resolution to 1280×720 @60Hz, more resolution means slow refresh rate)
And the last step:
Introduction to Raspberry PI,
Input Sensor & PCB
Raspberry PI Pin (GPIO)
Pin Diagram Of Raspberry PI 3 B+
What is GPIO (General Purpose Input/Output) in Raspberry Pi?
This pins are physical interface between the Pi and outside world
In simple; it is a group of switches which we can turn “on” and “off” using programming
This pin can act as Input or Output depending on a program
In raspberry pi 3 B+ has 40 pins
Where 26 pins are GPIO
Board Mode pins: 3, 5, 11, 13, 15, 19, 21, 23, 29, 31, 33, 35, 37, 8, 10, 12, 16, 18, 22, 24, 26, 32, 36, 38, 40
Board Mode Ground pins: 6, 9, 14, 20, 25, 30, 39
Board Mode 5 Volt: 2, 4
Board Mode 3.3 Volt: 1, 17
Creating Program in Raspberry Pi
Create an app which toggle light (on & off) using GUI interface.
Things we need
Raspberry Pi 3 B
Connect Network [raspberry pi <—> computer]
LED with resistor in it (to assemble it will come in future lesson)
*output sample of scenario
*Checking Tkinter is installed or Not
Creating app in raspberry pi
Choosing pin of raspberry pi
What is Multi Threading Programming?
Running several threads in similar to running several different program concurrently
Benefits of Multi Threading Programming?
Multiple threads within a process share the same data space with the main thread and can therefore share information with each other more easily
It is light-weight process
Skeleton of Multi-Threading Programming?
Thread has a beginning
What Thread can do?
I can be interrupted, It can be put on hold (sleep)
The Threading Module?
It is new version of module comes after python 2.4
It is much more powerful, high-level support for threads
New additional methods in threading module
threading.activeCount() : Returns the number of thread objects that are active
threading.currentThread() : Returns the number of thread objects in the caller’s thread control
threading.enumerate() : Returns a list of all thread objects that are currently active
Some methods of thread class are
run(), start(), isAlive(), getName(), setName(), join([time])