WiFi Light Switch

Technologies Used

Project worked on Summer 2015

At age 17

Took about 1 day to build.

Description

A microcontroller that controls a lamp.


Why I Built It

I built this project as my personal project for the 2015 4H fair. I had been researching ways to network a microcontroller and was excited to build a project involving that. At the time I was already very busy with other projects so I decided to build something quite simple as a sort of proof of concept.


Technical Details

For this project I used Adafruit's HUZZAH microcontroller which is a breakout of the ESP8266 chip. I connected the HUZZAH to a relay which it could use to switch the lamp on and off. I also connected it to a micro USB break out so I could power it with a phone charger. The I programmed the microcontroller in C++ to act as a server that would serve a web page with two buttons, an ON button and an OFF button. Clicking the ON button causes the browser to navigate to the /on page of the web site, which would cause the HUZZAH microcontroller to turn the relay and therefore the lamp on . Clicking the OFF button causes the browser to navigate to the /off page of the web site, which would cause the HUZZAH microcontroller to turn the relay and therefore the lamp off.


What I Learned

  • I learned how to make an HUZZAH microcontroller act as a web server


The Project's Story

For a few months prior I had been looking into various ways to network a microcontroller. When Adafruit released the HUZZAH, a WiFi capable microcontroller for $10, I knew I had to get one. It arrived on a day my friend Feo was over, so he and I worked on the project together. I had the rest of the hardware laying around and I was able to write the code in about 30 minutes. The documentation on Adafruit's site was pretty good so writing it didn't take too long.