Embedded web server with the ESP8266 Wi-Fi chip

Arduino3

Prototype 3: Arduino Pro Mini with ESP8266 Wi-Fi module as an embedded web server

The big news in embedded wireless is the ESP8266 Wi-Fi chip that costs less than $4. Prior to this, the only economical way to do a 2.4 GHz link was with something like the nRF24L01 chip from Nordic Semiconductor. The ESP8266 has an embedded 32-bit processor and is able to run small apps independently of an outboard microcontroller if you want. There’s an SDK available that you can set up a small web server within the ESP8266 chip. I hooked it up to an Arduino with the HTML content residing on an SD module.

<Click on any picture for detailed view==>

Arduino1

Prototype 1: hand-wired arduino with Ethernet module running web server

The webpage response is somewhat sluggish, but it’s not meant for streaming video or complex images. This would suit a dashboard, real-time charts, gauges and remote controls. The whole idea is to be able to control a device that’s interfaced to relays, sensors, motors, etc., accessed and controlled over the web.

With this Internet of Things concept, I found some very clever ideas. Since you’re already connected to the web, you can use the cloud as storage instead of storing things locally in flash or SD card. So if you’ve got a logging application for example, you can keep sending the data over the wireless interface into the cloud.

Arduino5

R&D Time: testing digital radio chips. nRF24L01 on the bottom left and ESP8266 on the right.

Likewise I have code snippets that update a remote SQL database from Arduino data. You can also access components, graphics, and APIs in real time from Google, etc., over the web. So a lot of this can be offloaded to a proper server. However, I think this defeats the purpose of having a standalone tiny web server. The whole idea is to have a standalone, embedded Web server for controlling a machine.

The first prototype shown is a hand wired Arduino that I made, and attached an Ethernet interface to it that has an HTTP library.

I was planning to store a small HTML webpage in the microcontroller flash. I looked and looked but can’t find a way to do it. They all say you need an SD module to store files. I guess the Arduino doesn’t support any form of file system internally.

The second prototype, which is the one that I’m running now, is a clone of a boarduino. I etched a bunch of these tiny boards to use as general-purpose controllers. The wood base has both an Ethernet module and the ESP8266 module in addition to an SD card module. You store the HTML files on the SD card. The web server runs on the microcontroller, attaches to a Wi-Fi AP, and serves incoming HTTP requests.

Arduino2

Prototype 2: Embedded web server with Wi-Fi, Ethernet and SD card interfaces

The Ethernet module isn’t hooked up yet. I’ve got as far as getting the Wi-Fi and SD card and web server components working. I’m still wrestling with parsing incoming requests.

The third prototype is an even smaller board consisting of an actual pro-mini Arduino and the ESP8266 module. There’s no SD card and I dropped the Ethernet module, so it’s fully wireless. I’m still stuck trying to figure out how to store the HTML page in local flash. There must be a way to do it within the microcontroller. Failing that, there’s a small EEPROM with an SPI interface and I have the libraries for that.

arduino10

Andromeda Strain rat laser: Stepper motor and driver board with ATMega328 controller. Enough room to mount a turntable with camera mount.

My next project is more robotics-oriented. For those of you who remember the original Andromeda Strain sci-fi movie, there was a scene where Dr. Mark Hall tries to escape up a ladder through the core of the complex. He kept getting shot by a laser on a robotic camera that would home in on anything that moved. Its purpose was to kill any stray, infected lab rats that may have escaped.

Not that I want to kill lab rats, but the idea is to have a webcam that can be panned left and right with an attached solid-state laser that follows it, may be triggered by noise or movement. I wish I still had my old Meccano set from days of old.

 

Leave a Reply

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