0% found this document useful (0 votes)
20 views34 pages

Iot Devanshi

yuioyiuuiygy

Uploaded by

AFTAB tai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views34 pages

Iot Devanshi

yuioyiuuiygy

Uploaded by

AFTAB tai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

IOT 210820107015

Practical: 1

Introduction to Arduino Board, Arduino IDE and

Cables Introduction to Arduino:

Arduino is an open-source prototyping platform based on easy-to-use hardware and software.


Looking at the board from the top down, this is an outline of what you will see (parts of the board you
mightinteract with in the course of normal use are highlighted).

Starting clockwise from the top centre:

• Analog Reference pin (orange)


• Digital Ground (light green) Digital Pins 2-13 (green)
• Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for digital i/o
(digitalRead and digitalWrite) if you are also using serial communication.
• Reset Button - S1 (dark blue)
• In-circuit Serial Programmer (blue-green)
• Analog In Pins 0-5 (light blue)
• Power and Ground Pins (power: orange, grounds: light orange)
1
IOT 210820107015

• External Power Supply In (9-12VDC) - X1 (pink)


• Toggles External Power and USB Power SV1 (purple)

• USB (used for uploading sketches to the board and for serial communication between the board and
the computer; can be used to power the board) (yellow)
• Arduino IDE:
The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor
for writing code, a message area, a text console, a toolbar with buttons for common functions and a
series of menus. It connects to the Arduino and Genuino hardware to upload programs and communicate
with them.
• Writing Sketches
1. File

2. Edit

3. Sketch

4. Tools

5. Help

• Sketchbook
• Tabs, Multiple Files, and Compilation
• Uploading
• Libraries
• Third-Party Hardware
• Serial Monitor
• Preferences
• Language Support
• Boards
Writing Sketches:

Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension .ino. The editor has features for cutting/pasting and for
searching/replacing text. The message area gives feedback while saving and exporting and also displays
errors. The console displays text output by the Arduino Software (IDE), including complete error
messages and other information. The bottom right hand corner of the window displays the configured
board and serial port. The toolbar buttons allow you to verify and upload programs, create, open, and
save sketches, and open the serial monitor.
Sketchbook:
The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your programs
2
IOT 210820107015

(or sketches). The sketches in your sketchbook can be opened from the File >Sketchbook menu or from
the Open button on the toolbar. The first time you run the Arduino software, it will automatically create a
directory for your sketchbook. You can view or change the location of the sketchbook location from with
the Preferences dialog. Beginning with version 1.0, files are saved with a.ino file extension. Previous
versions use the .pde extension. You may still open .pde named files in version 1.0 and later, the
software will automatically rename the extension to .ino.

Tabs, Multiple Files, and Compilation:


Allows you to manage sketches with more than one file (each of which appears in its own tab). These
can be normal Arduino code files (no visible extension), C files (.c extension), C++ files (.cpp), or
header files (.h).

Uploading:
Before uploading your sketch, you need to select the correct items from the Tools > Board and
Tools > Port menus. The boards are described below. On the Mac, the serial port is probably
something like
/dev/tty.usbmodem241 (for an Uno or Mega2560 or Leonardo) or
/dev/tty.usbserial-1B1 (for a Duemilanove or earlier USB board), or /dev/tty.USA19QW1b1P1.1
(for a serial board connected with a Keyspan USB-to-Serial adapter).

On Windows, it's probably COM1 or COM2 (for a serial board) or COM4, COM5, COM7, or
higher (for a USB board) - to find out, you look for USB serial device in the ports section of the
Windows Device Manager. On Linux, it should be
/dev/ttyACMx , /dev/ttyUSBx or similar.

Once you've selected the correct serial port and board, press the upload button in the toolbar or
select the Upload item from the File menu.

Current Arduino boards will reset automatically and begin the upload. With older boards (pre-
Diecimila) that lack auto-reset, you'll need to press the reset button on the board just before starting the
upload. On most boards, you'll see the RX and TX LEDs blink as the sketch is uploaded. The Arduino
Software (IDE) will displaya message when the upload is complete, or show an error. When you upload
a sketch, you're using the Arduino boot loader, a small program that has been loaded on to the
microcontroller on your board. It allows you to upload code without using any additional hardware. The
boot loader is active for a few seconds when the board resets; then it starts whichever sketch was most
recently uploaded to the microcontroller. The boot loader will blink the on-board (pin 13) LED when it
starts (i.e. when the boardresets).
Libraries:
Libraries provide extra functionality for use in sketches, e.g. working with hardware or manipulating
data. To use a library in a sketch, select it from the Sketch > Import Library menu. This will insert one or
more #include statements at the top of the sketch and compile the library with your sketch. Because

3
IOT 210820107015

libraries are

4
IOT 210820107015

uploaded to the board with your sketch, they increase the amount of space it takes up. If a sketch no
longer needs a library, simply delete its #include statements from the top of your code.
There is a list of libraries in the reference. Some libraries are included with the Arduino software.
Others can be downloaded from a variety of sources or through the Library Manager. Starting with
version 1.0.5 of the IDE, you do can import a library from a zip file and use it in an open sketch. See
these instructionsfor installing a third-party library.

Third-Party Hardware:
Support for third-party hardware can be added to the hardware directory of your sketch book directory.
Platforms installed there may include board definitions (which appear in the board menu), core libraries,
boot loaders, and programmer definitions. To install, create the hardware directory, then unzip the third
party platform into its own sub-directory. (Don't use "arduino" as the sub-directory name or you'll
override the built-in Arduino platform.) To uninstall, simply delete its directory.
Serial Monitor
Displays serial data being sent from the Arduino board. To senddata to the board, enter text and click on
the "send" button or press enter. Choose the baud rate from the drop-down that matches the rate passed
to Serial.begin in your sketch. Note that onWindows, Mac or Linux, the Arduino or Genuino board will
reset when you connect with the serial monitor.
Preferences:
Some preferences can be set in the preferences dialog (found under the Arduino menu on the Mac, or
Fileon Windows and Linux). The rest can be found in the preferences file, whose location is shown in
the preference dialog.

Language Support:
Since version 1.0.1, the Arduino Software (IDE) has been translated into 30+ different languages. By
default, the IDE loads in the language selected by your operating system. (Note: on Windows and
possibly Linux, this is determined by the locale setting which controls currency and date formats, not by
the language the operating system is displayed in.) If you would like to change the language manually,
start the Arduino Software (IDE) and open the Preferences window. Next to the Editor Language there is
a dropdown menu of currently supported languages. Select your preferred language from the menu, and
restart the software to use the selected language. If your operating system language is not supported, the
Arduino Software (IDE) will default to English.

Boards:
The board selection has two effects: it sets the parameters (e.g. CPU speed and baud rate) used when
compiling and uploading sketches; and sets and the file and fuse settings used by the burn boot loader
command. Some of the board definitions differ only in the latter, so even if you've been uploading
successfully with a particular selection you'll want to check it before burning the boot loader.
- Arduino/Genuino Uno: An ATmega328 running at 16 MHz with auto-reset, 6 Analog In, 14 Digital
I/O and 6 PWM.
- Arduino Mega: An ATmega1280 running at 16 MHz with auto-reset, 16 Analog In, 54 Digital I/O and
5
IOT 210820107015

15 PWM.
- Arduino Micro: An ATmega32u4 running at 16 MHz with auto-reset, 12 Analog In, 20 Digital I/O
and 7 PWM.

Arduino Cables:
Arduino is great but sometimes connecting interesting things to it can be a pain. Here are some things
that may make it easier for you. Here are some of the cables and pins that are available, and below we'll
show you how to use them for many different applications.

Standard issue USB 2.0

cables This is the most common A to B Male/Male type peripheral

cable.

Compatible with most Arduino boards such as Arduino Mega, Romeo, and Arduino Duemilanove.
Often used for printers and other peripherals. While still a little bulky in shape for small embedded
systems, thisis a standard cable found everywhere. Use this cable with Arduino UNO and others, but not
for ArduinoLeonardo based boards may come in White or Black.

6
IOT 210820107015

Practical: 2

Interface LED / Buzzer with Arduino Uno and write a program to turn ON LED for 1sec after every
2 seconds.

Hardware Required:
• Arduino or Genuino Board
• LED
• 220 ohm resistor

Circuit:

To build the circuit, connect one end of the resistor to Arduino pin 13. Connect the long leg of the LED
(the positive leg, called the anode) to the other end of the resistor. Connect the short leg of the LED (the
negative leg,called the cathode) to the Arduino GND, as shown in the diagram and the schematic below.
Most Arduino boards already have an LED attached to pin 13 on the board itself. If you run this example
with nohardware attached, you should see that LED blinks.
The value of the resistor in series with the LED may be of a different value than 220 ohm; the LED will lit
up also with values up to 1K ohm.

7
IOT 210820107015

Code:
After you build the circuit plug your Arduino or Genuino board into your computer, start the Arduino
Software (IDE) and enter the code below. You may also load it from the menu File/Examples/01.Basics/Blink .
The first thing you do is to initialize pin 13 as an output pin with the Line
pinMode(13, OUTPUT);
In the main loop, you turn the LED on with the line:

digitalWrite(13, HIGH);
This supplies 5 volts to pin 13. That creates a voltage difference across the pins of the LED, and lights
it up.Then you turn it off with the line:

digitalWrite(13, LOW);

That takes pin 13 back to 0 volts, and turns the LED off. In between the on and the off, you want enough time
for a person to see the change, so the delay() commands tell the board to do nothing for 1000 milliseconds, or
one second. When you use the delay() command, nothing else happens for that amount of time.

// the setup function runs once when you press reset or power the board
void setup()
{ // initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever


void loop()
{
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltagelevel)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

8
IOT 210820107015

Practical 3

Interface Push button/Digital sensor (IR/LDR) with Arduino Uno and write a program to turn ON
LED when push button is pressed or at sensor detection

Circuit:

Code:

int buttonState=0;
void setup()
{

pinMode(11, OUTPUT);
pinMode(4, INPUT);
}

Void loop()

9
IOT 210820107015

// read the state of the pushbutton


buttonState=digitalRead(4);

// check if pushbutton is pressed. if it is, the button state is HIGH


if(buttonState == HIGH){
digitalWrite(11, HIGH);

} else{

digitalWrite(11, LOW); //// Delay a little bit to improve simulation performance

delay(5);

Run the Circuit after simulation push button Pressed:

10
IOT 210820107015

Practical 4

To interface TMP36 sensor with Arduino Uno and write a program to print temperatureand
humidity readings

Circuit:

Code:

int baselineTemp =0;


int celsius = 0;
int fahrenheit = 0;
void setup()
{
pinMode(A1, INPUT);
Serial.begin(9600);
pinMode(5, OUTPUT);

11
IOT 210820107015

pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
}
void loop() {
// set threshold temperature to activate LEDsbaselineTemp
= 40;
// measure temperature in Celsius
celsius = map(((analogRead(A1) - 20) * 3.04), 0, 1023, -40, 125);
// convert to Fahrenheit
fahrenheit = ((celsius * 9) / 5 + 32);
Serial.print(celsius);
Serial.print(" C, ");
Serial.print(fahrenheit);
Serial.println(" F");
if (celsius < baselineTemp)
{ digitalWrite(5, LOW);
digitalWrite(6, LOW); digitalWrite(7,
LOW);
}
if (celsius >= baselineTemp && celsius < baselineTemp + 10)
{ digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
if (celsius >= baselineTemp + 10 && celsius < baselineTemp + 20)
{ digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
}
if (celsius >= baselineTemp + 20 && celsius < baselineTemp + 30)
{ digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
}
if (celsius >= baselineTemp + 30)
{ digitalWrite(5, HIGH);
digitalWrite(6, HIGH); digitalWrite(7,
HIGH);
}
delay(10); // Wait for 1000 millisecond(s)
12
IOT 210820107015

13
IOT 210820107015

Run the Circuit after Simulation:

14
IOT 210820107015

Practical 5

Interface motor using relay with Arduino Uno and write a program to turn ON motorwhen push button
is pressed

Circuit of Serial Motor:

Code:

int buttonState = 0;
int sensorValue = 0;
void setup()
{
pinMode(2, INPUT);
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop()
{

15
IOT 210820107015

// read the input pin


buttonState = digitalRead(2); // read the input on analog pin 0:
sensorValue = analogRead(A0);
// print values to the serial monitor
Serial.print(buttonState);
Serial.print(", ");
Serial.println(sensorValue);
delay(10); // Delay a little bit to improve simulation
performance }

Run the circuit after simulation:

16
IOT 210820107015

Practical 6

Perform Experiment using Arduino Uno to measure the distance of any object usingUltrasonic Sensor.
Circuit of Ultrasonic Sensor:

Code:

/*
Ping))) Sensor
This sketch reads a PING))) ultrasonic rangefinder and returns the distance to the closestobject in
range. To do this, it sends a pulse to the sensor to initiate a reading, and then listens for a pulse to
return. The length of the returning pulse is proportional to the distance of the object from the
sensor. The circuit:
* +V connection of the PING))) attached to +5V
* GND connection attached to ground
* SIG connection attached to digital pin 7
*/
int inches = 0;
int cm=0;

17
IOT 210820107015

long readUltrasonicDistance(int triggerPin, int echoPin)


{
pinMode(triggerPin, OUTPUT); // Clear the trigger
digitalWrite(triggerPin, LOW); delayMicroseconds(2);
// Sets the trigger pin to HIGH state for 10 microseconds
digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);
// Reads the echo pin, and returns the sound wave travel time in microseconds return
pulseIn(echoPin, HIGH);
}
void setup()
{
Serial.begin(9600);
}
void loop()
{
// measure the ping time in cm
cm = 0.01723 * readUltrasonicDistance(7, 7);
// convert to inches by dividing by 2.54
inches = (cm / 2.54); Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.println("cm");
delay(100); // Wait for 100 millisecond(s)
}

Run the circuit after simulation:

When value Outside the

Shadow:

18
IOT 210820107015

When value Low in the Shadow:

When value High in the Shadow:

19
IOT 210820107015

Practical 7

Perform Light Sensor (Potentiometer and Photoresister) using Arduino Uno.

Circuit of Potentiometer:

Code:

int sensorValue = 0;
void setup()
{

pinMode(A0, INPUT);
pinMode(13, OUTPUT);
}
void loop()
{
// read the value from the sensor
sensorValue = analogRead(A0);

20
IOT 210820107015

// turn the LED on


digitalWrite(13, HIGH);
// pause the program for <sensorValue> millseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
// turn the LED off
digitalWrite(13, LOW);
// pause the program for <sensorValue> millseconds
delay(sensorValue); // Wait for sensorValue millisecond(s)
}

Run the Circuit after Simulation:

When high Reading When Low Reading

21
IOT 210820107015

Circuit of Photoregister:

Code:

int sensorValue = 0;
void setup()
{

pinMode(A0, INPUT);
pinMode(9, OUTPUT);
Serial.begin(9600);

}
void loop()
{

// read the value from the sensor


sensorValue = analogRead(A0);
// print the sensor reading so you know its range
Serial.println(sensorValue);
22
IOT 210820107015

// map the sensor reading to a range for the LED


analogWrite(9, map(sensorValue, 0, 1023, 0, 255));
delay(100); // Wait for 100 millisecond(s)
}

Run the Circuit after Simulation:

When high Reading When Low Reading

23
IOT 210820107015

Practical 8

To Printed NeoPixel Ring Butterfly With Arudino Uno.

Circuit:

Code:
#include <Adafruit_NeoPixel.h>
// To add the NeoPixel library, which opens up a new set of commands we for controlling ourNeoPixel
ring. #define PIN 9
#define NUMPIXELS 24
int delayval = 50; int
currentColor = 0;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB +
NEO_KHZ800);
void setup()
{
pixels.begin(); // This initializes the NeoPixel lib
pixels.setBrightness(100);
pixels.show();
}
void loop()
{

24
IOT 210820107015

uint32_t red = pixels.Color(255, 0, 0); //red


uint32_t orange = pixels.Color(255, 100, 10); //orange
uint32_t yellow = pixels.Color(255, 255, 0); //yellow
uint32_t green = pixels.Color(0, 255, 0);//green uint32_t
dkgreen = pixels.Color(0, 115, 0);//dark greenuint32_t cyan
= pixels.Color(0, 255, 255); //cyan uint32_t blue =
pixels.Color(0, 0, 255); //blue
uint32_t magenta = pixels.Color(255, 0, 255); //magenta
uint32_t purple = pixels.Color(50, 0, 50); //purple
//put the colors in an array
uint32_t colors [9] = {red, orange, yellow, green, dkgreen, cyan, blue, magenta, purple};for
(int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, colors[currentColor]);
delay(delayval);
pixels.show();
currentColor++;
if (currentColor >= 9)
currentColor = 0;
}
}
Run the Circuit after simulation

25
IOT 210820107015

Practical 9

To perform PIR Motion Sensor with Arduino Uno

Circuit:

Code:

int sensorState = 0;
void setup()
{
pinMode(2, INPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop()
{
// read the state of the sensor/digital inputsensorState =
digitalRead(2);
26
IOT 210820107015

// check if sensor pin is HIGH. if it is, set the LED on. if


(sensorState == HIGH) {
digitalWrite(13, HIGH);
Serial.println("Sensor activated!");
} else
{
digitalWrite(13, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}

Run the circuit after simulation

LED blinked when High Value (Inside the LED not blink when Low Value (Outside
Shadow area) the Shadow area)

27
IOT 210820107015

Practical 10

An Introduction to Raspberry Pi

Introduction

Raspberry Pi is a series of low-cost single-board computers which comes with built-in features such as
WIFI andBluetooth 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:

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

28
IOT 210820107015

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:
https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up

1. Head over to below 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. https://www.raspberrypi.org/software/

Downloading the Raspberry Pi Imager


1. Head over to below given link to download the Raspberry Pi Imager as per your current available
system. https://www.raspberrypi.org/software/

• Windows

• macOS

• Ubuntu

2. Install the Imager to your system.

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

29
IOT 210820107015

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.

30
IOT 210820107015

echo>K:\ssh

Connecting SSH and VNC

1. Download and Install an open-source software called PuTTy from


https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

and VNC Viewer from https://www.realvnc.com/en/connect/download/viewer/

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.

i. Type sudo raspi-config in shell

ii. A menu will appear, goto Interfacing Options( Option Number 5)

iii. Choose SSH and choose "Enable Option"

iv. Choose VNC option and enable thisas well.

v. Goto Finish.

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

6. And you are done!

31
IOT 210820107015

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.
Variousdiscrete levels of voltages cannot be used with these pins.

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

32
IOT 210820107015

sudo apt-get install python-dev sudo


apt-get install python-rpi.gpio

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 https://elec-club-iitb.github.io/tutorials/r_pi/


articlefromElectronics 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.

33
IOT 210820107015

Practical 11

Installing Android on Raspberry Pi.


Prerequisites:
Operating
System:
Android has vast applications. It can be run on raspberry pi. Download the image file of android
OS from the link as given below(with name CynogenMOD 7.2)[5.1]:
http://androidpi.wikia.com/wiki/Android_Pi_Wiki

Win32 disk:

The downloading Procedure of Win32 Disk is same as experiment-2.

Procedure:

Step 1: Extract the Image file.

Step 2 : Insert SD Card into pc/laptop (system on which OS and win32disk is downloaded).
Make sure that SD card is empty and have atleast 4GB memory.
Step 3 : Open win32 disk. The UI view of it is shown in fig-
2.1. Step 4 : Browse the image file which has downloaded .
Step 5: Click on “write”.

Step 6: When writing is complete, remove the SD card and insert it into the raspberry pi.

Step7: ON the power of raspberry pi. Blinking Status of green LED shows that booting has
started.

References:

1. http://androidpi.wikia.com/wiki/Android_Pi_Wiki

2. Getting Started with Raspberry Pi by O‟REILLY

34

You might also like