{"id":19038635,"url":"https://github.com/garyhtou/desk-lights","last_synced_at":"2026-03-02T05:33:00.208Z","repository":{"id":152165720,"uuid":"169930383","full_name":"garyhtou/Desk-Lights","owner":"garyhtou","description":"Wireless NeoPixel control via Firebase Realtime Database on ESP8266","archived":false,"fork":false,"pushed_at":"2020-12-20T10:51:02.000Z","size":7683,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T05:51:45.440Z","etag":null,"topics":["adafruit","adafruit-feather-huzzah-esp8266","arduino","esp8266","firebase","firebase-realtime-database","led","neopixel"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garyhtou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-10T00:56:03.000Z","updated_at":"2023-01-04T03:29:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"594410b5-018d-4edd-bbda-468236fc6cf1","html_url":"https://github.com/garyhtou/Desk-Lights","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/garyhtou/Desk-Lights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyhtou%2FDesk-Lights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyhtou%2FDesk-Lights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyhtou%2FDesk-Lights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyhtou%2FDesk-Lights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garyhtou","download_url":"https://codeload.github.com/garyhtou/Desk-Lights/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garyhtou%2FDesk-Lights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29993376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adafruit","adafruit-feather-huzzah-esp8266","arduino","esp8266","firebase","firebase-realtime-database","led","neopixel"],"created_at":"2024-11-08T22:04:23.425Z","updated_at":"2026-03-02T05:33:00.172Z","avatar_url":"https://github.com/garyhtou.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Desk Lights\n\nAn ESP8266 powered system connected to a Firebase Realtime Database to control a LED strip.\n\nThis README is more of a \"how it works\" and doesn't really serve as a great tutorial/guide.\n\nThis project started back in January 2019 with the goal of wirelessly controlling an individually addressable LED strip. After some faulty wiring that melted a breadboard and fried a test strip of LEDs... whoops!... I picked it back up in December 2020.\n\n_Check out the other repositoy for this project, [`garyhtou/Desk-Lights-Website`](https://github.com/garyhtou/Desk-Lights-Website), which expands upon this project by connecting a website to firebase; allowing anyone on the interset the control the color of the LEDs!_\n\n## Get Started\n\n- Wire up the system\n- Create a Firebase Project, create a Real-Time Database within the project, and grab your Database URL and auth token.\n- Replace the `WIFI_SSID`, `WIFI_PASSWORD`, `FIREBASE_HOST`, and `FIREBASE_AUTH` at the top of [`Desk_Lights.ino`](Desk_Lights/Desk_Lights.ino).\n- Download and install Arduino IDE\n- Install the CP2104 USB Driver ([more info here](https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/using-arduino-ide))\n- Set up your Adafruit Feather HUZZAH with ESP8266 as a board in Arduino IDE\n- Upload the updated code via the Arduino IDE\n- Enter some values on Firebase\n- Plug it in!\n\nView sections below for more information relating to these steps.\n\n## Parts\n\n| Product                                                          | Supplier/Link                                                                                                            |\n| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| Adafruit NeoPixel Digital RGBW LED Strip - White PCB 60 LED/m 1m | [Adafruit](https://www.adafruit.com/product/2842?length=1)                                                               |\n| Assembled Adafruit Feather HUZZAH with ESP8266 With Headers      | [Adafruit](https://www.adafruit.com/product/3046)                                                                        |\n| 74AHCT125 - Quad Level-Shifter (3V to 5V)                        | [Adafruit](https://www.adafruit.com/product/1787)                                                                        |\n| 1000µf 25V Capacitor (or any 1000 µF, 6.3V or higher)            | I think I bought them from [Amazon](https://www.amazon.com/McIgIcM-1000uf-capacitor-Aluminum-electrolytic/dp/B06WGPNM19) |\n| 470 Ohms Resistor (or any between 300 to 500 Ohm)                |                                                                                                                          |\n| Any breadboard and wires                                         |                                                                                                                          |\n| Soldering tool may be required                                   |                                                                                                                          |\n\n## Wiring\n\n- 5V to ESP8266 USB Pin\n- ESP8266 GND Pin to Ground\n- ESP8266 14 Pin to 74AHCT125 1A Pin\n- 74AHCT125 Vcc Pin to 5V\n- 74AHCT125 GND Pin to Ground\n- 74AHCT125 1OE Pin to Ground\n- NeoPixel 5V Pin/wire to 5V\n- NeoPixel GND Pin/wire to Ground\n- NeoPixel Din Pin/wire to 74AHCT125 1Y Pin\n- 1000uf 25V Capacitor across the incoming + and -\n\nBecause the ESP8266 runs on 3.3V logic, the data line from Pin 14 must be level-shifted to 5V in order for the NeoPixels to understand. The 74AHCT125 does this for us.\n\n| ![Wiring Full View.JPG](Wiring%20-%20Full%20View.JPG) | ![Wiring - Adafruit Feather Huzzah ESP8266 close up.JPG](Wiring%20-%20Adafruit%20Feather%20Huzzah%20ESP8266%20close%20up.JPG) | ![Wiring - Level-Shifter (3V to 5V) Adafruit 74AHCT125 close up](\u003cWiring%20-%20Level-Shifter%20(3V%20to%205V)%20Adafruit%2074AHCT125%20close%20up.JPG\u003e) |\n| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Full View                                             | Adafruit Feather Huzzah ESP8266 close up                                                                                      | Level-Shifter (3V to 5V) Adafruit 74AHCT125 close up                                                                                                    |\n\n## Program\n\nI originally tried connecting the ESP8266 via Socket.io to my existing server, however, I had an issue compiling with the [socket.io-client](https://github.com/timum-viw/socket.io-client) library. I gave up and decided to use Firebase ([Firebase-ESP8266](https://github.com/mobizt/Firebase-ESP8266)) to communicate with the ESP8266 in real-time.\n\n### Firebase Settings\n\nCreate a Realtime Database within a new Firebase Project. Because the program uses a service account to authenticate, we can set our Realtime Database's rules to Locked Mode. Once the project has been created, manually enter the following data:\n\n```JSON\nrgbw\n |-- r: 255\n |-- g: 0\n |-- b: 0\n |-- w: 0\n```\n\nThen, grab your database URL and update the `FIREBASE_HOST` value in [Desk_Lights.ino](Desk_Lights/Desk_Lights.ino).\nGo to your Firebase project's Users and Permissions settings **\u003e** Service accounts **\u003e** Database secrets, to grab your database's auth secret. Update the `FIREBASE_AUTH` in [Desk_Lights.ino](Desk_Lights/Desk_Lights.ino) with this value.\n\nAnd thats pretty much all we need to do with Firebase! If it works, the LEDs should turn red.\n\n### Wifi Settings\n\nThis is pretty self explanatory, update your `WIFI_SSID` and `WIFI_PASSWORD` in [Desk_Lights.ino](Desk_Lights/Desk_Lights.ino).\n\n### NeoPixel Settings\n\nIf you changed the pin connected to the data link of the NeoPixels, you will need to change the `pin` integer in [Desk_Lights.ino](Desk_Lights/Desk_Lights.ino). Similarly, if the number of LEDs on the strip of NeoPixels is not 60, that will need to be updated (`numLeds`).\n\n## Additional Resources\n\n- https://tttapa.github.io/ESP8266/Chap10%20-%20Simple%20Web%20Server.html\n- https://cdn-shop.adafruit.com/product-files/1787/1787AHC125.pdf\n- https://learn.adafruit.com/adafruit-feather-huzzah-esp8266/power-management\n- https://cdn-learn.adafruit.com/assets/assets/000/046/249/original/adafruit_products_Huzzah_ESP8266_Pinout_v1.2-1.png?1504885873\n- https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation\n- https://learn.adafruit.com/neopixels-on-raspberry-pi/raspberry-pi-wiring\n- https://adafruit.github.io/Adafruit_NeoPixel/html/class_adafruit___neo_pixel.html\n- https://medium.com/@vibrologic/serverless-iots-with-firebase-realtime-database-and-esp8266-e624304c3197\n- https://github.com/mobizt/Firebase-ESP8266\n\n---\n\nThere are so many ways to expand this project. For example:\n\n- Create a website with a color picker that updates the values in Firebase. Now anyone on the internet can change the colors of the LEDS! **Check out [`garyhtou/Desk-Lights-Website`](https://github.com/garyhtou/Desk-Lights-Website)**\n- Instead of updating the color of all the LEDs at once, you an trickle the new color down the line.\n- Implement an on/off switch (either physical or virtual). You could run a webserver on the ESP8266 with a website that allows anyone on the network to turn it on/off. Or, simpily store a boolean for on/off on Firebase.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaryhtou%2Fdesk-lights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaryhtou%2Fdesk-lights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaryhtou%2Fdesk-lights/lists"}