„Alexa turn on desktop lamp”
In this article I will show you details on how I build a Alexa controlled desk lamp for my maker space. Currently I’m able to control main office lights, desk lamp, second desk lamp and ambiental light with voice commands given to Alexa which is preety handy when your hands are occupied
- NodeMCU board
- Arduino Micro/Arduino Pro Mini
- Two 2 Channel Relay Module
- Neopixel strip
- 4pcs 30×40 12V LEDs
- 40×40 aluminium profile
- 3D printed parts
- Small 12V 3A power supply
- 1pcs F12N10L mosfet
- 5v power supply
I desingn this lamp having in mind to be able to put it where I like and to not be in my way. By fixing a 40×40 bar betwen two walls I say I managed to do just that. Also in near futture I plan to fix on the slider a GoPro to have a on top camera for next videos. If you like my design or part of it you can find all files on my thingverse page.
Electric schematic is preety simple. To make it you will need a pref board and some wires for connections. Firs we will assamble everything on the table and after put the complete device inside the 3d printed case.
Probably you are wondering why I did not connect the neopixel strip directly to the ESP8266. Well initially that was my intention, but because I was not able to get stable results with the neopixels connected to my NodeMCU I decided to use a bridge in between made from a spare Arduino micro.
As you can see from the below image I try to keep a low number of wires and also assure proper venting for the device. You will need to pay high attention for the connections with the 220V or 110V. Here I’m speaking about the wires that are going to from the main plug to the 12V power supply and from the main to the relay board and after to the neon lights. Is very important to solder those wires after stripping. Loose stranded wires can be hazardous and can cause a lot of stuff (fire, electric shock, burns …) that probably you will like to avoid.
Code used for this project is on my github page. As stated before project is split in two due to the issue related to Neopixels. I’m using also blynk for non verbal control. For communicating with Alexa I was using WemoSwitch library which works great but I found several times lights on after leaving my office. I don’t know if is a bug in Alexa app from andoid or a bug in the library. Then I try using also fauxmoESP but with no success. After readin a little on the issue list if found here the setting that was needed on ArduinoIDE side to make it work. Since then I did not found any lights abnormaly switched on, so issue seem to be solved.
For blynk I’m using below layout. If you want also to use blynk as a remote control for your desk lamp make the same design like me. After don’t forget to generate from blynk a token and update the esp8266 code with it.