Hello everyone, in this post I will show, how I hacked my old star wars lamp, including wifi support, using an esp8266 and voice control using Python + Google Speech API.
The code used in this project can be found in https://github.com/danilo94/IotLamp
1 - Understanding the Hardware
Firstly to hack the lamp, I need to understand how the hardware of the project works, so disassembling I found this PCB:
The PCB is composed by a simple line of RGB leds, and a microcontroller ( probably an Attiny85 ) responsible for control the brightness of each color, using a PWM signal. So, testing the pins, i found the color channels, next when old microcontroller stay in pcb as shown in figure.
2 - Hacking RGB signals, using an Arduino
So, to test the signals, I soldered the wires in each color channel and connected it to an old Arduino nano, to test the color transition.
3 - Adding ESP8266 to the project
So, after the test of RGB channels using the Arduino, I connected the wires to an esp8266 to use them as main controller.
4 - Using Python + Google Speech API to add voice commands
To add voice control to this project, I created a python script to listen to@@ my voice and using the Google Speech API, the script detect the following words:
- Luke Skywalker: Change color of the light to blue.
- Mestre Yoda ( Master's Yoda ): Change color of the light to green.
- Darth Vader: Change color of the light to red.
- Desligar ( Turn off ): Turn off the lamp.
5 - Youtube Video ( i will add subititles as soon as possible )
Top Comments