সোমবার, ২৭ ফেব্রুয়ারী, ২০১৭

ESP8266 ESP-01 Wifi Mini Development Board


Product Overview
Product Description:
ESP8266 is an inexpensive serial-to-wifi transceiver chip that can be used to connect any microcontroller with a serial port to a WiFi network. Because of its simplicity and low cost, it is getting popular among hobbyists for implementing it in Internet of Things (IoT) applications. ESP-01 module provides access to the power supply and I/O pins of ESP8266 through a 2x4 male header. But the pin arrangements are not user friendly. This “ESP8266 ESP-01 Wifi Mini Development Board”  has a 6 Pins L-Shape Male header for Programming that directly connects to FTDI USB to Serial Converter 3V3. Other 4 Pins are Yellow Male header for 3.3V, GND, GPIO2 and GPIO0. There’s also Flash and Reset Switch.   

Features:
·       Switch for Flash Mode
·       Reset Switch
·       Indication LED: GPIO0 (Green) & GPIO2 (Red) 
· Programming Header 6 Pin, directly connects to FTDI USB to Serial Converter 3V3
·       Output Header 4 Pin for 3.3V, GND, GPIO2 and GPIO0

Specifications:
·       Chip: ESP8266 ESP-01
·       Memory: 1MB Flash Memory
·       Interface: Serial Communication (RX, TX)
·       Baud Rate: 115200 (Default)
·       Board dimension: 44mm x 26mm
·       Working Voltage: 3.3V (DC)

Working Process:
·       “ESP8266 ESP-01 Wifi Mini Development Board” Connect with PC using by FTDI USB to Serial Converter 3V3
·       At first press the Flash button and Hold on, then press the Reset button.  (If green LED glow, now it is Programming Mode). 
·       Now upload your sketch file.
                                                        
Example Code:

#include <ESP8266WiFi.h>

const char* ssid = "Your Network ID";
const char* password = "Password";

int ledPin = 2; /* GPIO2 */
WiFiServer server(80);

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


  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
   
  /* Connect to WiFi network */
  Serial.println();
  Serial.println();
  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");
   
  /* Start the server */
  server.begin();
  Serial.println("Server started");

  // Print the IP address
  Serial.print("Use this URL to connect: ");
  Serial.print("http://");
  Serial.print(WiFi.localIP());
  Serial.println("/");
    }

void loop() {
  /* Check if a client has connected */
  WiFiClient client = server.available();
  if (!client) {
    return;
  }
   
  /* Wait until the client sends some data */
  Serial.println("new client");
  while(!client.available()){
    delay(1);
  }
   
  /* Read the first line of the request */
  String request = client.readStringUntil('\r');
  Serial.println(request);
  client.flush();
   
  /* Match the request */
  int value = HIGH;
  if (request.indexOf("/LED=ON") != -1) {
  digitalWrite(ledPin, LOW);
  value = LOW;
  }
  if (request.indexOf("/LED=OFF") != -1) {
  digitalWrite(ledPin, HIGH);
  value = HIGH;
  }

  /* Set ledPin according to the request     
   digitalWrite(ledPin, value); */
   

  /* Return the response */
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println(""); //  do not forget this one
  client.println("<!DOCTYPE HTML>");
  client.println("<html>");
   
  client.print("LED Pin Status: ");
   
  if(value == HIGH) {
    client.print("OFF");  
  } else {
    client.print("ON");
  }
  client.println("<br><br>");
  client.println("Click <a href=\"/LED=ON\">here</a> turn the LED on pin 2 ON<br>");
  client.println("Click <a href=\"/LED=OFF\">here</a> turn the LED on pin 2 OFF<br>");
  client.println("</html>");

  delay(1);
  Serial.println("Client disonnected");
  Serial.println("");
   }


Code Output:
 Fig-1: Serial Monitor Output
 Fig-2: First Load web page                  
Fig-3: Click on here LED ON


     নুর মোহাম্মদ
                   ইঞ্জিনিয়ার
     টেকশপ বাংলাদেশ                            

1 টি মন্তব্য:

  1. Dear Expert,

    I'm trying to powering up my ESP-01 (without development board) using FTDI 3.3V. But ESP gives garbage in serial output or it
    resets. But I can program easily.
    If I run with 5V using FTDI... it runs and I can program also. But ESP becomes hot.
    I tried also breadboard power (MB-102). But failed too with 3.3V or 5V.
    Can you pls help me?

    Best Regards.
    Banik
    01678102207

    উত্তরমুছুন