ESP8266 based IoT project
Swift Lua
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

WiFi enabled desk lamp

awesome gif incoming

1. Overview

Over the last year I spent some time with the 3$ WiFi Module called ESP8266. One of them is my WiFi enabled retro desktop lamp.

2. Hardware compoments

Item Specification Price
ESP8266 I used the simple ESP-01 version with two GPIO pins. 3€
Cheap USB Charger To get 5V for the Relay Board and the ESP I used a fairly cheap USB Charger 5€
Relay Board To control the bulb itself I used an inexpensive 5 Relay Board from eBay. 2€
Small parts NPN transistor, breadboard, some resistors and one LD1117 3.3V Voltage Regulator. 3€

3. Programming the ESP8266

I flashed the ESP8266 with the NodeMCU firmware in order to create small .lua scripts for the device. After connecting to the local network the ESP8266 is starting a small HTTP server with the following routes:

  • / renders a small, responsive webpage with two buttons

  • /TURNOFF switches the relay and redirect to /
  • /TURNON switches the relay and redirect to /
  • /TOGGLE toggles current state and redirect to /

4. iOS App

Cause the webpage often loads to slow on my old iPhone 4s I built a really simple iOS App for controlling the ESP8266:

5. Images