Skip to content

How to Control ESP-01 thru a Router

  • by
Picture of the popular ESP-01 ESP8266 module which can be controlled thru a wireless router and hence via the internet
ESP-01 ESP8266 Module

The ESP-01 ESP8266 module can be controlled directly, without using any WiFi router at all. To extend the range of the ESP-01 control, it can be connected and controlled thru a wireless router. In this way, the ESP-01 can even be accessed anywhere in world where there is an Internet connection.

How to Control ESP-01 ESP8266 Module Directly Using AP Mode

ESP-01 Station and Access Point Mode

The ESP-01 module or any ESP8266-based microcontroller may be operated in three different modes. It can be used as a station (STA mode), an access point (AP mode), or both (STA + AP mode). In order to control the ESP-01 module thru the router, we will put the ESP-01 in station mode (STA mode).

ESP-01 Programmer-Flasher

The ESP-01 module, being the smallest and the cheapest of all ESP8266 modules, does not have a built-in programmer or flasher. It can be flashed using a Programmer adapter, an Arduino board or may be wired with a USB to TTL Converter to make a programmer-flasher.

A picture of an ESP-01 programmer adapter used for programming the ESP-01 and control it thru the router
ESP-01 Programmer Adapter
An image of Arduino Uno development board that can be used to program or flash the ESP-01 in order to control the ESP-01 thru a router
Arduino Uno that can be used as ESP-01 Programmer/Flasher
Another device that can program or flash the ESP-01 to control it thru the router
USB to TTL Converter
Schematic diagram of an ESP-01 Programmer/Flasher using a USB to TTL converter
Schematic Diagram of an ESP-01 Programmer/Flasher Using a USB to TTL Converter

The preferred way of flashing an ESP-01 during testing and breadboarding is to use a USB to TTL converter with a two (2) pushbutton and three (3) 10K ohm resistors. In this way, additional devices can be added later on without changing the circuit. To learn how to use this programmer/flasher, please see: How to Program ESP-01 with Arduino IDE.

For example, using the schematic diagram above, you can add an LED on both the GPIO-0 and GPIO-2 without any changes. Just connect a current limiting resistor in series with the LED and connect it directly to GPIO-0 or GPIO-2 terminal and the ground.

How To Compute Resistor Value for LED

Also later on, when you progress to experimenting with LCD display (Liquid Crystal Display) and Real Time Clock (RTC) modules, both devices and can be connected directly to GPIO-0 and GPIO-2 acting as SDA and SCL terminals for I2C communication. No changes at all on the programmer/flasher circuitry!!!

The Programmer/Flasher with and RTC and LCD modules

Learn How to Create LCD Clocks with ESP-01 ESP8266 module
ESP-01 with RTC and LCD Display
ESP-01 NTP Clock with LCD Display

Arduino IDE Sketch to Control ESP-01 thru a Router

Version 1 – Does not Use ESP8266Webserver Library

Version 2 – Using ESP8266Webserver Library

Related Articles on How to Control ESP-01 thru a Router

Hardware

NodeMCU ESP32S Pin Configuration
NodeMCU V3 ESP8266 Pinout and Configuration
How to Save and Restore ESP8266 and ESP32 Firmware
How to Test NodeMCU V3 Using Esptool
How to Connect a DS3231 to NodeMCU V3

Software

How to Install Arduino IDE on Windows 10
How to Set up Arduino IDE for ESP8266 Programming
How to Install Esptool on Windows 10

References on How to Control ESP-01 thru a Router

ESP8266 on Wikipedia
ESP-01 AI–Thinker Website
ESP-01 ESP8266 Module Espressif Website
A Beginner’s Guide to the ESP8266

Leave a Reply

Your email address will not be published. Required fields are marked *