SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
1
Smart LNMIIT Campus
Project report submitted in Completion of
Internship on topic Smart LNMIIT Campus
In
Electronics
&
Communication Engineering
By
Rajat Bandejiya
14uec076
bandejiyar@gmail.com
Under Guidance of
Prof. Ravi Gorthi
Assistant Prof. Purnendu karmakar,
Associate Prof. Sakhti Balan
Department Of Electronics and Communication and engineering
The LNM Institute of Information Technology,
Jaipur
July, 2016
2
The LNM Institute of Information Technology
Jaipur, India
CERTIFICATE
This is to certify that the Internship work entitled Smart LNMIIT Campus ,submitted
by Rajat Bandejiya (14uec076) in fulfillment of the Internship, is a bonafide record of
work carried out by him at the Department of Electronics and Communication
Engineering, The LNM Institute of Information Technology, Jaipur, (Rajasthan) India,
during Summer Vacation’ 2017 under my supervision and guidance.
Date Prof. Ravi Gorthi
___________________________
Assistant Prof. Purnendu karmakar,
____________________________
Associate Prof. Sakhti Balan
3
Acknowledgments
I would like to express my special appreciation and thanks to my advisor Assistant
Professor Purnendu Karmakar Sir, who has been an incredible mentor for me. I
would like to thank him for encouraging my project, for his precious time with
thoughtful discussion and his helping hand during many tough phases throughout
this Internship.
I am also grateful to Prof. Ravi Gorthi Sir and Associate Prof. Sakhti Balan Sir for his
perpetual encouragement, generous help and inspiring guidance in my project.
I would also like to express thanks to all the other faculty members and staff of the
Department of Electronics and Communication Engineering , The LNM Institute of
Information Technology, Jaipur (Raj.) for their generous help in various ways which
helped me in the completion of this project.
4
Abstract
The explosive growth of the “Internet of Things” is changing our world and the rapid
drop in price for typical IoT components is allowing people to innovate new designs,
products at home and current components of typical IoT devices for the future. IoT
design considerations, constraints and interfacing between the physical world and
devices is changing Our lifestyle.
So, while people are changing the lifestyle, Government Is Also Involving in IOT by
Bringing the Projects likes Smart Cities. So Working for the Project Smart LNMIIT
Campus as an Intern can work as a Strong foundation to grab an opportunity in the
real projects like smart cities.
In this project I have used Intel Galileo development board for have some
computational power and Thingspeak.com for cloud computing.
5
(V)
6
Contents
Chapter Page
1. Introduction:- 7
1.1 Importance of Internet Of Things(IoT) 7
1.2 The Technological Trends That led IoT as a buzzword Nowadays 8
2. Literature Survey:- 9
2.1Referance 9
2.2About Project 10
2.2Problem Statement 10
3. Methodology:- 11
3.1Components Used 11
3.2Reason Why I Chose Intel Galileo 13
3.3Methods to Proceed 16
3.3.1 Steps that I prefer to Start with my development board 16
3.3.2 steps to connect the board with wifi 19
3.3.3 Method to connect the humidity sensor with board 20
3.3.4 Data Visualisation for analog sensor over Web using 20
Cloud Services
4. Results and Conclusion:- 21
5. Bibliography:- 22
6. Appendix 23
7
Chapter 1
Introduction
1.1 Importance of Internet of Things (IoT).
It is hard to imagine life without Internet – you have come to rely on it so much – for
your work to stay in touch with family and friends, to capture and share those special
moments, to check nearby your way around in a new neighbourhood. Did you ever
wonder how and when all this happened?
Or how and when sensors came to be in your cell phone? The Internet is a huge
platform for exchanging information, which has completely revolutionized the world.
So We Can use Internet as a very useful asset for our work.
Now think if we can use Internet with Sensors connected with some Development
board (any Embedded System) i.e. we connect every Computational powers with
each other from the world, it is said that about 20,000 crore devices will be
connected till year 2020 this can actually change or Revolutionize the world that is
why IOT is the Closest Emerging technology and so working and gaining knowledge
can make us to help and solve the problems of society a Lot.
IOT is all about three things:-
1.) Any Computational power which is provided by embedded systems
2.) Any Cloud Service either may be Cloud Computing or Cloud Storage
3.) And Last but Most Important is Networking.
8
1.2) The technological trends that led IoT as a buzzword nowadays
I. COST
Well there was a time of 1940s when a computer ENIAC of size as big as
your room costs about $500,000 but know a laptop which is much, much
powerful than ENIAC is so much handy and costs less than $500, so
computational power is so much cheap nowadays that is the reason market is
working in this field a lot
2. HARDWARE SIZE
In 1940s ENIAC Computer Of that time was Not able to fit into anything as
was as big as Our room and nowadays we are having great computational
power in our hands.
3. COMPUTATIONAL ABILITY
Computational power has grown dramatically as Nowadays Audio processing,
Network Communication requires a great computational power which was
unable those days
4. CLOCK RATE
Computational Speed Has Increased Dramatically according to moore’s law
which states the number of transistors per square inch on integrated circuits
had doubled every year since the integrated circuit was invented.
5. INTERNET ACCESS
This is the most important aspect why many research are going on in IOT and
IoT is said to be emerging technology and Market is coming to have a dive in
the ocean of IoT.
In 1940s there was No Internet or Connectivity, No Networking, Now it is
exists and is also reachable in different parts of world.
Internet Connection makes IOT easy and Possible
6. DATA COST
Now internet is that much cheap that a lot people can afford it.
9
Chapter 2
Literature Survey
2.1 Reference
Research Papers:-
1) Wireless sensors in agriculture and food industry- Recent development and future
perspective
This paper presents an overview on recent development of wireless
sensor technologies and standards for wireless communications as
applied to wireless sensors. Examples of wireless sensors and sensor
networks applied in agriculture and food production for environmental
monitoring, precision agriculture.
REFERANCE:-
http://www.sciencedirect.com/science/article/pii/S0168169905001572
2) Embracing the Internet Of Everything To Capture the Share of $14.4
trillion(By CISCO)
This Paper Is published By Cisco which Shows Why IOT is the Future
REFERANCE :-
https://www.dropbox.com/s/vxp24vcstsqlji1/ioe-economy-insights.pdf?dl=0
3) Hardware-Software Codesign of embedded systems
This Paper Discusses The Importance of Embedded Systems and Design
REFERANCE:-
https://drive.google.com/a/lnmiit.ac.in/file/d/0BzNhMhwiU4H-
dXJrTWROWnM0QWM/view?usp=sharing
But above research papers were failed to address how to proceed
practically. They provide the research work and knowledge but was not
able to give the practical knowledge about how to apply which I solved In
and shown in this report.
10
2.2 About Project
Project Is all about IOT (Internet Of Things).In this Project while having a
vision of Smart campus We had to make temperature Mapping System. Which
can actually Map the temperature i.e. can tell at what location what was the
temperature of any moving or stationary thing. And after sensing the
temperature we can further Visualise the Data via Cloud Computing
(Middleware) over the web.
We can use this same system for knowing the temperature in the sky by
placing the same system on the Quadcopter.
We can use the same project in the agriculture by using the humidity sensor
with any other development board. For example this project can be use for
automatic irrigation pump which can switch on and off according to the water
requirement of the field
We can use the same project for the sprinklers in gardens. For example if we
want that a particular sprinkler should on or off according to the humidity
present in the field. The main requirement are a humidity sensor with a
Development board
PROBLEM STATEMENT:-
Well the problem is to sense the analog data from environment and visualise
the data via some cloud computing service(Thingspeak.com)
11
Chapter 3
Methodology
3.1) Components Used
Intel Galileo Development Board
Fig 3.1
Referance:
https://communities.intel.com/servlet/...102-1.../Galileo_GettingStarted_329685_005.pdf
.
12
Starter Kit For Intel Galileo / Intel Edison
Fig 3.2
Referance:-
http://www.seeedstudio.com/item_detail.html?p_id=1978
13
Fig 3.3
3.2) Reason Why I Chose Intel Galileo
The Reason I chose Intel Galileo Was—
Intel and Arduino’s announcement about the new Galileo board is big news. It’s a
Linux-based board that I’ve found to be remarkably compatible with the Arduino
ecosystem based on my first few steps with a prerelease version of the board. Here
are some of the best features of this groundbreaking collaboration between Intel and
Arduino
Shield Compatibility
The expansion header on the top of Galileo should look familiar since it’s compatible
with 5V and 3.3V Arduino shields designed for the Uno R3 (also known as the
Arduino 1.0 pinout). This means that it has 14 digital I/O pins, 6 analog inputs, a
serial port, and an ICSP header.
14
Familiar IDE
The Intel-provided integrated development environment for the Galileo looks exactly
like the Arduino IDE on the surface. Under the Boards menu, you’ll see addition of
the Galileo under “Arduino X86 Boards.” The modified IDE also is capable of
upgrading the firmware on the board.
Ethernet Library Compatibility
Using the Ethernet port on the board is as simple as using Arduino’s Ethernet library.
I was able to get a HTTP connection to Google without even modifying the standard
WebClient example.
Real Time Clock
Most Linux boards rely on a connection to the Internet to get the current date and
time. But with Galileo’s on-board RTC (real time clock), you’ll be able to track time
even when the board is powered off. Just wire up a 3.0V coin cell battery to the
board.
Works with PCI Express Mini Cards
On the bottom of the board is an expansion slot for PCI Express Mini cards. This
means you can connect WiFi, Bluetooth, GSM cards for connectivity, or even a solid
state drive for more storage. When you connect a WiFi card, it will work with
Arduino’s Wifi library.
15
USB Host Port
Galileo’s dedicated USB On-The-Go port will let you use the the Arduino USB Host
library to act as a keyboard or mouse for other computers.
MicroSD Support
If you want to store data, a microSD card slot is accessible from your code by using
the standard Arduino SD card library.
TWI/I2C, SPI Support
Using the standard Arduino Wire library or SPI library, you can connect TWI/I2C or
SPI components to the Galileo.
Serial Connectivity
Not only is there the typical serial port for your sketches on pins 0 and 1 of the
Arduino pinout, but there’s also a separate serial port for connecting to the Linux
command line from your computer. You’ll connect to it through the audio jack
interconnect next to the Ethernet port. This port is only used for serial.
Linux on Board
A very light distribution of Linux is loaded onto the 8 MB of flash memory. If you want
to use tools like ALSA (for sound), V4L2 (for video input), Python, SSH, node.js (for
web projects), and openCV (for computer vision), you can boot Galileo from an SD
card image that Intel provides. Which gives it a great power
16
3.3) Method to Proceed
3.3.1)Steps That I prefer To Start with My Development Board Are as
Followed:-
I) Connect the Intel Galileo Board.
Get a Intel Galileo Development Board and a Data Cable.
The kit contains:
• 1x Intel® Galileo Customer Reference Board (CRB) (Fab D with blue
PCB)
• 1x 5v power supply with cable
Warning: You must use a power supply or you will damage the
board!
II) Download Arduino Environment and Board Firmware.
Download the latest IDE and firmware files here:
https://communities.intel.com/community/makers/drivers
You will need up to 200 MB of free space, depending on which OS you
are using.
III) Connect the board with your PC.
WARNING: You must use the power supply or you will damage
the board.
Connect the 5V power cable to the Galileo board and to a power outlet.
Note: Always connect the 5V power before any other connection.
The green power LED (labelled ON) will turn on.
IV) Install The Drivers and other software.
Windows:
1. If not done already, connect the 5V power cable to the Galileo board
and to a
power outlet.
Note: Always connect the 5V power before the USB connection.
2. Connect the USB cable to the USB Client Port (closest to the
Ethernet) and to a
PC. Wait for Windows to begin its driver installation process. After a
few moments,
the process will fail.
3. Click on the Start Menu, and open up the Control Panel. While in
the Control
Panel, navigate to System. Next, click on System. Once the System
window is
up, open the Device Manager.
4. Look under Ports (COM & LPT). You should see an open port
named Gadget
Serial V2.4. If you do not see this open port, follow steps a-c in the
Note below.
5. Right-click on the Gadget Serial V2.4 port and choose the Update
Driver
Software option.
6. Choose the Browse my computer for Driver software option.
17
7. Navigate to the hardware/arduino/x86/tools directory. This allows the
proper
driver file linux-cdc-acm.inf to be installed.
8. Once the driver is successfully installed, Device Manager will show
a
Galileo (COMx) device under Ports (COM & LPT). Note the COMx
port number
as it will be needed in the IDE later. The example below shows COM5.
V) Launch the Arduino IDE Application.
VI) Update Your board Firmware
The IDE contains the release-specific firmware for your board. Follow
the steps below
to update your board firmware using the IDE.
1. Remove all power from the board (USB and 5 V power cord). This
makes sure that no sketch is running on the board
2. Remove the SD card from the board (if it is inserted).
3. Power up the board by plugging in the 5V power supply.
4. Connect the USB cable to the USB Client Port (closest to the
Ethernet).
Note which COM port it is connected on.
5. Launch the IDE and select the board via Tools > Board > Intel®
Galileo
6. Select the correct serial port using Tools > Serial Port
Note: Do not download any sketch to the board before you upgrade
the firmware.
7. Launch the software upgrade using Help > Firmware Upgrade
8. A message is displayed asking you to confirm that 5V power cable is
plugged in.
Click Yes if it is connected. If no cable is plugged in, exit the
upgrade process by
selecting No, connect the power, and restart this process.
9. The board can be upgraded to newer software or downgraded to
older software. The next message displays the current software
version that is on the board and the software version that you are
trying to flash onto the board. Select Yes to
either Upgrade/Downgrade or flash the same software again.
10. The upgrade progress takes about 6 minutes and is displayed in
several popup messages. During the upgrade process, you will not
have access to the IDE.
Note: The power and USB cables must stay connected during the
upgrade process.
11. When the upgrade completes, a message is displayed stating
Target Firmware
upgraded successfully. Click OK to close the message.
If you want to flash a different firmware version that is not contained
in the IDE,
download the SPI flash image capsule files as described in Section 2.
The downloaded capsule should be copied to the following locations,
depending upon your operating system. Make sure that there is only
18
one *.cap file in the location below. If you are downloading a new file,
rename the previous *.cap to some other extension.
• Windows: Arduino-1.5.3/hardware/tools/x86/bin/
VII) Open The blink Example.
Open the LED blink example sketch: File > Examples > 1.Basics > Blink
VIII) Select your Serial Port.
Select the serial device of your board from the Tools > Serial Port
menu.
Windows: Use the COMx number assigned earlier. You can retrieve
the port number
by navigating to:
Start > Control Panel > System and Security > System > Device
Manager
Look under Ports (COM & LPT) to see which COMx is assigned to
Gadget Serial.
IX) Upload The Programe
Click the Upload button in the IDE and wait a few seconds. If the
upload is successful,
the message Done uploading. will appear in the status bar.
A few seconds after the upload finishes, you will see a green LED on
the board start to blink. Congratulations! You've gotten your board up
and running.
For more information about Intel® Galileo, including online
communities and support, try these links:
http://www.intel.com/support/galileo
http://communities.intel.com/community/makers.
19
3.3.2)Steps to connect the Board With Wi-Fi(SD card should be
configured before This Step)
1) Connect the antennae’s with the board.
2) Connect the FTDI Cable with your board.
3) Open Tera Term.
4) Select Serial Port
5) Change the baud rate to 115200/s
6) Now you can see the OS burn inside sd card running inside in the board
on term term.
7) Wait for OS To boot
8) Now write Root as user
9) Congrats Now we have access on the OS running in the development
board via Tera term
10) Now write These Commands:-
# lspci -k | grep -A 3 -i "network"
# Connmanctl
connmanctl> enable wifi
connmanctl> scan wifi
connmanctl> services
connmanctl> config wifi_<MAC_a>_<MAC_h>_managed_psk --
autoconnect yes ---ipv4 dhcp
connmanctl> agent on
connmanctl>connect
wifi_0cd2926de3ae_486f6d65574c414e_managed_psk
11) Now enter the Password Of Respective SSID
12) Congrats now your development board is connected with WLAN
network on its own
20
3.3.3)Method to connect Humidity Sensor(Any Analog Sensor) with
the development Board
1) Connect the Intel Galileo Board.
2) Write Code as in appendix bullet point 6.2
3) Now we Can Observe the voltage Read in the Serial monitor.
3.3.4)Data Visualisation for The temperature Over Thingspeak.com
using Cloud Computing
1) Connect The Temperature sensor with the development board as we did with the
humidity sensor.
2) Code For Data Visualisation is in appendix as Bullet point 6.1
3 )Now Compile and then Burn and program this Code now we can see the data
visualisation of our analog data over thingspeak.
4) Congo..!! Now We are Able To see our real time analog data visualisation over the
web.
Fig 3.4
Chapter 4
Results & Conclusions
21
Results:-
The graph generated shows the change of analog data generated with respect to
time and the analogue data generated is real time data which is generated and
visualised automatically using cloud computing.
So by this proposed Work We can Visualise any analog sensor data over the web.
If instead of analog sensor if we use Digital sensor than also we can Visualise data
with the help of any Cloud Computing Service.
Conclusion:-
Since interpreting graph is easier than interpreting any log data so this proposed
work can help any authority which want to analyse data in real time.
For Example:-
Suppose there is an water supplying tank which provide potable water and as we
know that about 5000 children a dies because of drinking dirty water.
So to solve this issue this proposed work can be used, if this system in which all the
sensors is there at every tank in the world which shows authority the difference
between dirty and potable water, than authority can come and solve all the issues
whenever water get polluted right at that moment.
And using thus proposed work many lives can be saved.
22
Chapter -5
Bibliography
[1] https://www.coursera.org/specializations/internet-of-things
[2] http://www.sciencedirect.com/science/article/pii/S0168169905001572.
[3] https://www.dropbox.com/s/vxp24vcstsqlji1/ioe-economy-insights.pdf?dl=0
[4] https://drive.google.com/a/lnmiit.ac.in/file/d/0BzNhMhwiU4H-
dXJrTWROWnM0QWM/view?usp=sharing
[5] http://makezine.com/2013/10/03/10-great-intel-galileo-features/
[6] https://www.dropbox.com/s/i9wu1ateyenmngt/Galileo_QuickStartGuide.pdf?dl=0
[7] https://www.dropbox.com/s/tbydwlxdthonlof/Galileo%20Schematic.pdf?dl=0
[8] https://www.theguardian.com/business/2006/nov/10/water.environment
[9] https://communities.intel.com/servlet/...102-1.../Galileo_GettingStarted_329685_005.pdf
[10] http://www.seeedstudio.com/item_detail.html?p_id=1978
23
Chapter -6
Appendix
6.1) #define DHT11_PIN 5
dht DHT;
#define DEBUG FALSE //comment out to remove debug messages
//*-- Hardware Serial
#define _baudrate 9600
//*-- Software Serial
//
#define _rxpin 2
#define _txpin 3
SoftwareSerial debug( _rxpin, _txpin ); // RX, TX
//*-- IoT Information
#define SSID "shubham"
#define PASS "qwertyuiop"
#define IP "184.106.153.149" // ThingSpeak IP Address: 184.106.153.149
// GET /update?key=[THINGSPEAK_KEY]&field1=[data 1]&field2=[data 2]...;
String GET = "GET /update?key=P2KNPEVR81GFZZXD";
void setup() {
Serial.begin( _baudrate );
debug.begin( _baudrate );
sendDebug("AT");
delay(5000);
if(Serial.find("OK"))
{
debug.println("RECEIVED: OKnData ready to sent!");
connectWiFi();
}
}
24
void loop() {
int chk = DHT.read11(DHT11_PIN);
float val1 = DHT.temperature;
char buf[32];
String temp = dtostrf( val1, 4, 1, buf);
updateTS(temp);
delay(3000); //
}
//----- update the Thingspeak string with 3 values
void updateTS( String T)
{
// ESP8266 Client
String cmd = "AT+CIPSTART="TCP","";// Setup TCP connection
cmd += IP;
cmd += "",80";
sendDebug(cmd);
delay(2000);
if( Serial.find( "Error" ) )
{
debug.print( "RECEIVED: ErrornExit1" );
return;
}
cmd = GET + "&field1=" + T ;
Serial.print( "AT+CIPSEND=" );
Serial.println( cmd.length() );
if(Serial.find( ">" ) )
{
debug.print(">");
debug.print(cmd);
25
Serial.print(cmd);
}
else
{
sendDebug( "AT+CIPCLOSE" );//close TCP connection
}
if( Serial.find("OK") )
{
debug.println( "RECEIVED: OK" );
}
else
{
debug.println( "RECEIVED: ErrornExit2" );
}
}
void sendDebug(String cmd)
{
debug.print("SEND: ");
debug.println(cmd);
Serial.println(cmd);
}
boolean connectWiFi()
{
Serial.println("AT+CWMODE=1");//WiFi STA mode - if '3' it is both client and AP
delay(2000);
//Connect to Router with AT+CWJAP="SSID","Password";
// Check if connected with AT+CWJAP?
String cmd="AT+CWJAP=""; // Join accespoint
cmd+=SSID;
26
cmd+="","";
cmd+=PASS;
cmd+=""";
sendDebug(cmd);
delay(5000);
if(Serial.find("OK"))
{
debug.println("RECEIVED: OK");
return true;
}
else
{
debug.println("RECEIVED: Error");
return false;
}
cmd = "AT+CIPMUX=0";// Set Single connection
sendDebug( cmd );
if( Serial.find( "Error") )
{
debug.print( "RECEIVED: Error" );
return false;
}
}
27
6.2)
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result
to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to
+5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 -
5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
}

Contenu connexe

Tendances

cloud of things Presentation
cloud of things Presentation cloud of things Presentation
cloud of things Presentation
Assem mousa
 
SNAIL Project for IoT Connectivity
SNAIL Project for IoT ConnectivitySNAIL Project for IoT Connectivity
SNAIL Project for IoT Connectivity
Daeyoung Kim
 
Android Operated Application Based Smart Eye for Home Automation System Using...
Android Operated Application Based Smart Eye for Home Automation System Using...Android Operated Application Based Smart Eye for Home Automation System Using...
Android Operated Application Based Smart Eye for Home Automation System Using...
IJMTST Journal
 

Tendances (20)

Internet of things
Internet of thingsInternet of things
Internet of things
 
Contents of Internet of Things(IoT) By Thakur Pawan & Pathania Susheela
Contents of Internet of Things(IoT) By Thakur Pawan & Pathania SusheelaContents of Internet of Things(IoT) By Thakur Pawan & Pathania Susheela
Contents of Internet of Things(IoT) By Thakur Pawan & Pathania Susheela
 
Future of iot and big data
Future of iot and big dataFuture of iot and big data
Future of iot and big data
 
15CS81- IoT Module-2
15CS81- IoT Module-215CS81- IoT Module-2
15CS81- IoT Module-2
 
Internet of Things
Internet of ThingsInternet of Things
Internet of Things
 
Summer Internship report on IOT RTTC Trivandrum
Summer Internship report on IOT  RTTC TrivandrumSummer Internship report on IOT  RTTC Trivandrum
Summer Internship report on IOT RTTC Trivandrum
 
cloud of things Presentation
cloud of things Presentation cloud of things Presentation
cloud of things Presentation
 
The internet of things (io t) : IoT academy
The internet of things (io t) : IoT academy The internet of things (io t) : IoT academy
The internet of things (io t) : IoT academy
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technology
 
SNAIL Project for IoT Connectivity
SNAIL Project for IoT ConnectivitySNAIL Project for IoT Connectivity
SNAIL Project for IoT Connectivity
 
Basics of Internet of Things
 Basics of Internet of Things Basics of Internet of Things
Basics of Internet of Things
 
01 internet-of-things-introduction-to-internet-of-things
01 internet-of-things-introduction-to-internet-of-things01 internet-of-things-introduction-to-internet-of-things
01 internet-of-things-introduction-to-internet-of-things
 
Internet of things (IoT)
Internet of things (IoT)Internet of things (IoT)
Internet of things (IoT)
 
The Evolution of Internet of Things
The Evolution of Internet of ThingsThe Evolution of Internet of Things
The Evolution of Internet of Things
 
Smart Home Automation System
Smart Home Automation SystemSmart Home Automation System
Smart Home Automation System
 
The Future of the Internet of Things and its Home Applications
The Future of the Internet of Things and its Home ApplicationsThe Future of the Internet of Things and its Home Applications
The Future of the Internet of Things and its Home Applications
 
Internet of Robotic Things
Internet of Robotic ThingsInternet of Robotic Things
Internet of Robotic Things
 
Internet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded DevicesInternet of Things Connectivity for Embedded Devices
Internet of Things Connectivity for Embedded Devices
 
Android Operated Application Based Smart Eye for Home Automation System Using...
Android Operated Application Based Smart Eye for Home Automation System Using...Android Operated Application Based Smart Eye for Home Automation System Using...
Android Operated Application Based Smart Eye for Home Automation System Using...
 
IOT - Design Principles of Connected Devices
IOT - Design Principles of Connected DevicesIOT - Design Principles of Connected Devices
IOT - Design Principles of Connected Devices
 

Similaire à Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report

IoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdfIoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdf
raja118355
 
IoT & Applications Digital Notes (1).pdf
IoT & Applications Digital Notes (1).pdfIoT & Applications Digital Notes (1).pdf
IoT & Applications Digital Notes (1).pdf
ssusere169ea1
 
IoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdfIoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdf
MaaheenKashish
 
Implementation of IoT in Agriculture: A Scientific Approach for Smart Irriga...
Implementation of IoT in Agriculture: A Scientific  Approach for Smart Irriga...Implementation of IoT in Agriculture: A Scientific  Approach for Smart Irriga...
Implementation of IoT in Agriculture: A Scientific Approach for Smart Irriga...
Springer
 

Similaire à Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report (20)

smart street light system using IOT
smart street light system using IOTsmart street light system using IOT
smart street light system using IOT
 
IRJET-A Review: IoT and Cloud Computing for Future Internet
IRJET-A Review: IoT and Cloud Computing for Future InternetIRJET-A Review: IoT and Cloud Computing for Future Internet
IRJET-A Review: IoT and Cloud Computing for Future Internet
 
azeem final iot report.docx
azeem final iot report.docxazeem final iot report.docx
azeem final iot report.docx
 
Campus Network.pptx
Campus Network.pptxCampus Network.pptx
Campus Network.pptx
 
IoT Home Automation System
IoT Home Automation SystemIoT Home Automation System
IoT Home Automation System
 
Compiler design presentaion
Compiler design presentaionCompiler design presentaion
Compiler design presentaion
 
IoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdfIoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdf
 
IoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdfIoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdf
 
IoT & Applications Digital Notes (1).pdf
IoT & Applications Digital Notes (1).pdfIoT & Applications Digital Notes (1).pdf
IoT & Applications Digital Notes (1).pdf
 
IoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdfIoT & Applications Digital Notes.pdf
IoT & Applications Digital Notes.pdf
 
Fundamental Concept of Internet of Things
Fundamental Concept of Internet of ThingsFundamental Concept of Internet of Things
Fundamental Concept of Internet of Things
 
Implementation of IoT in Agriculture: A Scientific Approach for Smart Irriga...
Implementation of IoT in Agriculture: A Scientific  Approach for Smart Irriga...Implementation of IoT in Agriculture: A Scientific  Approach for Smart Irriga...
Implementation of IoT in Agriculture: A Scientific Approach for Smart Irriga...
 
Iot presentation
Iot presentationIot presentation
Iot presentation
 
Internet of things (iot)
Internet of things (iot)Internet of things (iot)
Internet of things (iot)
 
Soil Monitoring system using Intel Galileo
Soil Monitoring system using Intel GalileoSoil Monitoring system using Intel Galileo
Soil Monitoring system using Intel Galileo
 
Internet of things
Internet of thingsInternet of things
Internet of things
 
What are the 7 Common IoT Protocols.pdf
What are the 7 Common IoT Protocols.pdfWhat are the 7 Common IoT Protocols.pdf
What are the 7 Common IoT Protocols.pdf
 
What are the 7 Common IoT Protocols.pdf
What are the 7 Common IoT Protocols.pdfWhat are the 7 Common IoT Protocols.pdf
What are the 7 Common IoT Protocols.pdf
 
IRJET- Enabling Distributed Intelligence Assisted Future Internet of thing Co...
IRJET- Enabling Distributed Intelligence Assisted Future Internet of thing Co...IRJET- Enabling Distributed Intelligence Assisted Future Internet of thing Co...
IRJET- Enabling Distributed Intelligence Assisted Future Internet of thing Co...
 
E-Toll Payment Using Azure Cloud
E-Toll Payment Using Azure CloudE-Toll Payment Using Azure Cloud
E-Toll Payment Using Azure Cloud
 

Rajat Bandejiya(14uec076)Lusip (Smart Campus) Report

  • 1. 1 Smart LNMIIT Campus Project report submitted in Completion of Internship on topic Smart LNMIIT Campus In Electronics & Communication Engineering By Rajat Bandejiya 14uec076 bandejiyar@gmail.com Under Guidance of Prof. Ravi Gorthi Assistant Prof. Purnendu karmakar, Associate Prof. Sakhti Balan Department Of Electronics and Communication and engineering The LNM Institute of Information Technology, Jaipur July, 2016
  • 2. 2 The LNM Institute of Information Technology Jaipur, India CERTIFICATE This is to certify that the Internship work entitled Smart LNMIIT Campus ,submitted by Rajat Bandejiya (14uec076) in fulfillment of the Internship, is a bonafide record of work carried out by him at the Department of Electronics and Communication Engineering, The LNM Institute of Information Technology, Jaipur, (Rajasthan) India, during Summer Vacation’ 2017 under my supervision and guidance. Date Prof. Ravi Gorthi ___________________________ Assistant Prof. Purnendu karmakar, ____________________________ Associate Prof. Sakhti Balan
  • 3. 3 Acknowledgments I would like to express my special appreciation and thanks to my advisor Assistant Professor Purnendu Karmakar Sir, who has been an incredible mentor for me. I would like to thank him for encouraging my project, for his precious time with thoughtful discussion and his helping hand during many tough phases throughout this Internship. I am also grateful to Prof. Ravi Gorthi Sir and Associate Prof. Sakhti Balan Sir for his perpetual encouragement, generous help and inspiring guidance in my project. I would also like to express thanks to all the other faculty members and staff of the Department of Electronics and Communication Engineering , The LNM Institute of Information Technology, Jaipur (Raj.) for their generous help in various ways which helped me in the completion of this project.
  • 4. 4 Abstract The explosive growth of the “Internet of Things” is changing our world and the rapid drop in price for typical IoT components is allowing people to innovate new designs, products at home and current components of typical IoT devices for the future. IoT design considerations, constraints and interfacing between the physical world and devices is changing Our lifestyle. So, while people are changing the lifestyle, Government Is Also Involving in IOT by Bringing the Projects likes Smart Cities. So Working for the Project Smart LNMIIT Campus as an Intern can work as a Strong foundation to grab an opportunity in the real projects like smart cities. In this project I have used Intel Galileo development board for have some computational power and Thingspeak.com for cloud computing.
  • 6. 6 Contents Chapter Page 1. Introduction:- 7 1.1 Importance of Internet Of Things(IoT) 7 1.2 The Technological Trends That led IoT as a buzzword Nowadays 8 2. Literature Survey:- 9 2.1Referance 9 2.2About Project 10 2.2Problem Statement 10 3. Methodology:- 11 3.1Components Used 11 3.2Reason Why I Chose Intel Galileo 13 3.3Methods to Proceed 16 3.3.1 Steps that I prefer to Start with my development board 16 3.3.2 steps to connect the board with wifi 19 3.3.3 Method to connect the humidity sensor with board 20 3.3.4 Data Visualisation for analog sensor over Web using 20 Cloud Services 4. Results and Conclusion:- 21 5. Bibliography:- 22 6. Appendix 23
  • 7. 7 Chapter 1 Introduction 1.1 Importance of Internet of Things (IoT). It is hard to imagine life without Internet – you have come to rely on it so much – for your work to stay in touch with family and friends, to capture and share those special moments, to check nearby your way around in a new neighbourhood. Did you ever wonder how and when all this happened? Or how and when sensors came to be in your cell phone? The Internet is a huge platform for exchanging information, which has completely revolutionized the world. So We Can use Internet as a very useful asset for our work. Now think if we can use Internet with Sensors connected with some Development board (any Embedded System) i.e. we connect every Computational powers with each other from the world, it is said that about 20,000 crore devices will be connected till year 2020 this can actually change or Revolutionize the world that is why IOT is the Closest Emerging technology and so working and gaining knowledge can make us to help and solve the problems of society a Lot. IOT is all about three things:- 1.) Any Computational power which is provided by embedded systems 2.) Any Cloud Service either may be Cloud Computing or Cloud Storage 3.) And Last but Most Important is Networking.
  • 8. 8 1.2) The technological trends that led IoT as a buzzword nowadays I. COST Well there was a time of 1940s when a computer ENIAC of size as big as your room costs about $500,000 but know a laptop which is much, much powerful than ENIAC is so much handy and costs less than $500, so computational power is so much cheap nowadays that is the reason market is working in this field a lot 2. HARDWARE SIZE In 1940s ENIAC Computer Of that time was Not able to fit into anything as was as big as Our room and nowadays we are having great computational power in our hands. 3. COMPUTATIONAL ABILITY Computational power has grown dramatically as Nowadays Audio processing, Network Communication requires a great computational power which was unable those days 4. CLOCK RATE Computational Speed Has Increased Dramatically according to moore’s law which states the number of transistors per square inch on integrated circuits had doubled every year since the integrated circuit was invented. 5. INTERNET ACCESS This is the most important aspect why many research are going on in IOT and IoT is said to be emerging technology and Market is coming to have a dive in the ocean of IoT. In 1940s there was No Internet or Connectivity, No Networking, Now it is exists and is also reachable in different parts of world. Internet Connection makes IOT easy and Possible 6. DATA COST Now internet is that much cheap that a lot people can afford it.
  • 9. 9 Chapter 2 Literature Survey 2.1 Reference Research Papers:- 1) Wireless sensors in agriculture and food industry- Recent development and future perspective This paper presents an overview on recent development of wireless sensor technologies and standards for wireless communications as applied to wireless sensors. Examples of wireless sensors and sensor networks applied in agriculture and food production for environmental monitoring, precision agriculture. REFERANCE:- http://www.sciencedirect.com/science/article/pii/S0168169905001572 2) Embracing the Internet Of Everything To Capture the Share of $14.4 trillion(By CISCO) This Paper Is published By Cisco which Shows Why IOT is the Future REFERANCE :- https://www.dropbox.com/s/vxp24vcstsqlji1/ioe-economy-insights.pdf?dl=0 3) Hardware-Software Codesign of embedded systems This Paper Discusses The Importance of Embedded Systems and Design REFERANCE:- https://drive.google.com/a/lnmiit.ac.in/file/d/0BzNhMhwiU4H- dXJrTWROWnM0QWM/view?usp=sharing But above research papers were failed to address how to proceed practically. They provide the research work and knowledge but was not able to give the practical knowledge about how to apply which I solved In and shown in this report.
  • 10. 10 2.2 About Project Project Is all about IOT (Internet Of Things).In this Project while having a vision of Smart campus We had to make temperature Mapping System. Which can actually Map the temperature i.e. can tell at what location what was the temperature of any moving or stationary thing. And after sensing the temperature we can further Visualise the Data via Cloud Computing (Middleware) over the web. We can use this same system for knowing the temperature in the sky by placing the same system on the Quadcopter. We can use the same project in the agriculture by using the humidity sensor with any other development board. For example this project can be use for automatic irrigation pump which can switch on and off according to the water requirement of the field We can use the same project for the sprinklers in gardens. For example if we want that a particular sprinkler should on or off according to the humidity present in the field. The main requirement are a humidity sensor with a Development board PROBLEM STATEMENT:- Well the problem is to sense the analog data from environment and visualise the data via some cloud computing service(Thingspeak.com)
  • 11. 11 Chapter 3 Methodology 3.1) Components Used Intel Galileo Development Board Fig 3.1 Referance: https://communities.intel.com/servlet/...102-1.../Galileo_GettingStarted_329685_005.pdf .
  • 12. 12 Starter Kit For Intel Galileo / Intel Edison Fig 3.2 Referance:- http://www.seeedstudio.com/item_detail.html?p_id=1978
  • 13. 13 Fig 3.3 3.2) Reason Why I Chose Intel Galileo The Reason I chose Intel Galileo Was— Intel and Arduino’s announcement about the new Galileo board is big news. It’s a Linux-based board that I’ve found to be remarkably compatible with the Arduino ecosystem based on my first few steps with a prerelease version of the board. Here are some of the best features of this groundbreaking collaboration between Intel and Arduino Shield Compatibility The expansion header on the top of Galileo should look familiar since it’s compatible with 5V and 3.3V Arduino shields designed for the Uno R3 (also known as the Arduino 1.0 pinout). This means that it has 14 digital I/O pins, 6 analog inputs, a serial port, and an ICSP header.
  • 14. 14 Familiar IDE The Intel-provided integrated development environment for the Galileo looks exactly like the Arduino IDE on the surface. Under the Boards menu, you’ll see addition of the Galileo under “Arduino X86 Boards.” The modified IDE also is capable of upgrading the firmware on the board. Ethernet Library Compatibility Using the Ethernet port on the board is as simple as using Arduino’s Ethernet library. I was able to get a HTTP connection to Google without even modifying the standard WebClient example. Real Time Clock Most Linux boards rely on a connection to the Internet to get the current date and time. But with Galileo’s on-board RTC (real time clock), you’ll be able to track time even when the board is powered off. Just wire up a 3.0V coin cell battery to the board. Works with PCI Express Mini Cards On the bottom of the board is an expansion slot for PCI Express Mini cards. This means you can connect WiFi, Bluetooth, GSM cards for connectivity, or even a solid state drive for more storage. When you connect a WiFi card, it will work with Arduino’s Wifi library.
  • 15. 15 USB Host Port Galileo’s dedicated USB On-The-Go port will let you use the the Arduino USB Host library to act as a keyboard or mouse for other computers. MicroSD Support If you want to store data, a microSD card slot is accessible from your code by using the standard Arduino SD card library. TWI/I2C, SPI Support Using the standard Arduino Wire library or SPI library, you can connect TWI/I2C or SPI components to the Galileo. Serial Connectivity Not only is there the typical serial port for your sketches on pins 0 and 1 of the Arduino pinout, but there’s also a separate serial port for connecting to the Linux command line from your computer. You’ll connect to it through the audio jack interconnect next to the Ethernet port. This port is only used for serial. Linux on Board A very light distribution of Linux is loaded onto the 8 MB of flash memory. If you want to use tools like ALSA (for sound), V4L2 (for video input), Python, SSH, node.js (for web projects), and openCV (for computer vision), you can boot Galileo from an SD card image that Intel provides. Which gives it a great power
  • 16. 16 3.3) Method to Proceed 3.3.1)Steps That I prefer To Start with My Development Board Are as Followed:- I) Connect the Intel Galileo Board. Get a Intel Galileo Development Board and a Data Cable. The kit contains: • 1x Intel® Galileo Customer Reference Board (CRB) (Fab D with blue PCB) • 1x 5v power supply with cable Warning: You must use a power supply or you will damage the board! II) Download Arduino Environment and Board Firmware. Download the latest IDE and firmware files here: https://communities.intel.com/community/makers/drivers You will need up to 200 MB of free space, depending on which OS you are using. III) Connect the board with your PC. WARNING: You must use the power supply or you will damage the board. Connect the 5V power cable to the Galileo board and to a power outlet. Note: Always connect the 5V power before any other connection. The green power LED (labelled ON) will turn on. IV) Install The Drivers and other software. Windows: 1. If not done already, connect the 5V power cable to the Galileo board and to a power outlet. Note: Always connect the 5V power before the USB connection. 2. Connect the USB cable to the USB Client Port (closest to the Ethernet) and to a PC. Wait for Windows to begin its driver installation process. After a few moments, the process will fail. 3. Click on the Start Menu, and open up the Control Panel. While in the Control Panel, navigate to System. Next, click on System. Once the System window is up, open the Device Manager. 4. Look under Ports (COM & LPT). You should see an open port named Gadget Serial V2.4. If you do not see this open port, follow steps a-c in the Note below. 5. Right-click on the Gadget Serial V2.4 port and choose the Update Driver Software option. 6. Choose the Browse my computer for Driver software option.
  • 17. 17 7. Navigate to the hardware/arduino/x86/tools directory. This allows the proper driver file linux-cdc-acm.inf to be installed. 8. Once the driver is successfully installed, Device Manager will show a Galileo (COMx) device under Ports (COM & LPT). Note the COMx port number as it will be needed in the IDE later. The example below shows COM5. V) Launch the Arduino IDE Application. VI) Update Your board Firmware The IDE contains the release-specific firmware for your board. Follow the steps below to update your board firmware using the IDE. 1. Remove all power from the board (USB and 5 V power cord). This makes sure that no sketch is running on the board 2. Remove the SD card from the board (if it is inserted). 3. Power up the board by plugging in the 5V power supply. 4. Connect the USB cable to the USB Client Port (closest to the Ethernet). Note which COM port it is connected on. 5. Launch the IDE and select the board via Tools > Board > Intel® Galileo 6. Select the correct serial port using Tools > Serial Port Note: Do not download any sketch to the board before you upgrade the firmware. 7. Launch the software upgrade using Help > Firmware Upgrade 8. A message is displayed asking you to confirm that 5V power cable is plugged in. Click Yes if it is connected. If no cable is plugged in, exit the upgrade process by selecting No, connect the power, and restart this process. 9. The board can be upgraded to newer software or downgraded to older software. The next message displays the current software version that is on the board and the software version that you are trying to flash onto the board. Select Yes to either Upgrade/Downgrade or flash the same software again. 10. The upgrade progress takes about 6 minutes and is displayed in several popup messages. During the upgrade process, you will not have access to the IDE. Note: The power and USB cables must stay connected during the upgrade process. 11. When the upgrade completes, a message is displayed stating Target Firmware upgraded successfully. Click OK to close the message. If you want to flash a different firmware version that is not contained in the IDE, download the SPI flash image capsule files as described in Section 2. The downloaded capsule should be copied to the following locations, depending upon your operating system. Make sure that there is only
  • 18. 18 one *.cap file in the location below. If you are downloading a new file, rename the previous *.cap to some other extension. • Windows: Arduino-1.5.3/hardware/tools/x86/bin/ VII) Open The blink Example. Open the LED blink example sketch: File > Examples > 1.Basics > Blink VIII) Select your Serial Port. Select the serial device of your board from the Tools > Serial Port menu. Windows: Use the COMx number assigned earlier. You can retrieve the port number by navigating to: Start > Control Panel > System and Security > System > Device Manager Look under Ports (COM & LPT) to see which COMx is assigned to Gadget Serial. IX) Upload The Programe Click the Upload button in the IDE and wait a few seconds. If the upload is successful, the message Done uploading. will appear in the status bar. A few seconds after the upload finishes, you will see a green LED on the board start to blink. Congratulations! You've gotten your board up and running. For more information about Intel® Galileo, including online communities and support, try these links: http://www.intel.com/support/galileo http://communities.intel.com/community/makers.
  • 19. 19 3.3.2)Steps to connect the Board With Wi-Fi(SD card should be configured before This Step) 1) Connect the antennae’s with the board. 2) Connect the FTDI Cable with your board. 3) Open Tera Term. 4) Select Serial Port 5) Change the baud rate to 115200/s 6) Now you can see the OS burn inside sd card running inside in the board on term term. 7) Wait for OS To boot 8) Now write Root as user 9) Congrats Now we have access on the OS running in the development board via Tera term 10) Now write These Commands:- # lspci -k | grep -A 3 -i "network" # Connmanctl connmanctl> enable wifi connmanctl> scan wifi connmanctl> services connmanctl> config wifi_<MAC_a>_<MAC_h>_managed_psk -- autoconnect yes ---ipv4 dhcp connmanctl> agent on connmanctl>connect wifi_0cd2926de3ae_486f6d65574c414e_managed_psk 11) Now enter the Password Of Respective SSID 12) Congrats now your development board is connected with WLAN network on its own
  • 20. 20 3.3.3)Method to connect Humidity Sensor(Any Analog Sensor) with the development Board 1) Connect the Intel Galileo Board. 2) Write Code as in appendix bullet point 6.2 3) Now we Can Observe the voltage Read in the Serial monitor. 3.3.4)Data Visualisation for The temperature Over Thingspeak.com using Cloud Computing 1) Connect The Temperature sensor with the development board as we did with the humidity sensor. 2) Code For Data Visualisation is in appendix as Bullet point 6.1 3 )Now Compile and then Burn and program this Code now we can see the data visualisation of our analog data over thingspeak. 4) Congo..!! Now We are Able To see our real time analog data visualisation over the web. Fig 3.4 Chapter 4 Results & Conclusions
  • 21. 21 Results:- The graph generated shows the change of analog data generated with respect to time and the analogue data generated is real time data which is generated and visualised automatically using cloud computing. So by this proposed Work We can Visualise any analog sensor data over the web. If instead of analog sensor if we use Digital sensor than also we can Visualise data with the help of any Cloud Computing Service. Conclusion:- Since interpreting graph is easier than interpreting any log data so this proposed work can help any authority which want to analyse data in real time. For Example:- Suppose there is an water supplying tank which provide potable water and as we know that about 5000 children a dies because of drinking dirty water. So to solve this issue this proposed work can be used, if this system in which all the sensors is there at every tank in the world which shows authority the difference between dirty and potable water, than authority can come and solve all the issues whenever water get polluted right at that moment. And using thus proposed work many lives can be saved.
  • 22. 22 Chapter -5 Bibliography [1] https://www.coursera.org/specializations/internet-of-things [2] http://www.sciencedirect.com/science/article/pii/S0168169905001572. [3] https://www.dropbox.com/s/vxp24vcstsqlji1/ioe-economy-insights.pdf?dl=0 [4] https://drive.google.com/a/lnmiit.ac.in/file/d/0BzNhMhwiU4H- dXJrTWROWnM0QWM/view?usp=sharing [5] http://makezine.com/2013/10/03/10-great-intel-galileo-features/ [6] https://www.dropbox.com/s/i9wu1ateyenmngt/Galileo_QuickStartGuide.pdf?dl=0 [7] https://www.dropbox.com/s/tbydwlxdthonlof/Galileo%20Schematic.pdf?dl=0 [8] https://www.theguardian.com/business/2006/nov/10/water.environment [9] https://communities.intel.com/servlet/...102-1.../Galileo_GettingStarted_329685_005.pdf [10] http://www.seeedstudio.com/item_detail.html?p_id=1978
  • 23. 23 Chapter -6 Appendix 6.1) #define DHT11_PIN 5 dht DHT; #define DEBUG FALSE //comment out to remove debug messages //*-- Hardware Serial #define _baudrate 9600 //*-- Software Serial // #define _rxpin 2 #define _txpin 3 SoftwareSerial debug( _rxpin, _txpin ); // RX, TX //*-- IoT Information #define SSID "shubham" #define PASS "qwertyuiop" #define IP "184.106.153.149" // ThingSpeak IP Address: 184.106.153.149 // GET /update?key=[THINGSPEAK_KEY]&field1=[data 1]&field2=[data 2]...; String GET = "GET /update?key=P2KNPEVR81GFZZXD"; void setup() { Serial.begin( _baudrate ); debug.begin( _baudrate ); sendDebug("AT"); delay(5000); if(Serial.find("OK")) { debug.println("RECEIVED: OKnData ready to sent!"); connectWiFi(); } }
  • 24. 24 void loop() { int chk = DHT.read11(DHT11_PIN); float val1 = DHT.temperature; char buf[32]; String temp = dtostrf( val1, 4, 1, buf); updateTS(temp); delay(3000); // } //----- update the Thingspeak string with 3 values void updateTS( String T) { // ESP8266 Client String cmd = "AT+CIPSTART="TCP","";// Setup TCP connection cmd += IP; cmd += "",80"; sendDebug(cmd); delay(2000); if( Serial.find( "Error" ) ) { debug.print( "RECEIVED: ErrornExit1" ); return; } cmd = GET + "&field1=" + T ; Serial.print( "AT+CIPSEND=" ); Serial.println( cmd.length() ); if(Serial.find( ">" ) ) { debug.print(">"); debug.print(cmd);
  • 25. 25 Serial.print(cmd); } else { sendDebug( "AT+CIPCLOSE" );//close TCP connection } if( Serial.find("OK") ) { debug.println( "RECEIVED: OK" ); } else { debug.println( "RECEIVED: ErrornExit2" ); } } void sendDebug(String cmd) { debug.print("SEND: "); debug.println(cmd); Serial.println(cmd); } boolean connectWiFi() { Serial.println("AT+CWMODE=1");//WiFi STA mode - if '3' it is both client and AP delay(2000); //Connect to Router with AT+CWJAP="SSID","Password"; // Check if connected with AT+CWJAP? String cmd="AT+CWJAP=""; // Join accespoint cmd+=SSID;
  • 26. 26 cmd+="",""; cmd+=PASS; cmd+="""; sendDebug(cmd); delay(5000); if(Serial.find("OK")) { debug.println("RECEIVED: OK"); return true; } else { debug.println("RECEIVED: Error"); return false; } cmd = "AT+CIPMUX=0";// Set Single connection sendDebug( cmd ); if( Serial.find( "Error") ) { debug.print( "RECEIVED: Error" ); return false; } }
  • 27. 27 6.2) /* ReadAnalogVoltage Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor. Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground. This example code is in the public domain. */ // the setup routine runs once when you press reset: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); } // the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1023.0); // print out the value you read: Serial.println(voltage); }