Wifi Alarm Sunrise Simulator

By using an mbed microcontroller, ESP8266 WiFi module, and power driver circuit, It is possible to hack an IKEA LED lamp to create an alarm clock to simulate the sunrise. The WiFi module is used to update the real time clock of the mbed through NTP, and host a simple web server that makes configuring the alarm time dynamic through the browser. The mbed then periodically checks the time to see if the "sunrise" is ready to start, resetting each day.

A top down view of the hardware and LED lamp

The program can be debugged through the USB serial output.

The mbed goes through a lengthy setup process as it manually sends commands and functions to execute on the wifi module. It runs a test brightening of the light. Once the configuration and setup has finished, the mbed flashes LED1 every time the interrupt executes (every 60s). By going to the IP address of the wifi module in a web browser, the alarm configuration can be easily changed.

Note: the configuration will not update on the page until you refresh the page after it is loaded from the submit button (this is due to the communication delay between the module and the mbed).

Parts

  • mbed NXP LPC1768
  • ESP8266 WiFi module
  • 15k Ohm Resistor ( in the picture above to acheive 15k: (10k||10K)+10K )
  • NPN Expitaxial Darlington Transistor (TIP120)
  • IKEA 12V 1.1W LED Lamp
  • External Power Supply (5V 2A barrel jack)

Connections

The mbed communicates to the WiFi module by a serial connection. The driver circuit is connected to a PWM capable pin on the mbed.

mbedWiFiDriver
GNDGNDGND
p21Resistor to transistor base
p26RST
p27Tx
p28Rx

The driver circuit diagram for powering the light, where the power source is from the original light power brick. /media/uploads/ecarrick/light_driver_USJLkOm.png

Demonstration Video

Program Code


Please log in to post comments.