Voice Controlled Wooden Edison Lamp - (Video)

by Kybernetiks in Circuits > Remote Control

304 Views, 2 Favorites, 0 Comments

Voice Controlled Wooden Edison Lamp - (Video)

Image 6.png

Question Price $5. That is how much Wifi Relay SONOFF (From ITEAD company) cost, which is the heart of this device.

"I have not failed. I've just found 10'000 ways that won't work." - Thomas A. Edison This is incredible, but more recently, people in schools wrote with feathers. And today, there is a magic brick with a picture, that fits in your pocket and provides access to all information in the world. Voice control and, as people say, the threat to mankind from the side of artificial intelligence. More recently, these technologies seemed like inaccessible fantasies. But today, I will show you how absolutely each of you, with basic programming knowledge, can use voice control. So, let's begin.

Let's Begin

Image 7.png

WARNING!!! Work with high voltage! The author of the article is not responsible for your actions! Or any material, or physical damage that may be as result from the use of this instruction!

The General Scheme of the Device Working Algorithm.

Image 8.png

Since the phone, at a time, can only be connected to one Wi-Fi access point, we will work through the router. In general, it is convenient when all your smart devices are on the same network and you can easily manage them without having to constantly reconnect to each of them. The disadvantage of this, is that all your devices depend on the performance of a single router.

1 - We Need to Reprogram Sonoff Wi-fi Relays.

Image 9.png
Image 10.png
Image 11.png
Image 12.png

By default, it is configured to work through a Chinese server. In my understanding, it is not very convenient to turn off the light bulb in the toilet through the Chinese server. For this we need to disassemble it and solder the contacts for reprogramming.

Now we can connect cp2102 module from Silicon Labs to Sonoff wifi. I also used it to program the Arduino mini.

WARNING!!! When you do reprogramming, do not connect the module to the 220/110 volt network!


Reprogram the relay is very simple. This is a regular esp8266 module. I took the standard sketch of the access point server from Arduino IDE and changed it a bit.

Firmware for SONOFF Wifi relay. To use it through your home router you can find on attached file. And use it from Arduino IDE.

You will need to specify the name of your access point (router), password and static ip address for the light bulb. Relay control is at pin 12. Be sure to set the Flash size to 1 MB in the IDE.

Press and hold the push button on the Sonoff board. Insert the cp2102 converter USB in your computer (while holding the push button). After 2–3 seconds, release the push button. Now it’s in flash mode. Load the sketch file in Arduino IDE. Click on Verify / Compile. After you flash it, the module should restart and the green LED will start blinking

Let's Make Some Mobile App, to Control This Wifi Relay. (Android)

Image 13.png
Image 14.png
Image 15.png

I will provide only the main code fragments. Then you can use them to implement it on your applications. Google provides a very simple and convenient interface for voice recognition. Here is the code that allows you to convert a voice to text and save it to a regular string. (Android main code parts, to use voice recognition you can find on attached files.) Then you can compare it with the commands you want to implement.

Code to work with WiFi. Sending a message to the server. You also can find on attached files.

The code is very simple. "1" turn on the light bulb, "0" turn off the light bulb. You can add, at will, any checks, receive a response from the server etc.. I created two programs for myself. The first is the voice control widget, which is located on the desktop and it always at hand. The second is a simple application of turning on / off a light bulb by pressing a button.

And I Assume, That You Are Already Tired of Reading All Sorts of Texts and I Suggest You Watch the Video About How It Was.

DIY wooden Edison lamp with voice control