Loading repository data…
Loading repository data…
Friedjof / repository
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
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A beautiful, smart bedside lamp with ESP-NOW wireless communication, gesture controls, and multiple lighting modes. Built on ESP32-C3 with 3D-printed components and WS2812B LED strips.
Note: Development modes are available in the codebase but commented out in
main.cpp. Uncomment to enable additional lighting effects.
This is an overview of the different modes available in the lamp. The modes can be toggled using the button.
GlowLight uses ESP-NOW for ultra-fast, low-latency wireless communication between lamps. ESP-NOW provides direct device-to-device communication without requiring a WiFi router, enabling instant synchronization across multiple lamps.
You can configure the WiFi channel in include/GlowConfig.h:
#define ESPNOW_CHANNEL 1 // WiFi channel (1-13), configurable
Note: All lamps must be on the same WiFi channel to communicate. The default channel 1 works well in most environments.
For technical details, see the CommunicationService README.
You can find the 3D models in the
/printingfolder. The models are designed to be 3D printed and assembled. The lamp consists of three parts: the base, the lampshade, and the lampshade holder.
The components are connected to the ESP32C3 using the following diagram:
The Button does not require a resistor, as the ESP32C3 has internal pull-up resistors.
This table also shows the connections:
| Component | Pin | ESP32C3 Pin |
|---|---|---|
| Button | 1 | GND |
| 2 | GPIO 4 | |
| VL53L0X | VCC | 5V |
| GND | GND | |
| SDA | GPIO 6 | |
| SCL | GPIO 7 | |
| WS2812B | VCC | 5V |
| GND | GND | |
| DI | GPIO 3 |
The
VL53L0Xis the distance sensor, theWS2812Bis the LED strip, and theButtonis the push button.
To 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.
Get started in just one command! The GlowLight setup system will guide you through the entire installation process:
curl -fsSL https://raw.githubusercontent.com/friedjof/GlowLight/master/install.sh > install.sh && bash install.sh
Alternative download method:
wget https://raw.githubusercontent.com/friedjof/GlowLight/master/install.sh && bash install.sh
~/GlowLightIf you prefer to set up manually:
# Clone the repository
git clone https://github.com/friedjof/GlowLight.git
cd GlowLight
# Run the setup system
python3 scripts/setup.py
This is a PlatformIO project. The setup system above handles everything automatically, but for manual installation, PlatformIO must be installed. Once installed, you can open the project in PlatformIO and flash the software onto the ESP32C3.
Alternatively, 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.
If you're familiar with Nix-shell, you can use the shell.nix file to set up the environment for PlatformIO.
pio run: Compiles the softwarepio run --target upload: Flashes the software to the ESP32C3pio run --target clean: Removes compiled filespio device monitor: Opens a terminal to view the ESP32C3 outputmake: Compiles the softwaremake upload: Flashes the software to the ESP32C3make clean: Removes compiled filesmake monitor: Opens a terminal to view the ESP32C3 outputmake flash: Flashes the software and opens the monitormake start: Cleans, compiles, flashes the software, and opens the monitorArrayList for dynamic arraysButton2 for button input handlingAdafruit_VL53L0X for the distance sensorFastLED for LED controlArduinoJson for message serializationFor more details on the libraries, refer to the platformio.ini file.
The software is written in C++ and is structured as a typical PlatformIO project. The main file is 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 folder.
For a comprehensive understanding of the GlowLight system architecture and operation, see the Technical Diagrams which includes: