IOT Mithlesh
IOT Mithlesh
ENROLLMENT NO : 220160107147
SEMESTER : 6
DEPARTMENT : COMPUTER ENGINEERING
DIVISION : B (B3)
SUBJECT : INTERNET OF THINGS (IOT)
Index
Sr. No. Practicals
1. Understanding Arduino UNO, NodeMCU and Raspberry Pi and Arduino IDE.
2. Controlling LED ON/OFF using Arduino UNO.
3. Measuring Temperature and Humidity using Sensor DHT-11 and Arduino UNO.
4. Measuring object presence using IR Sensor and when present, use buzzer for
notification.
8. Controlling Led ON/OFF by giving command from mobile phone. (Use cloud
ThingSpeak)
9. Controlling Led ON/OFF by giving command using Google Assistant from mobile
phone. (Use cloud Adafruit)
10. Installing Raspbian OS in Raspberry Pi and performing basic practical like LED
on/off.
Practical – 1
Aim : Understanding Arduino UNO, NodeMCU and Raspberry Pi and
Arduino IDE.
Arduino UNO :
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping,
aimed at students without a background in electronics and programming. As soon as it
reached a wider community, the Arduino board started changing to adapt to new needs and
challenges, differentiating its offer from simple 8-bit boards to products for IoT applications,
wearable, 3D printing, and embedded environments. All Arduino boards are completely
open-source, empowering users to build them independently and eventually adapt them to
their particular needs. The software, too, is open-source, and it is growing through the
contributions of users worldwide.
Arduino has been used in thousands of different projects and applications. The Arduino
software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac,
Windows, and Linux. Teachers and students use it to build low cost scientific instruments, to
prove chemistry and physics principles, or to get started with programming and robotics.
Designers and architects build interactive prototypes, musicians and artists use it for
installations and to experiment with new musical instruments. Makers, of course, use it to
build many of the projects exhibited at the Maker Faire, for example. Arduino is a key tool to
learn new things. Anyone - children, hobbyists, artists, programmers - can start tinkering just
following the step by step instructions of a kit, or sharing ideas online with other members of
the Arduino community.
There are many other microcontrollers and microcontroller platforms available for physical
computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and
many others offer similar functionality. All of these tools take the messy details of
microcontroller programming and wrap it up in an easy-to-use package. Arduino also
simplifies the process of working with microcontrollers, but it offers some advantage for
teachers, students, and interested amateurs over other systems:
NodeMCU :
NodeMCU is an open-source Lua based firmware and development board specially targeted
for IoT based Applications. It includes firmware that runs on the ESP8266 Wi-Fi SoC from
Espressif Systems, and hardware which is based on the ESP-12 module.
Raspberry Pi :
The Raspberry Pi launched in 2012, and there have been several iterations and variations
released since then. All over the world, people use the Raspberry Pi to learn programming
The Raspberry Pi is a very cheap computer that runs Linux, but it also provides a set of GPIO
(general purpose input/output) pins, allowing you to control electronic components for
physical computing and explore the Internet of Things (IoT).
Arduino IDE :
The Arduino Integrated Development Environment (IDE) is a cross-platform application
(for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write
and upload programs to Arduino compatible boards, but also, with the help of third-party
cores, other vendor development boards.
The source code for the IDE is released under the GNU General Public License, version 2.
The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures. User-written code only requires two
basic functions, for starting the sketch and the main program loop, that are compiled and
linked with a program stub main() into an executable cyclic executive program with the GNU
toolchain, also included with the IDE distribution.The Arduino IDE employs the
program avrdude to convert the executable code into a text file in hexadecimal encoding that
is loaded into the Arduino board by a loader program in the board's firmware. By default,
avrdude is used as the uploading tool to flash the user code onto official Arduino boards.
Arduino IDE is a derivative of the Processing IDE, however as of version 2.0, the Processing
IDE will be replaced with the Visual Studio Code-based Eclipse Theia IDE framework.
With the rising popularity of Arduino as a software platform, other vendors started to
implement custom open source compilers and tools (cores) that can build and upload sketches
to other microcontrollers that are not supported by Arduino's official line of microcontrollers.
Practical – 2
Aim : Controlling LED ON/OFF using Arduino UNO.
Components required :
• USB cable * 1
• Resistor (220Ω) * 1
• LED * 1
• Breadboard * 1
• Jumper wires
Configuration :
Schematic Diagram
Figure :
Figure
Procedure :
Connect one end to the anode (the long pin) of the LED to the 220ohm resistor one end, the
other end of resistor connected to the Pin 9 in arduino , and the cathode (the short pin) of the
LED to GND.
When the pin 9 outputs high level, the current gets through the current limiting resistor to the
anode of the LED. And since the cathode of the LED is connected to GND, the LED will
light up.
Step 1:
Step 2:
Code :
void setup() {
// LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
// wait for (1 sec = 1000ms)
digitalWrite(LED_BUILTIN, LOW);
delay(2000);
// wait for (2 sec = 2000ms)
}
Step 3:
Click the Upload icon to upload the code to the control board.
If "Done uploading" appears at the bottom of the window, it means the sketch has been
successfully uploaded.
Conclusion :
From the above practical we demonstrated that a led can be turn off/on using arduino uno.
Practical – 3
Aim : Measuring Temperature and Humidity using Sensor DHT-11 and
Arduino UNO.
Components required :
• Breadboard * 1
• Jumper wires
Configuration :
Figure :
Procedure :
Code :
#include <dht.h>
#define dht_11_PIN7
dht DHT;
void setup(){
Serial.begin(9600);
void loop(){
DHT.read11(dht_apin);
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
delay(5000);
Now write code in IDE. In the Arduino IDE, go to Sketch >> Include Library >> Add
ZIP file.
When you click the 'Add .ZIP library', you should get a file window that pops up. Add
the DHT_Library.zip.
NOW upload the code. When it is finished, go to the top right of the Arduino IDE
window and click the little magnifying glass button. That will open the serial monitor,
and the data of the sensor should be displaying itself and updating every 5 seconds.
OUTPUT :
Conclusion :
From the above practical we demonstrated that arduino uno can be used to measure
temperature and humidity with sensor DHT-11 at an interval of 5 seconds.
Practical – 4
Aim : Measuring object presence using IR Sensor and when present, use
buzzer for notification.
COMPONENTS:
1. Arduino UNO
2. Jumper Cables
3. Buzzer
4. Bread board
5. IR Sensor
PROCEDURE:
1. Build the circuit according to the above circuit diagram.
2. Then, open the Arduino IDE and write the following code:
OBSERVATION :
CONCLUSION:
From the above practical we can conclude that using IR sensor with arduino
UNO, presence of an object can be detected upto a particular distance from the
sensor
Practical – 5
Aim : Measuring object distance using Ultraviolet Sensor and Arduino
Uno.
Components required :
• Jump Wires
• BreadBoard * 1
Configuration :
Figure :
Procedure :
First, place the distance sensor on one end of the breadboard so that none of the pins are
connected as shown
➢ Lastly, complete the circuit by connecting the Ultrasonic Sensor's ground pin to the Arduino's
ground pin.
The ultrasonic sensor is a cheap sensor that can measure 2cm to 400cm of non-contact
measurement functionality with a ranging accuracy that can reach up to 3mm. It uses sonar
waves for echolocation, like bats, to be able to measure distances. This project is an
introduction to the use of an ultrasonic sensor, since it is often not straightforward nor
intuitive to wire and code.
Code :
void setup() {
pinMode(trigger, OUTPUT);
pinMode(echo, INPUT); /
Serial.begin(9600);
void loop() {
digitalWrite(trigger, LOW);
delayMicroseconds(2);
digitalWrite(trigger, HIGH);
delayMicroseconds(10);
digitalWrite(trigger, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
distance= duration*0.034/2;
Serial.print("Distance: ");
Serial.println(distance);
OUTPUT :
Conclusion :
From the above practical we demonstrated that using ultraviolet sensor with arduino uno the
distance to an object can be measured in range of 2cm to 400cm.
Practical – 6
Aim : Measuring moving object using PIR Sensor and Arduino Uno.
Components required :
• PIR Sensor * 1
• 5V Buzzer * 1
• BreadBoard * 1
• Connecting Wires
Configuration :
The design of the PIR Motion Sensor using Arduino is very simple. The PIR Sensor Module
has three pins: VCC, Digital Out and GND. Connect VCC and GND to +5V and GND
respectively. Then connect the Digital Out Pin of the PIR sensor to the digital I/O pin 8 of
Arduino.
As we need to indicate the detection of motion by the sensor, connect a buzzer to Pin 11 of
the Arduino.
Figure :
Procedure :
The working of this project is very simple. When the system is powered on, the Arduino
waits for the PIR Sensor to be calibrated. The calibration period is set to 10 seconds and
during this time, there should be no movements in front of the PIR Sensor.
After the calibration, the PIR Sensor will be ready to detect any movement in front of it. If
the PIR Sensor detects any movements, its Digital Out pin, which is connected to Pin 8 of
Arduino will become HIGH.
Arduino will detect this HIGH Signal and activates the buzzer.
Code :
int sensor = 8;
void setup()
pinMode(buzzer, OUTPUT);
pinMode(sensor, INPUT);
pinMode(led, OUTPUT);
digitalWrite(buzzer,LOW);
digitalWrite(sensor,LOW);
digitalWrite(led,LOW);
while(millis()<13000)
digitalWrite(led,HIGH);
delay(50);
digitalWrite(led,LOW);
delay(50);
digitalWrite(led,HIGH);
void loop()
if(digitalRead(sensor)==HIGH)
digitalWrite(buzzer,HIGH);
delay(3000);
digitalWrite(buzzer,LOW);
while(digitalRead(sensor)==HIGH);
Conclusion :
From the above practical we demonstrated that using PIR sensor with arduino the motion of
an object can be detected.
Practical – 7
Aim : Measure temperature using DHT-11 sensor and send it to cloud
ThingSpeak using NodeMCU.
Components required :
• NodeMCU * 1
• Breadboard * 1
• Jumper wires
Configuration :
Figure :
Procedure :
2. Create a new channel by clicking on the button. Enter the basic details of the channel. Then
Scroll down and save the channel.
3. Then go to API keys copy and paste this key to a separate notepad file. You will need it
later while programming.
The program for Humidity & Temperature Monitoring using DHT11 & NodeMCU on
Code :
#include <DHT.h> // Including library for dht
#include <ESP8266WiFi.h>
ThingSpeak
const char *ssid = "how2electronics"; // replace with your wifi ssid and wpa2 key
WiFiClient client;
void setup()
{
Serial.begin(115200);
delay(10);
dht.begin();
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
{
delay(500);
Serial.print(".");
Serial.println("");
Serial.println("WiFi connected");
void loop()
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t))
return;
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(h);
client.stop();
Serial.println("Waiting...");
delay(1000);
OUTPUT :
On every successful data upload, success message is displayed on serial monitor
Output of this practical is seen on Thingspeak and serial monitor. Open channel at
Thingspeak and output will be shown as mentioned ahead.
Temperature :
Humidity :
Conclusion :
From the above practical we demonstrated that using NodeMCU, the data (temperature and
humidity measured by DHT-11) can be send to the ThingsSpeak cloud.
Practical – 8
Aim : Controlling Led ON/OFF by giving command from mobile phone.
(Use cloud ThingSpeak)
Components required :
• NodeMCU 12E * 1
• LED * 1
• Breadboard * 1
• Jumper wires
Configuration :
Schematic Diagram
Figure :
Procedure :
➢ After click the new channel and first write the name of the new channel .
➢ if you want give the description then write the description. and select the Field 1 and
don't forget the click on checkbox, after click on the check box scroll the page and
click on the save button.
➢ I give the new channel name is LED then select the Field 1 and scroll the page and
click on the save channel button.
➢ Here filed is empty because I do not upload any data on the channel. Now our goal to blink
the led via webserver.
Firmware :
➢ Now write the code in Arduino IDE. open the Arduino IDE and select the NodeMCU
12E board
Code :
#include<ThingSpeak.h>
#include<ESP8266WiFi.h>
#include<ESP8266WebServer.h>
int led;
WiFiClient client; // make the client of the WiFi which connect to the ThingSpeak webServer
pinMode(D1,OUTPUT);
digitalWrite(D1,0);
Serial.begin(115200);
while(WiFi.status()!=WL_CONNECTED)
delay(500);
Serial.print(".");
server.on("/",handleonconnect); // in urt type the "/" then call the handle on connect function
if(led==1)
digitalWrite(D1,1);
else if(led==0)
digitalWrite(D1,0);
server.send(200,"text/html",SendHTML());
➢ Show the Thingspeak server where we create the our new channel. and copy the
channel id and pate to the our Arduino IDE.
HTML :
String SendHTML(void){
String ptr = "<!DOCTYPE html> <html>\n";
ptr +="<head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0,
user-scalable=no\">\n";
ptr +="<title>LED Control</title>\n";
ptr +="<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-
align: center;}\n";
ptr +="body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;} h3 {color:
#444444;margin-bottom: 50px;}\n";
ptr +=".button {display: block;width: 80px;background-color: #1abc9c;border: none;color:
white;padding: 13px 30px;text-decoration: none;font-size: 25px;margin: 0px auto
35px;cursor: pointer;border-radius: 4px;}\n";
ptr +=".button-on {background-color: #1abc9c;}\n";
ptr +=".button-on:active {background-color: #16a085;}\n";
ptr +=".button-off {background-color: #34495e;}\n";
ptr +=".button-off:active {background-color: #2c3e50;}\n";
ptr +="p {font-size: 14px;color: #888;margin-bottom: 10px;}\n";
ptr +="</style>\n";
ptr +="</head>\n";
ptr +="<body>\n";
ptr +="<h1>ESP8266 with ThingSpeak Server</h1>\n";
ptr +="<h3>Using Station(STA) Mode</h3>\n";
ptr +="<h4>Control status For D1</h4>\n";
ptr +="<a class=\"button button-on\"
href=\"https://api.thingspeak.com/update?api_key=MOHD33LYGVXTG5UF&field1=1\">O
N</a>\n";
ptr +="<a class=\"button button-off\"
href=\"https://api.thingspeak.com/update?api_key=MOHD33LYGVXTG5UF&field1=0\">O
FF</a>\n";
ptr +="</body>\n";
ptr +="</html>\n";
return ptr;
➢ That is my HTML code if you are an embedded engineer then do not learn the HTML and
CSS, but knowledge abut the how it work we press the any url.
➢ https://api.thingspeak.com/update?api_key=MOHD33LYGVXTG5UF&field1=0 thi
s url is copy from the thingserver here api_key is different in your case last one
&field1=0 mean we we press this url then send the 0 on your thingspeak server to the
field1 and &field1=1 mean when we press this url then send the 1 on your thingspeak
server to the field1. but we don't press the url using HTML code we only clink on the ON
button to turn on the led and OFF button for turn off the led.
➢ Now go to the thingspeak server click on the API KEYS and copy the Write API
KEY and paste the HTML code code which highlighted on the upper HTML code pic.
➢ so for that click on sharing button and click the Share channel view with everyone.
➢ Finally upload the code on the NodeMCU. show the serial port wifi is connect or not if
connect then give the local ip where we print on serial.
➢ Finally this IP copy on the Chrome browser. then show the this type.
OUTPUT :
➢ So finally LED is ON
➢ Now show the status of the thingSpeak server.
Conclusion :
From the above practical we demonstrated that using ThingsSpeak cloud through NodeMCU
we can turn on/off the LED using commands from mobile.
Practical – 9
Aim : Controlling Led ON/OFF by giving command using Google Assistant
from mobile phone. (Use cloud Adafruit)
Components :
• Breadboard * 1
• ESP32 Module * 1
• USB Cable * 1
• LED
• Account on AdaFruit IO
• Account on IFTTT
Procedure :
➢ After creating Account you will be taken to your home screen. Click
on “Feeds” from the menu.
➢ Now click on New Feed and then create a New feed. Then it will ask you to
name your feed I am giving it LED_Control, you can give according to you
and then create and your feed is created.
➢ Now open your new dashboard by simply clicking on it and you should be taken
to a mostly blank page. Clicking on blue + button will let you add new UI
components to the dashboard.
➢ For this practical I just need a button, so select first option, it will ask you to
select the feed, so select the one you just made and keep the defaults for the rest
of the settings.
➢ During programming you will required your unique AIO key so for this
click on key button at right hand corner of your window on My Key option.
➢ After clicking on key button your Active key for this project is generated,
don’t share this key with anyone this must be confidential.
In this step, we will connect our Google Assistant to the Adafruit IO MQTT
Broker to allow us to control the lights with voice commands. To do this I
am using IFTTT (If This Then That) platform.
➢ After clicking on New applet you will find a window which ask you ‘If this then
that’. The term IF THIS THEN THAT means if something happens on the
“This” then we have do something on “that”.
➢ Click on + blue button and search for “Google Assistant”, and then select “Say
a simple phrase” from the menu of specific triggers. This will ask you some
details, fill according to you and create trigger.
➢ Now you have to give Action so click on + button of “That”, and search
for Adafruit and click on “Send data to Adafruit IO”
➢ Now it will ask you to select the Feed name so select the feed that you made
earlier for this project and in Data to save we will send ON for this applet and
click on Create action.
➢ Once you have created this applet, you have to create another applet for turning
the LED “OFF”. You have to follow the same steps to create another applet.
➢ After creating both the applets go to “My Applets” and you can see both the
applets here.
After installing this library We are ready to use Adafruit IO with the ESP32.
Code :
#include <WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#define WLAN_SSID "Ashish"
#define WLAN_PASS "12345678"
#define AIO_SERVER "io.adafruit.com"
#define AIO_SERVERPORT 1883
#define AIO_USERNAME "DURGESH_SINGH"
#define AIO_KEY "aio_OQrD206pQvpMfzJhKcPPXBnw79DL"
int output=2;
WiFiClient client; // Create an ESP8266 WiFiClient class to connect to the MQTT server.
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT,
AIO_USERNAME, AIO_KEY); // Setup the MQTT client class by passing in the WiFi
client and MQTT server and login details.
Adafruit_MQTT_Subscribe LED_Control = Adafruit_MQTT_Subscribe(&mqtt,
AIO_USERNAME "/feeds/LED_Control");
void MQTT_connect();
void setup() {
Serial.begin(115200);
delay(10);
pinMode(2,OUTPUT);
// Connect to WiFi access point.
Serial.println(); Serial.println();
Serial.print("Connecting to ");
Serial.println(WLAN_SSID);
WiFi.begin(WLAN_SSID, WLAN_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: "); Serial.println(WiFi.localIP());
mqtt.subscribe(&LED_Control);
}
uint32_t x=0;
void loop() {
MQTT_connect();
Adafruit_MQTT_Subscribe *subscription;
while ((subscription = mqtt.readSubscription(5000))) {
if (subscription == &LED_Control) {
Serial.print(F("Got: "));
Serial.println((char *)LED_Control.lastread);
if (!strcmp((char*) LED_Control.lastread, "ON"))
{
digitalWrite(2, HIGH);
}
else
{
digitalWrite(2, LOW);
}
}
}
}
void MQTT_connect() {
int8_t ret;
// Stop if already connected.
if (mqtt.connected()) {
return;
}
Serial.print("Connecting to MQTT... ");
uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) { // connect will return 0 for connected
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000); // wait 5 seconds
retries--;
if (retries == 0) {
// basically die and wait for WDT to reset me
while (1);
}
}
Serial.println("MQTT Connected!");
}
OUTPUT :
After uploading of code open your serial monitor and your serial monitor should look
like this:
Now open Google assistant in your Android and give voice command like “Turn LED
on” or “Turn LED off” and it will respond you like you defined earlier and you will
observe change of LED state also.
Conclusion :
From the above practical we demonstrated that using ESP32 Module with
arduino uno we can control led on/off by giving command from google assistant
and using cloud Adafruit.
Practical – 10
Aim : Installing Raspbian OS in Raspberry Pi and performing basic
practical like LED on/off.
Components required :
• Rasperry Pi 3 Setup
• Resistor Pack
• Red LED * 1
• Breadboard * 1
• Jumper wires
Configuration :
Figure :
Procedure :
The first step in this project is to design a simple LED circuit. Then we will make the LED
circuit controllable from the Raspberry Pi by connecting the circuit to the general purpose
input/output (GPIO) pins on the Raspberry Pi.
A simple LED circuit consists of a LED and resistor. The resistor is used to limit the current
that is being drawn and is called a current limiting resistor. Without the resistor the LED
would run at too high of a voltage, resulting in too much current being drawn which in turn
would instantly burn the LED, and likely also the GPIO port on the Raspberry Pi.
To calculate the resistor value we need to examine the specifications of the LED. Specifically
we need to find the forward voltage (VF) and the forward current (IF). A regular red LED has
a forward voltage (VF) of 1.7V and forward current of 20mA (IF). Additionally we need to
know the output voltage of the Raspberry Pi which is 3.3V.
We can then calculate the resistor size needed to limit the current to the LED’s maximum
forward current (IF) using ohm’s law like this:
RΩ=VI=3.3–VFIF=3.3–1.720mA=80Ω
Unfortunately 80 ohm is not a standard size of a resistor. To solve this we can either combine
multiple resistors, or round up to a standard size. In this case we would round up to 100 ohm.
With the value calculated for the current limiting resistor we can now hook the LED and
resistor up to GPIO pin 8 on the Raspberry Pi. The resistor and LED needs to be in series like
the diagram below. To find the right resistor use the resistor color code – for a 100 ohm
resistor it needs to be brown-black-brown. You can use your multimeter to double check the
resistor value.
When hooking up the circuit note the polarity of the LED. You will notice that the LED has a
long and short lead. The long lead is the positive side also called the anode, the short lead is
the negative side called the cathode. The long should be connected to the resistor and the
short lead should be connected to ground via the blue jumper wire and pin 6 on the Raspberry
Pi as shown on the diagram.
With the circuit created we need to write the Python script to blink the LED. Before we start
writing the software we first need to install the Raspberry Pi GPIO Python module. This is a
library that allows us to access the GPIO port directly from Python.
To install the Python library open a terminal and execute the following
With the library installed now open your favorite Python IDE (I recommend Thonny Python
IDE more information about using it here).
To initialize the GPIO ports on the Raspberry Pi we need to first import the Python library,
the initialize the library and setup pin 8 as an output pin.
Code :
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
from time import sleep # Import the sleep function from the time module
from time import sleep # Import the sleep function from the time module
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW) # Set pin 8 to be an output pin and set initial
value to low (off)
With our program finished, save it as blinking_led.py and run it either inside your IDE or in
the console with:
$ python blinking_led.py
OUTPUT :
Conclusion :
From the above practical we demonstrated that how to install Raspbian OS in Raspberry Pi
and perform basic operation like LED on/off.