Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,825 members, 7,820,902 topics. Date: Wednesday, 08 May 2024 at 01:29 AM

IoT (internet Of Things) With ESP8266 - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / IoT (internet Of Things) With ESP8266 (2046 Views)

Internet Of Things (iot) Transforming Mobile App Industry / New Things With Google / The Internet Of The Future (2) (3) (4)

(1) (Reply) (Go Down)

IoT (internet Of Things) With ESP8266 by princejude(m): 2:21pm On Oct 15, 2018
This tutorial is a step-by-step guide designed to help you get started with this amazing Wi-Fi module called ESP8266 and build projects that can be used to automate your home.

This tutorial covers:
• Technical specifications of the ESP8266
• Different ESP8266 modules
• How to install the Arduino IDE and how it works
• How to establish a serial communication with the ESP8266
• How to blink an LED with ESP8266
• How to interact with the ESP8266 GPIOs
• How to create a web server
• How to access your web server from anywhere in the world
• How to send emails with the ESP8266
• How to create an email notifier.
• And a lot more…

What is ESP8266?

The ESP8266 is a Wi-Fi module with an ARM processor that is great to extend the functionality of a microcontroller such as an Arduino.
It can communicate with your microcontroller via serial. This tutorial was designed to take the most of your ESP8266, so you
don’t even need an Arduino board. You just need an ESP and a few components!
So, what can you do with this low-cost module? You can create a web server, send HTTP requests, control outputs, read inputs and interrupts, send emails, post tweets, etc.

ESP8266 specifications

• 802.11 b/g/n protocol
• Wi-Fi Direct (P2P), soft-AP
• Integrated TCP/IP protocol stack
• Built-in low-power 32-bit CPU
• SDIO 2.0, SPI, UART

1 Like

Re: IoT (internet Of Things) With ESP8266 by Voiz234(m): 2:26pm On Oct 15, 2018
Will like to learn about this, any link or contact?
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:30pm On Oct 15, 2018
Voiz234:
Will like to learn about this, any link or contact?

You will learn a lot from this thread, just keep following the thread.
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:43pm On Oct 15, 2018
Different ESP8266 Modules

The ESP8266 comes in a wide variety of versions (as shown in the figure below). The ESP-12E or often called ESP-12E NodeMCU Kit is currently the most practical version and that’s the module we’ll be using most throughout this tutorial.

Re: IoT (internet Of Things) With ESP8266 by frankfrancis871: 3:00pm On Oct 15, 2018
Wow following, when I get a laptop I try it out! Nice one
so with this, I can host website as big as nairaland, facebook etc?
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 3:02pm On Oct 15, 2018
I highly recommend using the ESP8266-12E NodeMCU, the one that has built-in programmer. The built-in programmer makes it easy to prototype and upload your programs.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 3:11pm On Oct 15, 2018
ESP-12E NodeMCU Pinout
Throughout this tutorial, we’ll be using mainly the ESP8266-12E NodeMCU Kit. Here’s a quick overview of the ESP-12E NodeMCU Kit pinout:

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 3:14pm On Oct 15, 2018
ESP-01 Pinout
If your project requires very little pins to work with, you might also consider using the ESP-01. Here’s a quick overview of ESP-01 pinout:

Warning: before applying power to your module, please note that this module operates at 3.3V. If you plug it to 5V, it will fry pop corn for you.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 3:46pm On Oct 15, 2018
ESP8266 with Arduino IDE
In this section you’re going to download, install and prepare your Arduino IDE to work with the ESP8266. This means you can program your ESP using the friendly Arduino programming language.

What’s the Arduino IDE?
The Arduino IDE is an open-source software that makes it easy to write code and upload it to the Arduino board. This GitHub repository added support for the ESP board to integrate with the Arduino IDE. The Arduino IDE is a multiplatform software, which means that it runs on
Windows, Mac OS X or Linux (it was created in JAVA).

Requirements
You need to have JAVA installed in your computer. If you don’t have, go to this website: http://java.com/download, download and install the latest version.

Downloading Arduino IDE
To download the Arduino IDE, visit the following URL: https://www.arduino.cc/en/Main/Software.
Then, select your operating system and download the software (as shown below).

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 4:02pm On Oct 15, 2018
Installing Arduino IDE
Grab the folder you’ve just downloaded named “arduino-(...).zip” and unzip it. Run the highlighted file and follow the installation wizard that shows on your screen. Open the Arduino IDE application file (see figure below).
When the Arduino IDE first opens, this is what you should see:

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:54am On Oct 17, 2018
Installing ESP8266 Board
To install the ESP8266 board in your Arduino IDE, follow these next instructions:
1) Open the preferences window from the Arduino IDE. Go to File >
Preferences
2) Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json
into Additional Board Manager URLs field and press the “OK”
button

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:59am On Oct 17, 2018
3) Go to Tools > Board > Boards Manager…

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:04am On Oct 17, 2018
4) Scroll down, select the ESP8266 board menu and Install "esp8266 by ESP8266 Community"

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:06am On Oct 17, 2018
5) Open the Arduino Tools menu
6) Select Board > NodeMCU 1.0 (ESP-12E Module)

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:08am On Oct 17, 2018
7) Finally, re-open your Arduino IDE to ensure that it launches with the new boards installed
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:22am On Oct 20, 2018
Blinking LED with Arduino IDE
In this Unit you’re going to design a simple circuit to blink an LED with the ESP using Arduino IDE.
Why do we always blink an LED first? That’s a great question! If you can blink an LED you can pretty much say that you can turn any electronic device on or off. Whether is an LED, a lamp or your fan.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:27am On Oct 20, 2018
About GPIOs Assignment
Use the next table as a quick reference on how to assign the ESP8266 GPIOs in the Arduino code.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:31am On Oct 20, 2018
Important: in the next section called “Writing Your Arduino Sketch” when we
define:
pin = 0
we are referring to GPIO 0, and if we define:
pin = 5
we are referring to GPIO 5 which is connected to pin D1.

This is how this firmware is internally defined. You don’t need to worry about this, simply remember that 0 refers to GPIO 0 and 5 refers to GPIO 5
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:35am On Oct 20, 2018
Writing Your Arduino Sketch
The sketch for blinking an LED is very simple.
int pin = 5;

void setup() {
// initialize GPIO 5 as an output.
pinMode(pin, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(pin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(pin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:46am On Oct 20, 2018
Uploading Code to ESP8266
There are two different ways to upload code to your ESP8266. If you’re using an ESP-12E that has built-in programmer read Option A.
If you’re using the ESP-01, you need an FTDI programmer - read Option B.

Option A - Uploading code to ESP-12E
Upload code to your ESP-12E NodeMCU Kit is very simple, since it has builtin
programmer. You plug your board to your computer and you don’t need to make any additional connections.

Look at the Tools menu, select Board “NodeMCU 1.0 (ESP-12E Module)”

Re: IoT (internet Of Things) With ESP8266 by TechSpace: 2:10pm On Oct 20, 2018
Following.
Re: IoT (internet Of Things) With ESP8266 by airsaylongcon: 5:41pm On Oct 21, 2018
OP,
Please I'm looking for any USB wifi module built with Atheros chipset. Most of the ones in the market cannot run in AP mode on Linux kernel 4.x.

I have trawled the entire computer village with minimal success. Any pointers where else to try?
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:34pm On Oct 24, 2018
Option B - Uploading code to ESP-01
Uploading code to the ESP-01 requires establishing a serial communication between your ESP8266 and a FTDI Programmer.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 1:54pm On Oct 24, 2018
Important: most FTDI Programmers have a jumper to convert from 5V to 3.3V. Make sure your FTDI Programmer is set to 3.3V operation (as shown in the following figure).

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:01pm On Oct 24, 2018
Follow the circuit in the figure below to connect your ESP to your FTDI Programmer to establish a serial communication.

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 2:21pm On Oct 24, 2018
Here’s the connections:

RX -> TX
TX -> RX
CH_PD -> 3.3V
GPIO 0 -> GND
VCC -> 3.3V
GND -> GND

Note: the circuit above has GPIO 0 connected to GND, that’s because we want to upload code. When you upload a new sketch into your ESP it requires the ESP to flash a new firmware. In normal usage (if you’re not flashing your ESP with a new firmware) it would be connected to VCC.
If you have a brand new FTDI Programmer and you need to install the FTDI drivers on Windows PC, visit this website for the official drivers:
http://www.ftdichip.com/Drivers/VCP.htm
Re: IoT (internet Of Things) With ESP8266 by princejude(m): 12:03pm On Nov 16, 2018
We are rolling out state-of-the-art Embedded system designs Courses...

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 7:37am On Mar 06, 2019
If you're. following this thread, get ready more topics are coming.

1 Like

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 5:21pm On Mar 09, 2019
Example 1: Blink an LED
Circuit Connection
LED thru a 330 ohm resistor to Pin D1

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 5:26pm On Mar 09, 2019
The Sketch

Re: IoT (internet Of Things) With ESP8266 by princejude(m): 5:28pm On Mar 09, 2019
The Picture

(1) (Reply)

I Finally Got A Job. Haters Should Bury Their Heads In Shame. / Help,how Do I Send Data From An Msaccess Table To A Label In My Vb6 Appl / Download Creating Apps In Kivy by Dusty Philips for FREE

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 39
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.