Iot Lab Answers - Deleted
Iot Lab Answers - Deleted
Iot Lab Answers - Deleted
College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
1. Select any one development board (Eg., Arduino or Raspberry Pi) and control LED using the
board.
Aim: To devlop an Ardino or Raspberry Pi and control LED using the board.
Components Required:
S.NO COMPONENTS QUANTITY
1. ARDUINO BOARD 1
2. LED LIGHT 1
3. SWITCH 1
4. CONNECTING WIRES 10
5. PC 1
6. BREADBOARD 1
Arduino UNO:
The Arduino UNO is a standard
board of Arduino. Here UNO means
'one' in Italian. It wasnamed as UNO to
label the first release of Arduino
Software. It was also the first USB
boardreleased by Arduino. It is
considered as the powerful board
used in various projects.Arduino.cc
developed the Arduino UNO board.
The Arduino UNO includes 6 analog pin inputs, 14 digital pins, a USB connector, a powerjack,
and an ICSP (In-Circuit Serial Programming) header. It is programmed based on IDE,which stands for
Integrated Development Environment. It can run on both online and offlineplatforms.
Push Buttons:
A push-button is a easy transfer mechanism to govern some
issue of a system. while the pushbutton is open (unpressed) there is no
connection between the 2 legs of the push button, sothe pin is hooked up
to floor (thru the pull-down resistor) and we study a LOW. whilst
thebutton is closed (pressed), it makes a connection among its legs,
connecting the pin to 5 volts,so that we study a excessive. Figure shows
a view of push button
Resistors:
A resistor is a
passive two-terminal
device that implements
electric resistance as
acircuit. Resistors are
used to resist the flow
of current and have a
stated cost of
Resistance.Many kinds
of resistors are used
having extraordinary
makes use of and construction. Themost common types have a hard and fast value of resistance so are
often referred to as fixedresistors, Figure shows a view of resistors.
Page No.:2
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Theory :
LED (Light emitting diode) works with very little power. The digital pin 13 is built in the
Arduino board for the LED. LED’s have polarity will work only the legs are oriented in the proper way.
The two legs of the LED, one leg goes for the positive and other leg is for the ground. The LED has flat
edge on one side of the bulb. To protect the LED we should use resistors in series to protect it from
burning.
Circuit Diagram :
As shown in Figure resistors are used to safe guard the Light emitting diodes from the higher
voltage and prevent them from burning.
Procedure:
1. Make connections as per circuit diagram.
2. Connect the Arduino to pc and configure Arduino IDE.
3. Copy and verify the code in Arduino IDE.
4. Upload the code to Arduino.
5. Now we can see the L.E.D lights up.
Page No.:3
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
2. Using the same board as in (1), read data from a sensor. Experiment with both analog and digital
sensors.
Aim: To read data from a sensor Using the development board. Experiment with digital sensor.
Components Required:
Name Quantity component
U1 1 Arduino UNO R3
D1 1 Red LED
R1 1 220 Ohm Resistor
PIR1 1 -3.598290659201581,-294.29818133729066,-194.67798997574994 PIR
Sensor
Procedure:
Let's learn to sense movement in a room with a PIR motion sensor and Arduino. We'll connect up
a circuit using a breadboard and use some simple Arduino code to control three LEDs. So far you've
already learned to read a push button with Arduino's digital input, so we'll build on those skills in this
lesson. Although the motion sensor may seem complex with its dedicated circuit board, it is configured to
send a HIGH or LOW signal in much the same way a pushbutton would. PIR stands for Passive Infra
Red, which describes the technology inside—it passively detects infrared light levels (unlike an
infrared camera that may also emit infrared light in order to capture its reflection). The white dome is a
lens that expands the IR detector's field of vision. The sensor reports a LOW signal by default, reads the
amount of ambient infrared light coming in, and then triggers a HIGH signal for a certain period of time
when the light levels change, indicating movement. It can tell you whether or not there is movement in a
scene, but cannot detect distance— for that you might consider a type of analog input sensor called an
ultrasonic rangefinder.
Circuit:
Page No.:4
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
OUTPUT:
Page No.:5
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Aim: To read data from a sensor Using the development board. Experiment with analog sensor.
Components Required:
Name Quantity Component
U1 1 Ardunio Uno R3
U2 1 Temparature Sensor(TMP36)
D1 3 Red LED
D2
D3
R1 3 220 Ohm Resistor
R2
R3
Procedure:
In this project, you will turn the Arduino into a thermometer! Use a temperature sensor to
measure your skin temperature, and register the output with three LEDs. Even though the Arduino is a
digital tool, it can interpret signals from an analog input, like the temperature sensor, using the built in
Analog-to-Digital (ADC) converter, accessed through the analog pins, which you may have learned about
in a previous lesson about analog input.
1. Explore the sample circuit here in the work plane by starting the simulation, clicking on the
sensor, then dragging its temperature slider to adjust the simulated input and observe the
resulting LED patterns.
2. In this lesson, you'll build this simulated circuit yourself along side the sample. To optionally
build the physical circuit, gather up your Arduino Uno board, USB cable, solder less breadboard,
three LEDs, three alike resistors (any value from 100-1K, 220 ohms preferred), a TMP36
temperature sensor, and breadboard wires.
3. Can you identify all these components in the breadboard circuit pictured?
Circuit:
Page No.:6
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Page No.:7
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
3. Control any two actuators connected to the development board using Bluetooth.
AIM: To Control any two actuators connected to the development board using Bluetooth.
Components Required:
• Arduino UNO board
• USB cable for connecter Arduino UNO
• Bluetooth Module HC-05
• Jumper wires male to female
• 2 LED’s
PROCEDURE:
There are three main components used; an Android Smartphone, Bluetooth transceiver, and an
Arduino. The Android app is built to send serial data to the Bluetooth Module HC-05 by pressing ON
button. As Bluetooth Module HC-05 works on serial communication. It receives the data from the app
and sends it through TX pin of Bluetooth module to RX pin of Arduino. The uploaded code inside
Arduino checks the data received. If the receive data is 1, the LED turns ON, and if the received data is 0
the LED turns OFF.
1. For doing the programming for Arduino board, we need to download Arduino software. This can
be done from Arduino official site https://www.arduino.cc/
2. After installation, open the software, and if it generates a security alert then allow it.
3. Write a program for Arduino UNO board, if received data is equal to 1, LED turns on and if data
is equal to 0, LED turns OFF.Save your program and compile it.
4. Connect your Arduino device to your Laptop (or Monitor) via Arduino UNO USB cable.
Remove all the other connections with Arduino UNO device such as Bluetooth Module and LED
while uploading the program in Arduino UNO.
5. After compiling the code, upload it in Arduino UNO device. Before uploading the code in
Arduino, UNO device makes sure that your Arduino serial port is selected otherwise, it generates
an error message "Serial port not selected".
6. To select your serial port, open Device Manager > Ports >Arduino Uno, and then upload your
code.Download the Android app's .apk file and install it on your Android smartphone.
7. Step to connect with Android app with Bluetooth Module
8. Open Bluetooth connecter app and allow turning on Bluetooth of the device.
9. Search for Bluetooth device for making the pair. To pair with Bluetooth HC-05 module, enter a
pin 0000 or 1234.
Select pair device HC-05 to connect with Android app.
Control LED device.While clicking "ON" button it sends data 1 to Bluetooth module and this data
is transmitted from the Bluetooth module to Arduino device and it turns ON the LED. When clicking
"OFF", Android app sends data 0 to Bluetooth module, and this data is transmitted from the Bluetooth
module to Arduino and it turns OFF the LED.
Page No.:8
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
CIRCUIT DIAGRAM:
Program:
// Define variable to store received data
char receivedData = 0;
void setup() {
// Start serial communication
Serial.begin(9600);
void loop() {
// Check if data is available to read
if (Serial.available() > 0) {
// Read the incoming data
receivedData = Serial.read();
Page No.:9
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
4 .Read data from sensor should and send it to a requesting client by using socket communication.
Aim:
To read data from sensor should and send it to a requesting client by using socket communication.
Components:
▪ Arduino UNO – read Best Arduino Starter Kits
▪ SIM900 GSM Shield
▪ 5V 2A Power Adaptor
▪ FTDI programmer (optional)
▪ SIM Card
▪ DHT11 or DHT22 Temperature and Humidity Sensor
▪ 10 kOhm resistor
▪ Breadboard
▪ Jumper Wires
Procedure:
• In this project we’re going to show you how to request sensor data via SMS with the Arduino. As
an example we’re going to request the temperature and humidity from a DHT11 sensor. To send
and receive SMS with the Arduino we’re going to use the SIM900 GSM shield.
• The shield uses the original SIM card size, not micro or nano. If you have micro or nano you may
consider getting a SIM card size adapter.
Turn off the PIN lock :
In my case, I need to go through: Settings > Advanced Settings > Security > SIM lock and turn off the
lock sim card with pin.
Getting the right power supply:
To power up the shield, it is advisable to use a 5V power supply that can provide 2A as the one shown
below.
You can find the right power adapter for this shield here. Make sure you select the model with 5V and
2A.
Page No.:10
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
1) Insert the SIM card into the SIM card holder. You need a SIM card with the standard size. The shield
is not compatible with micro or nano SIM cards. If you need, you may get a sim card size adapter. Also,
it is advisable to use a SIM card with a prepaid plan or unlimited SMS.
2) Confirm the antenna is well connected.
3) On the serial port select, make sure the jumper cap is connected as shown in figure below to use
software serial.
4) Power the shield using an external 5V power supply. Double-check that you have the external power
source selected as we’ve mentioned earlier.
5) To power up/down the shield press the power key for about 2 seconds.
6) Then, the Status LED will light up and the NetLight LED will blink every 800 ms until it finds the
network. When it finds the network the NetLight LED will start blinking every three seconds.
7) You can test if the shield is working properly by sending AT commands from the Arduino IDE using
an FTDI programmer.
Circuit Diagram:
You have to connect the SIM900 GSM shield and the DHT11 temperature and humidity sensor to the
Arduino as shown in the figure below.
Source Code:
The following code reads the temperature and humidity from the DHT sensor and sends them via
SMS when you send an SMS to the Arduino with the message “STATE”.
You need to modify the code provided with the phone number your Arduino should reply the
readings to.
The code is well commented for you to understand the purpose of each line of code. Don’t
upload the code now. Scroll down and read the explanation below the code.
#include "DHT.h"
#include <Adafruit_Sensor.h>
#include <SoftwareSerial.h>
Page No.:11
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
#define DHTPIN 2
#define DHTTYPE DHT11
float t;
float f;
float h;
char incomingChar;
void setup() {
dht.begin();
Serial.begin(19200);
SIM900.begin(19200);
delay(20000);
Serial.print("SIM900 ready...");
SIM900.print("AT+CMGF=1\r");
delay(100);
SIM900.print("AT+CNMI=2,2,0,0,0\r");
delay(100);
}
void loop() {
if (SMSRequest()) {
if (readData()) {
delay(10);
SIM900.println("AT + CMGS = \"+XXXXXXXXXX\"");
delay(100);
String dataMessage = ("Temperature: " + String(t) + "*C " + " Humidity: " + String(h) + "%");
SIM900.print(dataMessage);
delay(100);
SIM900.println((char)26);
delay(100);
SIM900.println();
delay(5000);
}
}
delay(10);
}
Page No.:12
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
}
}
}
}
}
return false;
}
Page No.:14
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
5. Create any cloud platform account, explore IoT services and register a thing on the platform.
Procedure:
The first thing we are going to do is create a project. If you have already worked with Google
Cloud Platform and have at least one project, you will be taken to the first project in the list or you will be
taken to the Getting started page.
As of the time of writing this book, Google Cloud Platform has a free trial for 12 months with $300 if the
offer is still available when you are reading this chapter, I would highly recommend signing up:
Once you have signed up, let’s get started by creating a new project. From the top menu bar,
select the Select a Project dropdown and click on the plus icon to create a new project. You can fill in the
details as illustrated in the following screenshot:
Page No.:15
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
The best part of using Google Cloud Platform is that it provides unique offerings for Big Data and
Artificial Intelligence and IoT services. Also while building a project, scalability is the major part of the
concern, so due to its serverless architecture, GCP met the requirements of the project. Some of the
components for IoT solution with Google Cloud Platform are as follows -
BigQuery
It is a cloud-based IaaS model designed by Google which is used for storing and processing enormous
datasets with the help of several SQL queries. It can be said that BigQuery is a type of database which is
different from the transactional databases like MySQL and MongoDB.
Hardware
Google offers a version of Android for IoT devices which is known as Android Things. Android Things
helps the developers to configure and push the software updates to the operating system.
Cloud Functions
For routing the data after entering into the Pub/Sub, cloud functions are used. A cloud function is nothing
but a java script code which been triggered when an event takes place. And the code will run without any
need of infrastructure management because its all taken care by Google itself.
Page No.:16
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Components Required:
• Esp8266
• DHT 11 Sensor
• Arduino UNO
• Bread Board
• Wires
• Resistor 10k
• PC
Procedure:
Step 1:
Hardware Configuaration:
First Connect VCC pin of DHT 11 Sensor to Arduino 5V pin .Connect Data pin of DHT 11
Sensor to Arduino 11 pin.Connect GND pin of DHT 11 Sensor to Arduino GND pin. Connect then
connect Esp8266 RX pin to -3 pin of Arduino.Connect Tx pin of ESP8266 to 2 pin of Arduino.Connect
VCC pin of ESP8266 to Ardunio 3V3 pin.CH-PW pin of ESP8266 to Arduino 3V3 pin . Connect GND
pin of ESP8266 to GND of the Ardunio .
Step 2:
After setting of the hardware connection, the next thing is to configure the cloud environment for
that we use thinkspeak.com .
Step 3:
If you dont have account in thinkspeak.com ,then we will create account .create new channel in
thinkspeak and provide name of the channel as Tempurature and Humidity project and create Field1 as
Tempurature Field2 as Humidity and then click save Channel
Step 4:
Click on APIKeys write API key is used for sending sensor data to thinkspeak cloud
Step 5:
To use DHT11 sensor ,we must include one library in Aruidno. To include that Librabry we follow
the below steps
• Open the Arudino IDE
• Select Sketch ,under the Sketch select Include Library.
• Selcet add Zip library.
Step 6:
After we need to write Arudino code in Arudino IDE and then connect Arudino Board to pc and
then upload the code.
Source code:
DHT11 Library:-
#include "DHT.h"
DHT dht;
void setup() {
Serial.begin(9600);
dht.setup(2); // data pin 2
}
Page No.:17
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Serial.println(temperature);
return String(temperature);
}
String getHumidityValue() {
float humidity = dhtObject.getHumidity();
Serial.print(" Humidity in %= ");
Serial.println(humidity);
return String(humidity);
}
Page No.:19
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
OUTPUT:
Page No.:20
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Introduction:
In this tutorial, we will go through the steps necessary to set up an ESP32 / ESP8266 development
board with the Arduino Cloud IoT. To test it out, we will send random values from the board to the
cloud, and set up a switch that can enable the built-in LED on the board.
Goal:
The goals of this project are:
• Send data to the cloud from the board.
• Turn ON/OFF an LED on the board through the cloud.
Components required
• ESP32 / ESP8266 development board.
• Arduino Cloud IoT.
We will also need the following components for the circuit:
• LED
• 220 ohm resistor
• Breadboard
• Jumper Wires
3. Then, we need to create a new Thing, by clicking on the "Create Thing" button. We can then
rename our Thing something appropriate to what we are doing, in this case we simply
chose ESP32 Project.
4. Creating a Thing.
5. Now, we need to link our device with our Thing. This is done by clicking on the button in
the "Device" section. This will open a window, where your ESP32 / ESP8266 should be
available to select.
6. Select ESP32 / ESP8266 device.
7. Once the device is linked, we need to create two variables: random_value and led_switch
8. Click on "Add variable" button. This will open a window where you need to fill in variable
information. Let's create the random_value first.
9. The data type is int, permission is read only and update policy is on change.
10. Once done, click on the "Add variable" button.
11. Adding the random_value variable.
12. Now, let's also add the led_switch variable.
13. The data type for this variable is boolean, the permission is read & write, and update policy
is on change.
14. Once done, click on the "Add variable" button.
15. Adding the led_switch variable.
Step 3:- Adding credentials
1. Now, we need to enter the credentials for our network, plus the secret key generated during the
device configuration.
2. First, click on the button in the "Network Section".
3. Open the credentials tab.
4. Then, enter the credentials (network name, network password and secret key).
5. Click "Save" when finished.
6. Entering the credentials.Programming the board
7. The next step is to program the board. To do so, we need to go to the "Sketch" tab.
8. Navigate to the sketch tab.
9. The code for this tutorial can be found in the snippet below. Upload it to the board by clicking on
the "Upload" button at the top left corner.
10. Creating a dashboard
11. Now that the sketch is running on the ESP32 / ESP8266 board, we can move on to the final step,
which is creating a dashboard.
12. First, navigate to the "Dashboards" tab.
13. Navigating to the dashboards tab.
14. Then, click on the "Build dashboard" button.
15. Click on the "Build dashboard" button.
16. To edit the dashboard, click on the pencil icon at the top left icon, select "Things" and search for
your Thing. Select it, and click on "Add widgets" as shown in the image below.
17. Adding widgets.
18. We should now have two widgets that are linked to your ESP32 / ESP8266 board.
random_value - whenever the random_value updates on the board, it also updates here.
led_switch - when we activate this switch, we turn ON the LED connected to the board
(pin 13).
19. Complete dashboard.
Page No.:22
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Circuit:
Conclusion:
In this tutorial, we went through the basics of setting up an ESP32 / ESP8266 microcontroller to
communicate with the Arduino Cloud IoT. We tested this out by sending a random value from the board
to the cloud, and by creating a switch that controls an LED from the cloud.
Page No.:23
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
8. Access the data pushed from sensor to cloud and apply any data analytics or visualization
services.
Aim: To Access the data pushed from sensor to cloud and apply any data analytics or visualization
services.
Sensor data analytics is an analytics platform built to analyse the data streamed or collected from
sensors and IoT devices. The data is analysed to give insight into the current status of this device using
different metrics (these metrics are set based on the organisation’s needs).
Typical applications:
You can use this breakout to monitor every aspect of your indoor environment. Its gas resistance
readings will react to changes in volatile organic compounds and can be combined with humidity
readings to give a measure of indoor air quality. Here is the list of typical applications:
– Indoor air quality
– Home automation and control
– Internet of things
– Weather forecast
– GPS enhancement (e.g. time-to-first-fix improvement, dead reckoning, slope detection)
– Indoor navigation (change of floor detection, elevator detection)
– Outdoor navigation, leisure and sports applications
– Vertical velocity indication (rise/sink speed)
Features:
• Measuring temperature, pressure, humidity, air quality sensor
• I2C interface, with address select via ADDR solder bridge (0x76 or 0x77)
• 3.3V or 5V compatible
• Reverse polarity protection
• Raspberry Pi-compatible pinout (pins 1, 3, 5, 7, 9)
• Compatible with all models of Raspberry Pi, and Arduino
• Python library
• Datasheet
• ESP32
Let us see how to fetch sensor data from BME680 on the NVIDIA Jetson Nano board and send it to
the Cloud Platform.
Hardware requirements:
• Jetson Nano: 2GB Model ($59)
• A 5V 4Amp charger
• 128GB SD card
• BME680 sensors
Software requirements:
• Jetson SD card image from NVIDIA
• Etcher software installed on your system
You can run RedisTimeSeries directly over an IoT Edge device. Follow the below steps to build
RedisTimeSeries Docker Image over Jetson Nano:
Page No.:24
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
SSH to your Jetson Nano board equipped with BME680 sensor and install Docker
• pico@pico1:~$ docker version
• Client: Docker Engine – Community
• Version: 20.10.3
• API version: 1.41
• Go version: go1.13.15
• Git commit: 48d30b5
• Built: Fri Jan 29 14:33:34 2021
• OS/Arch: linux/arm64
• Context: default
• Experimental: true
• Server: Docker Engine – Community
Engine:
• Version: 20.10.6
• API version: 1.41 (minimum version 1.12)
• Go version: go1.13.15
• Git commit: 8728dd2
• Built: Fri Apr 9 22:43:42 2021
• OS/Arch: linux/arm64
• Experimental: false
• containerd: Version: 1.4.3
• GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
nvidia:
• Version: 1.0.0-rc92
• GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
• Version: 0.19.0
• GitCommit: de40ad0
Page No.:25
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Running RedisTimeSeries
docker run -dit -p 6379:6379 ajeetraina/redistimeseries-jetson
Click the Data Sources option on the left side of the Grafana dashboard to add a data source.
Page No.:26
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Click Apply and you should be able to see the temperature dashboard as shown here
Follow the same process for pressure (ts:pressure) and humidity (ts:humidity), and add them to the
dashboard. You should be able to see the complete dashboard readings for temperature, humidity, and
pressure. Looks amazing. Isn’t it?
Page No.:31
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Aim: To create a Mobile App to control the moment of the door using Actuator connecting through
Bluetooth.
Components Required:
Hardware:
• Arduino Uno (OR any Arduino Board of your choice)
• HC05 Bluetooth Module
• Micro Servo Motor with Accessories
• Male-to-Male Jumper Cable
• Male-to-Female Jumper Cable.
Software:
• Dabble
• PictoBlox
Let’s connect the Bluetooth module(HC05) to Uno. It will help us pair our Smartphone with the board via
Bluetooth.
• Connect the VCC pin to Uno’s 5V pin
• Connect the GND pin to Uno’s GND pin
• Connect the Transmit pin (Tx) to Uno’s Digital pin 2
• Connect the Receive pin to Uno’s PWM pin 3
Now, let’s connect the servo to Uno.
• Connect the servo’s brown wire to Uno’s GND pin
• Connect the red wire to Uno’s VIN pin
• Connect the orange wire to Uno’s PWM pin 5
Page No.:32
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
We are going to use the is data from terminal block to into the if condition to check whether the
command given is close or open:
• Use the set servo block and set the angle to zero degrees.
• Now, to open the door, we must send the command ‘open’. Duplicate the entire set of blocks and
stack the two. and write open in the white space of the second is data from terminal block and
change the servo angle to 45 degrees.
• Use the forever block to run the script forever. Add a set bluetooth baud rate to block to set
Bluetooth's baudrate. And write drop the hat to execute the script.
Page No.:33
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Final Output:
As soon as you type 'open' the servo angle will change to 45 degrees and when the command is close, set
the servo angle to 0 degrees.
Page No.:34
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
10. Design an IoT Based Air Pollution Control System the air pollution by measuring carbon
monoxide, ammonia, etc and gives alarm or sends message when the pollution level is more than
permitted range.
In this project we are going to make an IoT Based Air Pollution Monitoring System in which we
will monitor the Air Quality over a webserver using internet and will trigger a alarm when the air quality
goes down beyond a certain level, means when there are sufficient amount of harmful gases are present in
the air like CO2, smoke, alcohol, benzene and NH3. It will show the air quality in PPM on the LCD and
as well as on webpage so that we can monitor it very easily.
Previously we have built the LPG detector using MQ6 sensor, Smoke detector using MQ2
sensor, and Air Quality Analyser but this time we have used MQ135 sensor as the air quality sensor
which is the best choice for monitoring Air Quality as it can detects most harmful gases and can measure
their amount accurately. In this IOT project, you can monitor the pollution level from anywhere using
your computer or mobile. We can install this system anywhere and can also trigger some device when
pollution goes beyond some level, like we can switch on the Exhaust fan or can send alert SMS/mail to
the user.
Required Components:
• MQ135 Gas sensor
• Arduino Uno
• Wi-Fi module ESP8266
• 16X2 LCD
• Breadboard
• 10K potentiometer
• 1K ohm resistors
• 220 ohm resistor
• Buzze
Page No.:35
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Working Explanation:
The MQ135 sensor can sense NH3, NOx, alcohol, Benzene, smoke, CO2 and some other gases,
so it is perfect gas sensor for our Air Quality Monitoring Project. When we will connect it to Arduino
then it will sense the gases, and we will get the Pollution level in PPM (parts per million). MQ135 gas
sensor gives the output in form of voltage levels and we need to convert it into PPM. So for converting
the output in PPM, here we have used a library for MQ135 sensor, it is explained in detail in “Code
Explanation” section below.
Sensor was giving us value of 90 when there was no gas near it and the safe level of air quality is
350 PPM and it should not exceed 1000 PPM. When it exceeds the limit of 1000 PPM, then it starts cause
Headaches, sleepiness and stagnant, stale, stuffy air and if exceeds beyond 2000 PPM then it can cause
increased heart rate and many other diseases.
When the value will be less than 1000 PPM, then the LCD and webpage will display “Fresh
Air”. Whenever the value will increase 1000 PPM, then the buzzer will start beeping and the LCD and
webpage will display “Poor Air, Open Windows”. If it will increase 2000 then the buzzer will keep
beeping and the LCD and webpage will display “Danger! Move to fresh Air”.
Page No.:36
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
11. Design an iot based system which measures the physical and chemical properties of the water
and displays the measured values.
Aim: measuring the physical and chemical properties of water and displays the measured values.
Components:
• Temperature sensor
• Ph sensor
• Flow sensor
• Turbidity sensor
• Arduino board
• Wifi module
• Bread board
• Display
• Connecting wires
• Physical properties of water:
• Appearance
• Density
• Viscosity
• Boiling Poin
• Freezing Point
Chemical properties of water:
• Amphoteric nature
• Redox reactions
• Hydrolysis reaction
Temperature sensor:
Water Temperature indicates how water is hot or cold. The
range of DS18B20 temperature sensor is -55 to +125 °C. This
temperature sensor is digital type which gives accurate reading.
Flow sensor:
Flow sensor is used to measure the flow of water through the flow
sensor. This sensor basically consists of a plastic valve body, a rotor and a
Hall Effect sensor. The pinwheel rotor rotates when water / liquid flows
through the valve and its speed will be directly proportional to the flow rate.
The Hall Effect sensor will provide an electrical pulse with every revolution
of the pinwheel rotor.
Arduino Uno:
Arduino is a microcontroller board based on the ATmega328P. It has
14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an
ICSP header and a reset button. It contains everything needed to support the
microcontroller. Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a
series of USB Arduino boards, and the reference model for the Arduino
platform; for an extensive list of current, past or outdated boards see the
Arduino index of boards.
Page No.:37
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Wifi module:
The ESP8266 WiFi Module is a self contained SOC with
integrated TCP/IP protocol stack that can give any microcontroller
access to your WiFi network. The ESP8266 is capable of either hosting
an application or offloading all Wi-Fi networking functions from
another application processor. Each ESP8266 module comes pre-
programmed with an AT command set firmware. The ESP8266 module
is an extremely cost effective board with a huge, and ever growing,
community.
Page No.:38
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Procedure:
Four sensors (Temperature, Turbidity, pH ,Moisture) are connected to Raspberry Pi as shown in
the Figure 9. The digital temperature sensor DS18B20, which is a one wire digital device . So, it is
directly connected to Raspberry Pi along with a 4.7k Ohm resistor which is required as a pull up from the
DATA to VCC line when using the sensor. The turbidity sensor SEN-0189 is an analog sensor which
senses the clarity of the water.
Raspberry Pi supports only digital sensors and it will take only digital values. Therefore in this
approach, an analog to digital converter is used (ADC- MCP3008) to convert analog signals into digital
signals. Sensor is connected to channel 1 of the ADC to convert the analog value to digital. Later, digital
value input to Raspberry Pi. Similarly, pH electrode BNCE201 is also an analog sensor, therefore this
sensor is connected to channel 2 of ADC .and also Moisture sensor is connected to channel 3 of ADC to .
Here, turbidity sensor , pH electrode and Moisture sensor are connected to ADC. ADC is
connected to Raspberry Pi . The Ethernet cable is connected to Raspberry Pi to send the information
control centre. The breadboard is used for the connections. Figure 9:Connection of Sensors to Pi The
Temperature, pH and Turbidity values of the water is displayed along with its measuring units in the
Terminal (Command Prompt) of the Raspberry Pi.
It also shows the SMS notification sent to the registered user when there is a variation in the
water quality and in moisture
Page No.:39
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
12. Identify a problem in your local area or college which can be solved by integrating the things
you learned and create a prototype to solve it.
AIM: Identify a problem in your local area or college which can be solved
integrating the things you learned and create a prototype to solve it.
COMPONENTS:
• LED
• Battery clipper
• Battery
• LDR sensor
• Transistor Bc547
• Resistor
PROCEDURE:
Step 1: Take all components
Step 2 : Pins of Bc547 Transistor As pin-1 is Collector of this transistor,Pin-2 is Base and Pin-3 is
Emmiter of this transistor.
Step 3: Connect LED Connect LED to the transistor. Connect -ve pin of LED to collector pin of the
transistor
Step 4: Solder LDR Solder LDR to Base pin and emmiter pin of the transistor
Step 5: Connect 20K Resistor Next solder 20K resistor to base pin of transistor and in the +ve pin of
LED
Step 6: Solder Battery Clipper Wire Now we have to solder battery clipper wire to the circuit.
Solder +ve wire of battery clipper to +ve pin of LED and-ve wire of battery clipper to emmiter pin the
transistor
Step 7: How to Use This Automatic Street Light Connect battery to the battery clipper and observe that
when light is on L sensor then LED is not glowing and when light is not on the LDR then LED glowing.
CIRCUIT:
Without using Arduino:
Working:
When sunlight falls on LDR .(LDR works on the property on Photo conductivity where it gives
less resistance in high light intensity and high resistance in low light intensity.)
it gives high resistance at night and low resistance in day. LDRs are made from semiconductor materials
like cadmium sulphide, which help the lights to have their light sensitive properties. When light falls on
the surface of LDR, the conductance of the element increases or the resistance of the LDR in the control
Page No.:40
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
circuit falls. When it becomes dark, the resistance of the LDR increases and switches the light on.
Page No.:41
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Components Required:
Hardware Specifications:
• Power Supply
• Rectifier
• Regulator
• LCD
• wifi module
• Atmega Microcontroller
• Wifi Module
• 4 Rf Transmitters
• 2 Rf Receivers
• Resistors
• Capacitors
• Diodes
Software Specifications:
• Python compiler
• Programming Language: Python
• IOTGecko
Theory:
The GPS systems are todays most well known location tracking systems. Well these systems are
not capable of pinpointing exact locations or locations of an entity within a building or on a particular
floor or room. So here we propose a smart asset tracking system that allows to track location of objects,
goods, personnel within a building or any facility.
Our proposed system makes use of rf technology along with IOT to achieve this system. The
system has the capability to pinpoint the location of any entity to exact room it is currently located in.
The system uses mini rf circuits to be used as tracking devices. We use tracking microcontroller based
circuits to track those rf circuits.
The tracker circuits are battery powered circuits to be mounted on objects/entities. The
monitoring circuits are to be placed in individual rooms. Now as soon as any tracker objects enter any
room the tracker circuits come in 2-3 meters range of the monitoring circuit for that room.
The monitoring system now transmits the location of that tracker circuit to the online system. We
here use IOTGecko to handle the IOT tracking part. The transmitted data is now displayed by IOTGecko
to pinpoint which room a particular object/entity is located in.
Page No.:42
J.N.T.U. College of Enginerring
Anantapur. Date: ………………………
____________________________________________________________________________________
Circuit Diagram:
Page No.:43