{"id":22403061,"url":"https://github.com/friedjof/glowlight","last_synced_at":"2026-03-06T02:14:19.832Z","repository":{"id":266390506,"uuid":"898224119","full_name":"Friedjof/GlowLight","owner":"Friedjof","description":"This repository contains the software, schematics, and 3D printing files for a bedside lamp with various modes controlled by a button. It includes details on hardware components, software installation using PlatformIO or Makefile, and 3D printing instructions","archived":false,"fork":false,"pushed_at":"2025-12-27T17:04:59.000Z","size":114325,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T14:14:45.431Z","etag":null,"topics":["3d-printing","bedside-light","esp32","esp32c3","platformio-arduino","stl-files","vl53l0x","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Friedjof.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":"2024-12-04T02:29:15.000Z","updated_at":"2025-12-28T12:34:57.000Z","dependencies_parsed_at":"2025-01-01T16:33:01.383Z","dependency_job_id":"00bfd02f-6210-49a6-a4a6-3e77bded4486","html_url":"https://github.com/Friedjof/GlowLight","commit_stats":null,"previous_names":["friedjof/glowlight"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Friedjof/GlowLight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Friedjof%2FGlowLight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Friedjof%2FGlowLight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Friedjof%2FGlowLight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Friedjof%2FGlowLight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Friedjof","download_url":"https://codeload.github.com/Friedjof/GlowLight/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Friedjof%2FGlowLight/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30159069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"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":["3d-printing","bedside-light","esp32","esp32c3","platformio-arduino","stl-files","vl53l0x","ws2812b"],"created_at":"2024-12-05T09:16:01.906Z","updated_at":"2026-03-06T02:14:19.808Z","avatar_url":"https://github.com/Friedjof.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GlowLight\n\nThis repository contains the software, schematics, and 3D printing files for a bedside lamp. The software includes various modes that can be toggled using a button. Additionally, there is a distance sensor (`VL53L0X`) that enables features such as adjusting the lamp's brightness with a hand gesture.\n\n\u003e This is a beta version of the project. The software is still under development, and the hardware may require some adjustments. I cannot guarantee that the project will work as expected and will not be responsible for any damage caused by the project.\n\n## Pictures\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/assembled_lampshade.jpg\" alt=\"Assembled Lampshade\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/demo/rainbow_mode.jpg\" alt=\"Rainbow Mode\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/usb-c_port.jpg\" alt=\"USB-C Port\"\u003e\u003c/td\u003e\n\u003c/table\u003e\n\n[-\u003e Rainbow Mode Demo Video](media/images/demo/dual_lamps_rainbow_mode.mp4)\n\n![Modes](media/images/diagrams/modes.png)\n\nThis is an overview of the different modes available in the lamp. The modes can be toggled using the button.\n\n## Hardware Components\n\n- DUBEUYEW ESP32-C3 Development Board Mini\n- VL53L0X distance sensor\n- Simple push button (hight ≥ 6mm)\n- WS2812B 5V LED strip (11 LEDs)\n- External 5V power supply\n- USB-C and some other necessary cables\n- 3x M3 threaded insert\n- 3x M3 screws\n\n### Main Components\n![Main Components](media/images/components/button_sensor_esp32c3_led_mini.png)\n\n### Tools and Materials\n\n- 3D printer + filament (white and a color of your choice)\n- Soldering iron + solder\n- 2x Heat shrink tube\n- Screwdriver\n\n### 3D Printing\n\n\u003e You can find the 3D models in the [`/printing`](/printing) folder. The models are designed to be 3D printed and assembled. The lamp consists of three parts: the base, the lampshade, and the lampshade holder.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/printing/3d_printed_parts.jpg\" alt=\"Printed Parts\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/assembled_lamp_base.jpg\" alt=\"Assembled Lamp Base\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/lamp_final_assembly.jpg\" alt=\"Final Assembly\"\u003e\u003c/td\u003e\n\u003c/table\u003e\n\n### Soldering\n\nThe components are connected to the ESP32C3 using the following diagram:\n\n![Soldering Diagram](media/images/components/soldering_diagram.png)\n\n\u003e The Button does not require a resistor, as the ESP32C3 has internal pull-up resistors.\n\nThis table also shows the connections:\n\n| Component | Pin | ESP32C3 Pin |\n| --------- | --- | ----------- |\n| Button    | 1   | GND         |\n|           | 2   | GPIO 4      |\n| VL53L0X   | VCC | 5V          |\n|           | GND | GND         |\n|           | SDA | GPIO 6      |\n|           | SCL | GPIO 7      |\n| WS2812B   | VCC | 5V          |\n|           | GND | GND         |\n|           | DI  | GPIO 3      |\n\n\u003e The `VL53L0X` is the distance sensor, the `WS2812B` is the LED strip, and the `Button` is the push button.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/button_sensor_esp32c3_led.jpg\" alt=\"Button, Sensor, ESP32C3, and LED\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/wiring_setup_lamp.jpg\" alt=\"Wiring Setup\"\u003e\u003c/td\u003e\n\u003c/table\u003e\n\n### Threaded Insert\n\nTo attach the lampshade to the base, a threaded insert is used. The insert is placed in the base, and the lampshade is screwed onto it.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/printing/thread_insertion_soldering.jpg\" alt=\"Thread Insertion Soldering\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/printing/lid_attachment_screw.jpg\" alt=\"Lid Attachment Screw\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"media/images/components/bottom_side.jpg\" alt=\"Bottom Side\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Software Installation\n\nThis is a PlatformIO project. To compile and flash the software to the ESP32C3, PlatformIO must be installed. Once installed, you can open the project in PlatformIO and flash the software onto the ESP32C3.\n\nAlternatively, a `Makefile` is included, allowing you to flash the software via the command line. For this, PlatformIO must be installed, and the `PLATFORMIO` environment variable should point to the PlatformIO executable.\n\nIf you're familiar with Nix-shell, you can use the [`shell.nix`](/shell.nix) file to set up the environment for PlatformIO.\n\n### PlatformIO Commands\n\n- `pio run`: Compiles the software\n- `pio run --target upload`: Flashes the software to the ESP32C3\n- `pio run --target clean`: Removes compiled files\n- `pio device monitor`: Opens a terminal to view the ESP32C3 output\n\n### Makefile Commands\n\n- `make`: Compiles the software\n- `make upload`: Flashes the software to the ESP32C3\n- `make clean`: Removes compiled files\n- `make monitor`: Opens a terminal to view the ESP32C3 output\n- `make flash`: Flashes the software and opens the monitor\n- `make start`: Cleans, compiles, flashes the software, and opens the monitor\n\n### Libraries Used\n\n- [`ArrayList`](https://registry.platformio.org/libraries/braydenanderson2014/ArrayList) for dynamic arrays\n- [`Button2`](https://registry.platformio.org/libraries/lennarthennigs/Button2) for button input handling\n- [`Adafruit_VL53L0X`](https://github.com/adafruit/Adafruit_VL53L0X) for the distance sensor\n- [`FastLED`](https://registry.platformio.org/libraries/fastled/FastLED) for LED control\n\nFor more details on the libraries, refer to the [`platformio.ini`](/platformio.ini) file.\n\n## Development\n\nThe software is written in C++ and is structured as a typical PlatformIO project. The main file is [`src/main.cpp`](/src/main.cpp), which contains the setup and loop functions. The different modes, services and the controller are implemented in separate files in the [`/lib`](/lib) folder.\n\n### Classes\n\n![Classes](media/images/diagrams/classes.png)\n\n### Modes\n\nEvery Mode is a class that inherits from the `AbstractMode` class. The abstract class already implements the basic functions that every mode should have. In every mode, the following functions must be implemented: `setup`, `customFirst`, `customLoop`, `last`, and `customClick`.\n\n- `setup`: This function is called once when the mode is added to the controller when the lamp is turned on.\n- `customFirst`: This function is called once when the mode is newly selected.\n- `customLoop`: This function is called every loop iteration.\n- `last`: This function is called once when the mode is removed from the controller.\n- `customClick`: This function is called when a double click is detected from the button.\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0. For more information, see the [`LICENSE`](/LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedjof%2Fglowlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriedjof%2Fglowlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriedjof%2Fglowlight/lists"}