2. First Step with IoT
Road to RIoT 2017 - Medan
Albert
Suwandhi
albert.suwandhi@gmail.com
3. About Me
• Working
at
Sinarmas
Oleochemical
• Lecturer
at
STMIK
IBBI
-‐
Medan
• S1
–
Electrical
and
Computer
Engineering
–
USU
• S2
–
InformaDon
Technology
–
IT
Infrastructure
Management
–
BINUS
• Hold
several
cerDficaDon
related
to
computer
networking
:
Cisco
CCNA
&
CCNP,
MTCNA
• Worked
with
Microchip
PIC
MCU,
Atmel
MCS51
and
Assembly
Language
(2003
–
2006)
4. Agenda
• IoT
IntroducDon
• IoT
Development
Enviroment
• ESP8266
and
Development
Board
• Blynk
IntroducDon
• IoT
Demo
5. Internet is in Everything!!
• Smartphones
• Children
• Animals
• TV
• Ovens
• Refrigerator
• etc
6. What is IoT (Internet of Things)
“The
Internet
of
Things
(IoT)
is
the
network
of
physical
objects
that
contain
embedded
technology
to
communicate
and
sense
or
interact
with
their
internal
states
or
the
external
environment”
Gartner
“The
Internet
of
things
(IoT)
is
the
inter-‐networking
of
physical
devices,
vehicles
(also
referred
to
as
"connected
devices"
and
"smart
devices"),
buildings,
and
other
items
embedded
with
electronics,
so^ware,
sensors,
actuators,
and
network
connecDvity
which
enable
these
objects
to
collect
and
exchange
data”
Wikipedia
16. How to get started?
Let's get started with a simple one
Make your Own! Solving your own problem!
17. ESP8266
• SoC/MCU
that
integrates
TCP/IP
Stack
and
WiFi
to
enable
it
to
connect
to
the
network
and
communicate
with
other
devices
• Made
by
Espressif
–
China
• Have
many
modules,
eq
:
ESP-‐01,
ESP-‐02,
ESP-‐12F,
ESP-‐WROOM2
• It
was
sold
as
a
serial-‐Wifi
adapter
for
other
microcontrollers,
however
it
is
more
powerful
as
the
ESP8266
integrates
a
32
bits
microcontroller.
• Feature
:
Microcontroller:
Tensilica
L106
(32
bits)
Clock
Frequency:
80
MHZ
WiFi:
802.11
b/g/n
Interfaces:
SPI,
I2C,
I2S,
UART,
PWM
GPIO:
17
pins
(12
mA
max
current)
ADC:
10
bits
OperaDng
voltage:
3.3
V
20. DEMO 0 – MQTT with ESP8266
• We
will
use
Makestro
Cloud
as
MQTT
Server
• Control
the
on
board
LED
using
Virtual
Buion
• Display
the
on
board
buion
status
to
Virtual
LED
23.
Introduction to Blynk
• Blynk
is
a
plajorm
with
IOS
and
Android
apps
to
control
Arduino,
Raspberry
Pi,
ESP8266,
etc
over
the
Internet.
• Digital
dashboard
where
you
can
build
a
graphic
interface
for
our
project
by
simply
dragging
and
dropping
widgets
24.
How it works?
• Blynk
App
-‐
Allow
you
to
create
interfaces
for
projects
using
various
widgets..
• Blynk
Server
-‐
Responsible
for
all
the
communicaDons
between
the
smartphone
and
hardware
• Blynk
Libraries
-‐
Enable
communicaDon
with
the
server
and
process
all
the
incoming
and
outcoming
commands
for
all
the
popular
hardware
plajorms
25. Prepare IDE
1. Download
and
Install
Arduino
IDE
:
hips://www.arduino.cc/en/Main/So^ware
2. Open
the
preferences
from
File
>
Preferences.
Enter
this
url
into
AddiDonal
Board
Manager
URLs:
hip://arduino.esp8266.com/stable/package_esp8266com_index.json
3. Open
Board
Manager
from
Tools
>
Board
>
Board
Manager.
Search
for
ESP8266
and
install
the
board
package:
esp8266
by
ESP8266
Community
4. Open
Library
Manager
from
Sketch
>
Include
Library
>
Manage
Libraries.
Search
for
Blynk
and
install
the
library:
Blynk
by
Volodymyr
Shymanskyy
5. Change
the
board
by
selecDng:
Tools
>
Board
>
ESPectro
Core
6. Choose
the
correct
COM
Port
:
Tools
>
Port
>
Your
COM
Port
Number
7. We
are
ready
to
go
27. Install Blynk Application
1. Download
and
Install
Blynk
ApplicaDon
form
Google
PlayStore
or
Apple
App
Store
2. Create
and
account
login
by
using
your
Facebook
Account
3. Create
and
new
project
and
give
it
a
name
4. Select
ESP8266
and
using
WiFI
as
communicaDon
media
5. Write
down
or
email
the
Auth
Token.
We
will
need
it
to
connect
to
Blynk
Server
*
We
can
also
build
our
own
Blynk
Server
28. Demo Simple IoT with Blynk
1. Control
on
board
LED/RGB
from
Blynk
2. Control
a
virtual
LED
in
Blynk
and
read
sensor
data
and
display
it
to
Blynk
3. Push
NoDficaDon
to
Blynk
and
tweet
sensor
reading
to
Twiier
29. Demo 1 – Send Data from App to Device
We
will
use
ESPectro
Core
:
• ZeRGBA
to
control
the
1st
NeoPixel
–
Virtual
Pin
1
• 3
Sliders
to
control
the
2nd
NeoPixel
–
Virtual
Pin
2,3
and
4
• Push
Buion
to
control
on
board
LED
–
GPIO
15
• Terminal
to
send
data
to
board
–
Terminal
Widget
31. Demo 2 – Send Data from Device to App
We
will
use
ESPectro
Core
:
• On
board
Buion
GPIO
0
will
control
Virtual
LED
–
V3
• Read
Analog
Voltage
on
Analog
input
and
send
it
to
App
–
V2
:
Push
• Send
UpDme
to
App
–
V1
:
Periodic
reading
frequency
2s
33. Demo 3 – Send Push Notification or Tweet
• It
is
quite
easy
to
implement
push
noDficaDon
and
post
a
tweet
with
Blynk
• We
will
improve
the
previous
example
to
send
Push
NoDficaDon
and
tweet
to
noDfy
user
if
sensor
reading
is
above
certain
value.
35. Suggestion
We
can
use
hips://github.com/tzapu/WiFiManager
to
input
SSID,
Password,
Blynk
Token,
MQTT
Server
and
etc
36. Conclusion
1. Learn
some
basics
electronics
2. Get
some
development
boards
(for
example
:
Espectro
Core
J)
and
some
sensors
3. Install
IDE
/
Development
Tools
4. Start
exploring
and
begin
with
simple
example
5. Looking
for
more
project
example
and
resources
from
Internet.
For
example
:
www.hackster.io
6. Solve
your
own
problem
with
IoT
J
J