44
LTKA Labs ESP8266 Basics Eueung Mulyana http://eueung.github.io/ET3010/esp8266 ET-3010 | Attribution-ShareAlike CC BY-SA 1 / 44

Esp8266 basics

Embed Size (px)

Citation preview

Page 1: Esp8266 basics

LTKA Labs

ESP8266 BasicsEueung Mulyana

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

1 / 44

Page 2: Esp8266 basics

Outline

Short Intro

ESP-01

Blynk

2 / 44

Page 3: Esp8266 basics

Short Intro

3 / 44

Page 4: Esp8266 basics

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

Page 5: Esp8266 basics

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

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

5 / 44

Page 6: Esp8266 basics

6 / 44

Enter

ESP8266Small Powerful Cheap

Page 7: Esp8266 basics

7 / 44

Page 8: Esp8266 basics

8 / 44

Arduino and WiFi

Official Arduino WiFi ShieldEUR 69 + VAT

Sparkfun CC3000 ShieldUSD 40

Adafruit CC3000 ModuleUSD 35

Page 9: Esp8266 basics

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

Page 10: Esp8266 basics

10 / 44

ESP8266 Series

ESP-xx

Page 11: Esp8266 basics

11 / 44

Pinout

ESP-01

Page 12: Esp8266 basics

12 / 44

Pinout

ESP-12

Page 13: Esp8266 basics

13 / 44

ESP-01

ESP-12F + Breakout

IDR 50k & IDR 90k

Page 14: Esp8266 basics

14 / 44

Three Alternatives..

Page 15: Esp8266 basics

15 / 44

Actually More ...

Dev BoardsAdafruit HuzzahSparkfun MOD-WIFI-ESP8266-DEVNodeMCU v1

Around USD 10 or less

Page 16: Esp8266 basics

16 / 44

Page 17: Esp8266 basics

17 / 44

Page 18: Esp8266 basics

ESP-01

18 / 44

Page 19: Esp8266 basics

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

Page 20: Esp8266 basics

20 / 44

WiringExampleNormal Operation

Page 21: Esp8266 basics

21 / 44

WiringExampleFlash / Program

Page 22: Esp8266 basics

22 / 44

WiringExamplePullup Resistors

Page 23: Esp8266 basics

23 / 44

WiringExampleDecouplingCapacitors

Page 24: Esp8266 basics

24 / 44

WiringExampleBypass Capacitors

Page 25: Esp8266 basics

Let's Start ...

25 / 44

Page 26: Esp8266 basics

26 / 44

Page 27: Esp8266 basics

27 / 44

Page 28: Esp8266 basics

28 / 44

Page 29: Esp8266 basics

 

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

Page 30: Esp8266 basics

Blynk

30 / 44

Page 31: Esp8266 basics

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.

Page 32: Esp8266 basics

32 / 44

Download App

Create Account

Page 33: Esp8266 basics

33 / 44

Create New Project

Remember / Email AuthToken

Page 34: Esp8266 basics

34 / 44

Add (Widget Box)

Select Button

Page 35: Esp8266 basics

35 / 44

Edit TitleSelect Output Pin(D13)Mode (Switch)

Page 36: Esp8266 basics

36 / 44

Switch TX - RX Wire

Remove RST - GND Wire

LED on Pin 13 (Betterwith Current LimitingResistor)

Page 37: Esp8266 basics

37 / 44

Page 38: Esp8266 basics

38 / 44

Download BlynkLibrary

Then Install :

Blynk BlynkESP8266_HardSer

Page 39: Esp8266 basics

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

Page 40: Esp8266 basics

Blynk App

Go to Dashboard Play

Push the Button

40 / 44

Page 41: Esp8266 basics

41 / 44

Page 42: Esp8266 basics

Refs

42 / 44

Page 43: Esp8266 basics

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

Page 44: Esp8266 basics

ENDEueung Mulyana

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

44 / 44