Sunteți pe pagina 1din 35

INTERNSHIP/OJT / TRAINING

REPORT

on

INTERNET OF THINGS

Submitted by

Anagani Venkata Mohana Siva Sainadh

Registration No 11700956
Programme Name:

Under the Guidance of

Name of the Industry Coordinator L.Gopal Reddy

School of Electronics & Electrical Engineering Lovely


Professional University, Phagwara

(June-July, 2019)
DECLARATION

I hereby declare that I have completed my four/six weeks summer training at


(name and location of organization) from (start date) to (end date) under
the guidance of (Name of Industry coordinator). I have declare that I have worked with full dedication
during these six weeks of training and my learning outcomes fulfill the requirements of training for the
award of degree of _(Relevant Degree ), Lovely Professional University, Phagwara.

(Signature of student)
Name of Student
Registration no:

Date:
INTRODUCTION
The internship that I have attended is INTERNET OF THINGS which is performed at
SYTIQHUB TECHNOLOGIES PRIVATE LIMITED is located at my home state. The internship
is deled with the new technologies that are changing the day to day life style of mankind. In
this we have learnt about daily problems that are faced in the whole technology and their
solutions that should be needed and made a great deal of energy in the work area which has
a great experience in order to make it as real time job experience and has to be tackled.

In this we have made a very good methodological ideas that were made by me have been
agreed in the course accomplishment and they made me to work and think while explaining the
sensor codes and their outline sketch for the better understanding in the field area too. This kind
of the experienced tutors have made me to work hard for the real world experience to make it
as much as experienced.

The work place have gave many experiences of the sensors that has been used and
given work place area as a friendly experience this made the students to use their own skills
to design their own projects which can be make applicable for real world usage.

In this I will be notifying all the equipment that I have used at the field area and the
minimal work that to be done to make the equipment that needed to be most experience. This
was also gives the working procedure and connection capacity in the field of internet of things.

1
ARDUINO

Fig 1
Arduino is an open-source hardware and software company, project and user community that
designs and manufactures single-board microcontrollers and microcontroller kits for building digital
devices and interactive objects that can sense and control both physically and digitally. Its
products are licensed under the GNU Lesser General Public License (LGPL) or the GNU General
Public License (GPL), permitting the manufacture of Arduino boards and software distribution by
anyone. Arduino boards are available commercially in preassembled form.

The Arduino project was started at the Interaction Design Institute Ivrea (IDII) in Ivrea, Italy. At
that time, the students used a BASIC Stamp microcontroller at a reasonable cost, a considerable
expense for many students . In 2003 Hernando Barragán created the development
platform Wiring as a Master's thesis project at IDII, under the supervision of Massimo Banzi
and Casey Reas. Casey Reas is known for co-creating, with Ben Fry, the Processing development
platform. The project goal was to create simple, low cost tools for creating digital projects by
non-engineers. The Wiring platform consisted of a printed circuit board (PCB) with
an ATmega168 microcontroller, an IDE based on Processing and library functions to easily
program the microcontroller. In 2003, Massimo Banzi, with David Mellis, another IDII student,
and David Cuartielles, added support for the cheaper ATmega8 microcontroller to Wiring. But
instead of continuing the work on Wiring, they forked the project and renamed it Arduino. The
initial Arduino core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca
Martino, and David Mellis, but Barragán was not invited to participate. Following the completion
of the Wiring platform, lighter and less expensive versions were distributed in the open-source
community.

2
ARDUINO UNO
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle 6.0 and newer)
Schematic: arduino-uno-Rev3-schematic.pdf Note: The Arduino reference design can use an Atmega8,
168, or 328, Current models use an ATmega328, but an Atmega8 is shown in the schematic for reference.
The pin configuration is identical on all three processors.

The Arduino Uno can be powered via the USB connection or with an external power supply. The power
source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter
(wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the
board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER
connector. The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using more than
12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
• VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5
volts from the USB connection or other regulated power source). You can supply voltage through this pin,
or, if supplying voltage via the power jack, access it through this pin.
• 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with
power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-
12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We
don't advise it.
• 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
• GND. Ground pins.

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM and 1 KB of
EEPROM (which can be read and written with the EEPROM library).

The Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or other
microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial communication over
USB and appears as a virtual com port to software on the computer. The '16U2 firmware uses the standard
USB COM drivers, and no external driver is needed. However, on Windows, a .inf file is required. The
Arduino software includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-
to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). A
SoftwareSerial library allows for serial communication on any of the Uno's digital pins. The ATmega328
also supports I2C (TWI) and SPI communication. The Arduino software includes a Wire library to
simplify use of the I2C bus; see the documentation for details. For SPI communication, use the SPI library.

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts and
overcurrent. Although most computers provide their own internal protection, the fuse provides an extra
layer of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break the
connection until the short or overload is removed.

3
SENSORS
GPS

Fig 2
The SKG13C is a complete GPS engine module that features super sensitivity, ultra low power and small
form factor. The GPS signal is applied to the antenna input of module, and a complete serial data message
with position, velocity and time information is presented at the serial interface with NMEA protocol or
custom protocol. It is based on the high performance features of the MediaTek MT3339 single-chip
architecture, Its –165dBm tracking sensitivity extends positioning coverage into place like urban canyons
and dense foliage environment where the GPS was not possible before. The small form factor and low
power consumption make the module easy to integrate into portable device like PNDs, mobile phones,
cameras and vehicle navigation systems.

Features
Ultra high sensitivity: -165dBm
Extremely fast TTFF at low signal level
Built-in 12 multi-tone active interference canceller
Low power consumption: Typical 18mA@3.3V
±10ns high accuracy time pulse (1PPS)
Advanced Features: AlwaysLocate; AIC; EPO;EASY
QZSS,SBAS(WAAS,EGNOS,MSAS,GAGAN)
Indoor and outdoor multi-path detection and compensation
Small form factor: 15x13x2.2mm
RoHS compliant (Lead-free)

Applications
LBS (Location Based Service)
PND (Portable Navigation Device)
Vehicle navigation system
Mobile phone

4
PIN Description

Fig 3
Advanced Software Features
Standby Mode
User can issue software command to make GPS module go into standby mode that consumes less than
200uA current. GPS module will be awaked when receiving any byte. The following flow chart is an
example to make GPS module go into standby mode and then wake up.
Periodic Mode
When GPS module is commanded to periodic mode, it will be in operation and standby periodically. Its
status of power consumption is as below chart

5
AlwaysLocate
AlwaysLocate is an intelligent controller of periodic mode. Depending on the environment and motion
conditions, GPS module can adaptively adjust working/standby time to achieve balance of positioning
accuracy and power consumption. In this mode, the host CPU does not need to control GPS module until
the host CPU needs the GPS position data. The following flow chart is an example to make GPS module
go into AlwaysLocateTm mode and then back to normal operation mode.
AGPS
Support for Fast TTFF (EPO™) The AGPS (EPO™) supply the predicated Extended Prediction Orbit data
to speed TTFF ,users can download the EPO data to GPS engine from the FTP server by internet or
wireless network ,the GPS engine will use the EPO data to assist position calculation when the navigation
information of satellites are not enough or weak signal zone .
EASY
The EASY is embedded assist system for quick positioning, the GPS engine will calculate and predict
automatically the single emperies ( Max. up to 3 days )when power on ,and save the predict information
into the memory , GPS engine will use these information for positioning if no enough information from
satellites , so the function will be helpful for positioning and TTFF improvement under indoor or urban
condition ,the Backup power (VBACKUP) is necessary .

PERFORMANCE

Fig 4

6
7
GSM

Fig 5
APPLICATIONS
This module is designed to satisfy manufacturers, which also have a physical dimension concern of
embedded GSM/GPRS features built into their products. Some main application devices of this module
are:
Telematics
Wireless Terminal
Alarm/Securities System
Automatic Meter Reading
Remote control
Mobile Trunk
Wireless PSTN
GSM was intended to be a secure wireless system. It has considered the user authentication using a pre-
shared key and challenge-response, and over-the-air encryption. However, GSM is vulnerable to different
types of attack, each of them aimed at a different part of the network.
The development of UMTS introduced an optional Universal Subscriber Identity Module (USIM), that
uses a longer authentication key to give greater security, as well as mutually authenticating the network
and the user, whereas GSM only authenticates the user to the network (and not vice versa). The security
model therefore offers confidentiality and authentication, but limited authorization capabilities, and
no non-repudiation.
GSM uses several cryptographic algorithms for security. The A5/1, A5/2, and A5/3 stream ciphers are
used for ensuring over-the-air voice privacy. A5/1 was developed first and is a stronger algorithm used
within Europe and the United States; A5/2 is weaker and used in other countries. Serious weaknesses have
been found in both algorithms: it is possible to break A5/2 in real-time with a ciphertext-only attack, and in
8
January 2007, The Hacker's Choice started the A5/1 cracking project with plans to use FPGAs that allow
A5/1 to be broken with a rainbow table attack. The system supports multiple algorithms so operators may
replace that cipher with a stronger one.
Since 2000 different efforts have been made in order to crack the A5 encryption algorithms. Both A5/1
and A5/2 algorithms have been broken, and their cryptanalysis has been revealed in the literature. As an
example, Karsten Nohl developed a number of rainbow tables(static values which reduce the time needed
to carry out an attack) and have found new sources for known plaintext attacks. He said that it is possible
to build "a full GSM interceptor...from open-source components" but that they had not done so because of
legal concerns. Nohl claimed that he was able to intercept voice and text conversations by impersonating
another user to listen to voicemail, make calls, or send text messages using a seven-year-
old Motorola cellphone and decryption software available for free online.
GSM uses General Packet Radio Service (GPRS) for data transmissions like browsing the web. The most
commonly deployed GPRS ciphers were publicly broken in 2011.
The researchers revealed flaws in the commonly used GEA/1 and GEA/2 ciphers and published the open-
source "gprsdecode" software for sniffing GPRS networks. They also noted that some carriers do not
encrypt the data (i.e., using GEA/0) in order to detect the use of traffic or protocols they do not like
(e.g., Skype), leaving customers unprotected. GEA/3 seems to remain relatively hard to break and is said
to be in use on some more modern networks. If used with USIM to prevent connections to fake base
stations and downgrade attacks, users will be protected in the medium term, though migration to 128-bit
GEA/4 is still recommended.

Fig 6
9
10
RFID

Fig 7
The EM-18 RFID Reader module operating at 125kHz is an inexpensive solution for your RFID based
application. The Reader module comes with an on-chip antenna and can be powered up with a 5V power
supply. Power-up the module and connect the transmit pin of the module to recieve pin of your
microcontroller. Show your card within the reading distance and the card number is thrown at the output.
Optionally the module can be configured for also a weigand output.

Applications
• e-Payment
• e-Toll Road Pricing
• e-Ticketing for Events
• e-Ticketing for Public Transport
• Access Control
• PC Access
• Authentication
• Printer / Production Equipment

Fig 8

11
12
BLUETOOTH

Fig 9
Hardware features
Typical -80dBm sensitivity
Up to +4dBm RF transmit power
Low Power 1.8V Operation ,1.8 to 3.6V I/O
PIO control  UART interface with programmable baud rate
With integrated antenna
With edge connector

Software features
Default Baud rate: 38400,
Data bits:8, Stop bit:1,Parity:No parity, Data control: has.
Supported baud rate: 9600,19200,38400,57600,115200,230400,460800.
Given a rising pulse in PIO0, device will be disconnected.
Status instruction port PIO1: low-disconnected, high-connected;
PIO10 and PIO11 can be connected to red and blue led separately. When master and slave are paired, red
and blue led blinks 1time/2s in interval, while disconnected only blue led blinks 2times/s.
Auto-connect to the last device on power as default.
Permit pairing device to connect as default.
Auto-pairing PINCODE:”0000” as default
Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.

13
This is a simple program it is available in the ide software and some of the communication sets
are discussed.

I2C : SDA,SCLK(synchronus)
CAN,UART : TX,RX(asynchronus)
SPI : MISO,SS,MOSI,CLK(synchronus)
USB : D+,D-(synchronus)
UART IS A HALFDUPLEX means only sending or receiving is done at a time.
CAN is used only in automobiles with at a time connection of 255 different devices.

14
ULTRASONIC

Fig 10
Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact measurement function, the
ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control
circuit. The basic principle of work:
(1) Using IO trigger for at least 10us high level signal.
(2) The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back.
(3) IF the signal back, through high level , time of high output IO duration is the time from sending
ultrasonic to returning. Test distance = (high level time×velocity of sound (340M/S) / 2.

POWER PAMETERS

15
TIMING PROCEDURE
The Timing diagram is shown below. You only need to supply a short 10uS pulse to the trigger input to
start the ranging, and then the module will send out an 8 cycle burst of ultrasound at 40 kHz and raise its
echo. The Echo is a distance object that is pulse width and the range in proportion .You can calculate the
range through the time interval between sending trigger signal and receiving echo signal. Formula: uS / 58
= centimeters or uS / 148 =inch; or: the range = high level time * velocity (340M/S) / 2; we suggest to use
over 60ms measurement cycle, in order to prevent trigger signal to the echo signal.

16
LDR

Fig 11
Two cadmium sulphide(cds) photoconductive cells with spectral responses similar to that of the human
eye. The cell resistance falls with increasing light intensity. Applications include smoke detection,
automatic lighting control, batch counting and burglar alarm systems.

Applications
Photoconductive cells are used in many different types of circuits and applications.

Analog Applications
· Camera Exposure Control
· Auto Slide Focus - dual cell
· Photocopy Machines - density of toner
· Colorimetric Test Equipment
· Densitometer · Electronic Scales - dual cell
· Automatic Gain Control – modulated light source
· Automated Rear View Mirror

Digital Applications
· Automatic Headlight Dimmer
· Night Light Control
· Oil Burner Flame Out
· Street Light Control
· Absence / Presence (beam breaker)
· Position Sensor

17
POWER CHARACTERISTICS

Fig 12
Sensitivity

The sensitivity of a photodetector is the relationship between the light falling on the device and the
resulting output signal. In the case of a photocell, one is dealing with the relationship between the incident
light and the corresponding resistance of the cell.

Fig 13
Spectral Response
Like the human eye, the relative sensitivity of a photoconductive cell is dependent on the wavelength
(color) of the incident light. Each photoconductor material type has its own unique spectral response curve
or plot of the relative response of the photocell versus wavelength of light.

18
Fig 14

19
ACCELEROMETER

Fig 15
It is a 3-axis sensing Small, low profile package 4 mm × 4 mm × 1.45 mm LFCSP Low power : 350 μA
(typical) Single-supply operation: 1.8 V to 3.6 V 10,000 g shock survival Excellent temperature stability
BW adjustment with a single capacitor per axis RoHS/WEEE lead-free compliant

APPLICATIONS
Cost sensitive,
low power,
motion- and tilt-sensing applications
Mobile devices
Gaming systems
Disk drive
protection Image stabilization
Sports and health devices

The ADXL335 is a small, thin, low power, complete 3-axis accelerometer with signal conditioned voltage
outputs. The product measures acceleration with a minimum full-scale range of ±3 g. It can measure the
static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from
motion, shock, or vibration. The user selects the bandwidth of the accelerometer using the CX, CY, and
CZ capacitors at the XOUT, YOUT, and ZOUT pins. Bandwidths can be selected to suit the application,
with a range of 0.5 Hz to 1600 Hz for the X and Y axes, and a range of 0.5 Hz to 550 Hz for the Z axis.
The ADXL335 is available in a small, low profile, 4 mm × 4 mm × 1.45 mm, 16-lead, plastic lead frame
chip scale package (LFCSP_LQ).

20
RATING

Fig 16
The ADXL335 is a complete 3-axis acceleration measurement system. The ADXL335 has a measurement
range of ±3 g minimum. It contains a polysilicon surface-micromachined sensor and signal conditioning
circuitry to implement an open-loop acceleration measurement architecture. The output signals are analog
voltages that are proportional to acceleration. The accelerometer can measure the static acceleration of
gravity in tilt-sensing applications as well as dynamic acceleration resulting from motion, shock, or
vibration. The sensor is a polysilicon surface-micromachined structure built on top of a silicon wafer.
Polysilicon springs suspend the structure over the surface of the wafer and provide a resistance against
acceleration forces. Deflection of the structure is measured using a differential capacitor that consists of
independent fixed plates and plates attached to the moving mass. The fixed plates are driven by 180° out-
of-phase square waves. Acceleration deflects the moving mass and unbalances the differential capacitor
resulting in a sensor output whose amplitude is proportional to acceleration. Phase-sensitive demodulation
techniques are then used to determine the magnitude and direction of the acceleration. The demodulator
output is amplified and brought off-chip through a 32 kΩ resistor. The user then sets the signal bandwidth
of the device by adding a capacitor. This filtering improves measurement resolution and helps prevent
aliasing

X-axis Fig 17
21
Y-axis Fig 18

Z-axis Fig 19

22
23
DHT11

Fig 20
DHT11 Temperature & Humidity Sensor features a temperature & humidity sensor complex with a
calibrated digital signal output. By using the exclusive digital-signal-acquisition technique and temperature
& humidity sensing technology, it ensures high reliability and excellent long-term stability. This sensor
includes a resistive-type humidity measurement component and an NTC temperature measurement
component, and connects to a highperformance 8-bit microcontroller, offering excellent quality, fast
response, anti-interference ability and cost-effectiveness. Each DHT11 element is strictly calibrated in the
laboratory that is extremely accurate on humidity calibration. The calibration coefficients are stored as
programmes in the OTP memory, which are used by the sensor’s internal signal detecting process. The
single-wire serial interface makes system integration quick and easy. Its small size, low power
consumption and up-to-20 meter signal transmission making it the best choice for various applications,
including those most demanding ones. The component is 4-pin single row pin package. It is convenient to
connect and special packages can be provided according to users’ request.

DHT11’s power supply is 3-5.5V DC. When power is supplied to the sensor, do not send any instruction to
the sensor in within one second in order to pass the unstable status. One capacitor valued 100nF can be
added between VDD and GND for power filtering. Single-bus data format is used for communication and
synchronization between MCU and DHT11 sensor. One communication process is about 4ms. Data
consists of decimal and integral parts. A complete data transmission is 40bit, and the sensor sends higher
data bit first. Data format: 8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit
decimal T data + 8bit check sum. If the data transmission is right, the check-sum should be the last 8bit of
"8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data".

Fig 21
24
Specifications

Fig 22

25
ESP8266

Fig 23
ESP8266 offers a complete and self-contained Wi-Fi networking solution, allowing it to either host the
application or to offload all Wi-Fi networking functions from another application processor.
When ESP8266 hosts the application, and when it is the only application processor in the device, it is able
to boot up directly from an external flash. It has integrated cache to improve the performance of the system
in such applications, and to minimize the memory requirements.

Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any microcontroller-based
design with simple connectivity through UART interface or the CPU AHB bridge interface.

Features
• 802.11 b/g/n protocol
• Wi-Fi Direct (P2P), soft-AP
• Integrated TCP/IP protocol stack
• Integrated TR switch, balun, LNA, power amplifier and matching network
• Integrated PLL, regulators, and power management units
• +19.5dBm output power in 802.11b mode
• Integrated temperature sensor
• Supports antenna diversity
• Power down leakage current of < 10uA
• Integrated low power 32-bit CPU could be used as application processor
• SDIO 2.0, SPI, UART
• STBC, 1×1 MIMO, 2×1 MIMO
• A-MPDU & A-MSDU aggregation & 0.4µs guard interval
• Wake up and transmit packets in < 2ms
• Standby power consumption of < 1.0mW (DTIM3)

26
PIR

Fig 24
PIR sensors are more complicated than many of the other sensors explained in these tutorials (like
photocells, FSRs and tilt switches) because there are multiple variables that affect the sensors input and
output. To begin explaining how a basic sensor works, we'll use this rather nice diagram The PIR sensor
itself has two slots in it, each slot is made of a special material that is sensitive to IR. The lens used here is
not really doing much and so we see that the two slots can 'see' out past some distance (basically the
sensitivity of the sensor). When the sensor is idle, both slots detect the same amount of IR, the ambient
amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by,
it first intercepts one half of the PIR sensor, which causes a positive differential change between the two
halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a
negative differential change. These change pulses are what is detected.

The IR sensor itself is housed in a hermetically sealed metal can to improve noise/temperature/humidity
immunity. There is a window made of IR-transmissive material (typically coated silicon since that is very
easy to come by) that protects the sensing element. Behind the window are the two balanced sensors.

However, remember that we actually have two sensors, and more importantly we dont want two really big
sensing-area rectangles, but rather a scattering of multiple small areas. So what we do is split up the lens
into multiple section, each section of which is a fresnel lens.

27
Fig 25

28
CLOUD PLATFORMS

THINHSPEAK

ThingSpeak allows you to aggregate, visualize and analyze live data streams in the cloud. Some of the
key capabilities of ThingSpeak include the ability to:

• Easily configure devices to send data to ThingSpeak using popular IoT protocols.
• Visualize your sensor data in real-time.
• Aggregate data on-demand from third-party sources.
• Use the power of MATLAB to make sense of your IoT data.
• Run your IoT analytics automatically based on schedules or events.
• Prototype and build IoT systems without setting up servers or developing web software.
• Automatically act on your data and communicate using third-party services like Twilio® or
Twitter®.

To learn how you can collect, analyze and act on your IoT data with ThingSpeak, explore the topics
below:

Collect
Send sensor data privately to the cloud.

Analyze
Analyze and visualize your data with MATLAB.

Act
Trigger a reaction.
IoT solutions are built for many vertical applications such as environmental monitoring and control,
health monitoring, vehicle fleet monitoring, industrial monitoring and control, and home automation.
describes an emerging trend where a large number of embedded devices (things) are connected to the
Internet. These connected devices communicate with people and other things and often provide
sensor data to cloud storage and cloud computing resources where the data is processed and analyzed
to gain important insights. Cheap cloud computing power and increased device connectivity is
enabling this trend.

29
Fig 26

Fig 27

30
The main program it deals as follows:

#include <Adafruit_Sensor.h>
#include <ESP8266WiFi.h>
#include <DHT.h>
#define DHTPIN D2 // what pin we're connected to
#define DHTTYPE DHT11 // define type of sensor DHT 11
DHT dht (DHTPIN, DHTTYPE);
const char* ssid = "SYTIQHUB";
const char* password = "SytiqHub@975";
const char* host = "api.thingspeak.com";
const char* privateKey = "H7JNLB8WLXIESXYS";
int g,h;
void setup() {
Serial.begin(115200);
delay(10);
dht.begin();
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
delay(15000);
float h = dht.readHumidity();
float t = dht.readTemperature();
Serial.print("connecting to ");
Serial.println(host);
// Use WiFiClient class to create TCP connections
WiFiClient client;
const int httpPort = 80;
if (!client.connect(host, httpPort)) {
Serial.println("connection failed");
return;
}
// We now create a URI for the request
String url = "/update?api_key=";
url +=privateKey;
url +="&field1=";
url +=g;
url +="&field2=";
url +=h;
31
Serial.print("Requesting URL: ");
Serial.println(url);
// This will send the request to the server
client.print(String("GET ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Connection: close\r\n\r\n");
delay(10);
while(client.connected() && !client.available()) delay(1); //waits for data
while (client.connected() || client.available())
{
char charIn = client.read();
Serial.print(charIn);
}
Serial.println();
Serial.println("closing connection");
client.stop();
}

32
MIT APP INVENTOR

Fig 28
MIT App Inventor is an intuitive, visual programming environment that allows everyone – even
children – to build fully functional apps for smartphones and tablets. Those new to MIT App
Inventor can have a simple first app up and running in less than 30 minutes. And what's more,
our blocks-based tool facilitates the creation of complex, high-impact apps in significantly less
time than traditional programming environments. The MIT App Inventor project seeks to
democratize software development by empowering all people, especially young people, to move
from technology consumption to technology creation.
A small team of CSAIL staff and students, led by Professor Hal Abelson, forms the nucleus of an
international movement of inventors. In addition to leading educational outreach around MIT App
Inventor and conducting research on its impacts, this core team maintains the free online app
development environment that serves more than 6 million registered users.
Blocks-based coding programs inspire intellectual and creative empowerment. MIT App Inventor
goes beyond this to provide real empowerment for kids to make a difference -- a way to achieve
social impact of immeasurable value to their communities. In fact, App Inventors in school and
outside of traditional educational settings have come together and done just that:

33

S-ar putea să vă placă și