PROJECTS ArduinoGravityESP8266 WiFi Controlled Desk Lamp
DFRobot
Jul 15 2019 261972
A WiFi controlled desk light, essential for every maker and a great way to get into coding.

Things used in this project
Hardware components
Espressif Wemos D1 mini ×1
2m WS2812B LED Strip IP30 (choose IP30, any other rating will not fit!) ×1
SparkFun Logic Level Converter - Bi-Directional (optional, required if the LEDs 'glitch') ×1
3 pin wire ×1
12x M3 * 8mm bolts ×1
M3 Nuts ×1
Female Power Jack ×1
Software apps and online services
ESP8266 - FastLED - Desk Light
Hand tools and fabrication machines
3D Printer (generic)
Soldering iron (generic)
White PLA
Black PLA
Story
Summary
A WiFi controlled desk light, essential for every 3D printing enthusiast and a great way to get into coding.
mind the versions of the libraries used
Step Eight: Connect to the web interface
Type the IP address of the Wemos D1 mini into any web browser on any mobile device and have fun! The IP can be found by connecting with the serial monitor or by looking at your routers client list.

Troubleshooting
Issues while compiling
- Compiling shows typedef bool error: You might have esp8266 2.5.x installed in combination with an old version of fastled, install esp8266 2.4.2 or upgrade FastLED to 3.2.9.
- Compiling shows tons of errors: You might have FastLED 3.2.7 installed, install 3.2.6 or update to 3.2.9.
- Sketch Data Upload does not work: Try to install Arduino IDE 1.8.7 or 1.8.8Don't install hourly or beta builds of the Arduino IDE.
- The Arduino IDE doesn't show the other files and says that files weren't found: The Arduino IDE requires that the filename of the.ino file has the same name as the folder it is in, if the names do not match, then the.ino file will be moved into a new folder, to fix it move the file up to the other files and make sure the folder name is the same as the one of the file.
- Secrets.h file not found: Create the Secrets.h file according to the instructions.
Issues while uploading
- The Arduino doesn't boot when the LEDs are attached: The LEDs might be wired in the wrong direction, the arrow must point away from the ESP8266.
- The Sketch-Data-Upload outputs "esptool.exe not found:" Check if you are using Arduino IDE version 1.8.7 or 1.8.8, newer version might throw this error.
Issues with the Webinterface
- The website just shows "not found :/"Check if you have uploaded the Sketch-Data.
- Check if the Sketch-Data-Upload was successful.
- The website doesn't load Check if you have entered the correct IP address. You have to be in the same network as the device.
Issues with the LEDs
- The LEDs flicker a lot You might have bad soldering spots.Try to use a logic level shifter to shift the supplied data signal to 5V.
- Not all of my LEDs turn on Check if you have correct values for LINE_COUNT and LEDS_PER_LINE. Check the wiring for errors.
- My LEDs just light up white You might have FastLED 3.2.8 installed, install 3.2.6 or update to 3.2.9.
FAQ
- Can I connect to the ESP8266 from outside of my local network? Yes, you can do this by creating a port forwarding rule on your router
- Can I use the NodeMCU for this project? Yes, but it is way harder to position it into the base of the lamp
- Can I use other LED-Strip types for this project? Yes, any FastLED compatible LED-Strip can be usedJust change the LED_TYPE
Some Strips require changes to the FastLED.addLeds(...) lineA list of all compatible LED-Strips can be found here.
- What power supply should I choose? 100x WS2812 LEDs draw around 3A, I would recommend 5V 3A for 60LEDs/m.
Custom parts and enclosures
3D Files (STL)
Make sure you print the diffuser in white with 100% infill!
Schematics
Schematic without the Logic Level Shifter

Schematic with the Logic Level Converter (used when the LEDs 'glitch')

Code
ESP8266 FastLED desk light
The software runs on the ESP8266. The web app is stored in SPIFFS (on-board flash memory). I've forked jasoncoon's esp8266 fastled webserver and added some extra functionality, made a proper config area and created custom patterns for the lamp. The software and detailed setup instructions can be found on GitHub. For beginners I would recommend watching this setup tutorial.
Latest commit to the master branch on 6-20-2019 Download as Zip