In this project we use ESP8266 in its NodeMCU form factor as a webserver and to create a webform to control the current position of the servo motor.
All the data of the webserver are saved on the SPIFFS memory of ESP8266.
What is SPIFFS?SPIFFS is the original filesystem and is ideal for space and RAM constrained applications that utilize many small files and care about static and dynamic wear levelling and don’t need true directory support. Filesystem overhead on the flash is minimal as well. On the NodeMCU we have 4MB of flash out of which we can the size of the SPIFFS filesystem. In this project all the webserver files including html, css, and javascript are saved on a folder named data which is the folder name required for uploading to ESP8266 with SPIFFS uploader.
I have a detailed tutorial about it in another project. Check it out.
Hardware Setup- Start by placing the NodeMCU on a breadboard.
- Place the servo motor and make the connections as shown.
- Connections.
3V3V ➡ VCC
GND ➡ GND
SIGNAL ➡ D2
Software Setup- Visit my GitHub page and download the necessary files.
- Download ESPAsyncWebServer library
- Download ESPAsyncTCP library
- Install libraries.
- Download ESP8266 Filesystem Uploader
- Install the libraries and Filesystem uploader as shown below.
- Compile the code and upload.
- Go to tools and use ESP8266 Sketch Data Upload tool to upload sketch data.
Changetheselinesofcodeasperyours:
const char *ssid = "REPLACE_WITH_YOUR_SSID";
const char *password = "REPLACE_WITH_YOUR_PASSWORD";
const uint8_t servoPin = D4;
GitHub Repository linkhttps://github.com/rahuladitya303/ESP8266_SERVO_CONTROLLER.git
For more details about how to install libraries and filesystem uploader checkout my other projecthttps://create.arduino.cc/projecthub/rahuladitya303/esp8266-weather-station-with-spiffs-c01037
Comments