Skip to content

11. Embedded Networking

I decided to continue working with my MPU 6050 gyroscope as seen in my Input Week to try and receive the data from any browser using a webserver on the Fab Labs Wifi.

Group Work

PCB Board

I decided to keep working with my original board I milled but this time I needed to change the code greatly to create a UI where I could view my sensor data. Therefore I made almost no changes to my original board except to attach an antenna to the ESP32-C3 Xiao for a better connection to the WiFi.

How a Webserver Works

A web server: - Listens for HTTP requests - Responds with data: HTML, sensor readings ect. Specifically with the ESP32-C3 - The ESP becomes the website host. - It is accessible it by typing its IP address into any device.

How to Create

Wifi

  • In the code add: “WiFi.begin(SSID, PASSWORD);”
  • This way the ESP gets an IP address.
  • In charlotte we have to use EngineeringStudent because our normal Wifi has gateways that interfere with the ESP’s connection to the wifi

Start Webserver

  • Create a server name like: “WebServer server(80);”
  • What that means is for the ESP port (or doorway) 80 default port for HTTP or web pages

What the Heck is Even Happening?

When the ESP32-C3 connects to Wi-Fi, the router assigns it an IP address that makes it viewable to other devices on the network. The ESP then acts as a web server, listening on port 80 for HTTP requests and sending back HTML that are the live sensor values. This means the controller is collecting the movement data from the MPU6050 and hosting the website that displays it. I learned how to do this by starting with basic ESP32 networking examples(they come with some libraries on Arduino Uno), then modifying them step by step until I could integrate my own sensor data.

Code

For my code I needed to specify my networks name or SSID and my networks password in order to communicate with other devices on the network. So when ever the code is uploaded an IP address is generated in the serial monitor. If any browser goes to this address on the same network then it will show the values being registered on the website. Click here for the code.

Below is the Serial monitor of the IP address given after uploading the code

Below is the UI for my WebSever where it displays my accelerometer data and my gyroscope data.

Here is a video where it show hows the movement affects the values on the webserver in real time on a device it is only connected through by the internet.

Reflection

This week I learned how to connect my MPU6050 sensor to a webserver using the ESP32-C3 Xiao. I was able to display live accelerometer and gyroscope data on any browser connected to the same Wi-Fi network. Adding an antenna improved the ESP32’s connection and made the data transmission more stable. Overall, this project showed me how powerful embedded networking can be for making sensor data easily accessible.


Last update: September 16, 2025