Esp8266 basics

Post on 08-Jan-2017

164 views 14 download

transcript

LTKA Labs

ESP8266 BasicsEueung Mulyana

http://eueung.github.io/ET3010/esp8266ET-3010 | Attribution-ShareAlike CC BY-SA

1 / 44

Outline

Short Intro

ESP-01

Blynk

2 / 44

Short Intro

3 / 44

Previously ... 

13 12 11 10

9 8 7 6 5 4 3 2

L

5V A0

ANALOG IN

ARE

F

1

GND

TXRX

RESET

3V3

A1

A2

A3

A4

A5

VIN

GND

GND

DIGITAL (PWM= )

Arduino TM

IOREF

ICSP

ICSP2

ON

POWER

01TX

0

RX0RESET

13 12 11 ETH 9 8 7 6 5

SDCS

3 2 01TX RXARE

F

GND

5V A0

ANALOG IN

TX

RX

RESET

3V3

A1

A2

A3

A4

A5

VIN

GND

GND

DIGITAL (PWM SPI )

SCL SDA

<

IOREF

ICSP

CS

< <

To Get Network Access: UNO + Ethernet Shield

4 / 44

Sometimes... network wires & switch portsare not available ..

In some conditions, they are not an option at all!

5 / 44

6 / 44

Enter

ESP8266Small Powerful Cheap

7 / 44

8 / 44

Arduino and WiFi

Official Arduino WiFi ShieldEUR 69 + VAT

Sparkfun CC3000 ShieldUSD 40

Adafruit CC3000 ModuleUSD 35

ESP8266Developed by Espressif SystemLow CostPart Number is ESP8266EX20+ M Chip Sold5000 Active Developers

3.3V - 215mA (measurement: peak ~430 mA)

CPU: 32-bit, 80MHz (or 160 MHz), TensilicaXtensa Core

Wi-Fi 802.11b/g/n (Station or AP), WEP/WPA/WPA2Timers, Deep Sleep ModeI/CRAM 32-64KB, DRAM 80-96KBExternal QPI Flash (200KB SDK, prev. 512 KB / 4Mbit, newmin. 1 MB/8Mbit)GPIO (2-16)SPI, I2C, I2S, UART10-Bit ADC

9 / 44

10 / 44

ESP8266 Series

ESP-xx

11 / 44

Pinout

ESP-01

12 / 44

Pinout

ESP-12

13 / 44

ESP-01

ESP-12F + Breakout

IDR 50k & IDR 90k

14 / 44

Three Alternatives..

15 / 44

Actually More ...

Dev BoardsAdafruit HuzzahSparkfun MOD-WIFI-ESP8266-DEVNodeMCU v1

Around USD 10 or less

16 / 44

17 / 44

ESP-01

18 / 44

19 / 44

ESP-012x4 DIL HeaderIntegrated AntennaIntegrated LED (VCC, TXD)1MB/8Mbit Flash (2015, Black)

OperatingVCC: 3.3V (av. active 200mA, peak see prev.)IO & UART are not 5V TolerantCH_PD must be Pulled High

20 / 44

WiringExampleNormal Operation

21 / 44

WiringExampleFlash / Program

22 / 44

WiringExamplePullup Resistors

23 / 44

WiringExampleDecouplingCapacitors

24 / 44

WiringExampleBypass Capacitors

Let's Start ...

25 / 44

26 / 44

27 / 44

28 / 44

 

Serial Monitor: AT | AT+GMR | AT+CWLAP29 / 44

Blynk

30 / 44

31 / 44

Blynk is a Platform with iOS and Android appsto control Arduino, Raspberry Pi and the likesover the Internet.

It's a digital dashboard where you can build agraphic interface for your project by simplydragging and dropping widgets.

Blynk is not tied to some specific board orshield. Instead, it's supporting hardware ofyour choice. Whether your Arduino orRaspberry Pi is linked to the Internet over Wi-Fi, Ethernet or this new ESP8266 chip, Blynkwill get you online and ready for the InternetOf Your Things.

32 / 44

Download App

Create Account

33 / 44

Create New Project

Remember / Email AuthToken

34 / 44

Add (Widget Box)

Select Button

35 / 44

Edit TitleSelect Output Pin(D13)Mode (Switch)

36 / 44

Switch TX - RX Wire

Remove RST - GND Wire

LED on Pin 13 (Betterwith Current LimitingResistor)

37 / 44

38 / 44

Download BlynkLibrary

Then Install :

Blynk BlynkESP8266_HardSer

Write Some Codes

Then Upload

Don't forget to temporarily release the RXpin!

#define BLYNK_PRINT Serial

#include <ESP8266_HardSer.h>#include <BlynkSimpleShieldEsp8266_HardSer.h>

#define EspSerial SerialESP8266 wifi(EspSerial);

char auth[] = "701f5e2263494783bb7ee9a36fc12345";

void setup(){ Serial.begin(115200); delay(10);

EspSerial.begin(115200); delay(10);

Blynk.begin(auth, wifi, "lk8fm", "0123456789");}

void loop(){ Blynk.run();}

39 / 44

Blynk App

Go to Dashboard Play

Push the Button

40 / 44

41 / 44

Refs

42 / 44

Refs1. Zhu Baoshi - Build WiFi Gadgets Using ESP8266, GeekCamp.SG 20152. Tom Tobback, Cassiopeia - ESP8266+Arduino, ESP8266+Arduino workshop

20153. Burak Aydin - Hack The ESP82664. Pighixxx - Boards - Pinout5. Tuanpmt/Espduino - ESP8266 Network Client for Arduino6. Internet of Home Things - 4 Ways to Eliminate ESP8266 Resets7. Update the Firmware in Your ESP8266 Wi-Fi Module8. ESP8266 Support WIKI - Getting-Started-with-the-ESP82669. sleemanj/ESP8266_Simple - A simple Arduino library to perform HTTP

operations on the ESP8266 Wifi Device10. DIY ESP8266 ESP-01 Programing / Test board11. Blynk

43 / 44

ENDEueung Mulyana

http://eueung.github.io/ET3010/esp8266ET-3010 | Attribution-ShareAlike CC BY-SA

44 / 44