Skip to content

Commit 4ffb5f5

Browse files
committed
initial commit
1 parent b955370 commit 4ffb5f5

135 files changed

Lines changed: 5898 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Triggers on version tags like v1.0.0
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Java
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '17'
23+
24+
- name: Set up Flutter
25+
uses: subosito/flutter-action@v2
26+
with:
27+
flutter-version: '3.38.0-0.1.pre'
28+
channel: 'beta'
29+
cache: true
30+
31+
- name: Cache Flutter dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.pub-cache
36+
flutter-app/ble_ws2812b/.dart_tool
37+
flutter-app/ble_ws2812b/build
38+
key: ${{ runner.os }}-flutter-${{ hashFiles('flutter-app/ble_ws2812b/pubspec.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-flutter-
41+
42+
- name: Cache Gradle
43+
uses: actions/cache@v3
44+
with:
45+
path: |
46+
~/.gradle/caches
47+
~/.gradle/wrapper
48+
flutter-app/ble_ws2812b/android/.gradle
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('flutter-app/ble_ws2812b/android/**/*.gradle*', 'flutter-app/ble_ws2812b/android/gradle-wrapper.properties') }}
50+
restore-keys: |
51+
${{ runner.os }}-gradle-
52+
53+
- name: Get Flutter dependencies
54+
working-directory: flutter-app/ble_ws2812b
55+
run: flutter pub get
56+
57+
- name: Build APK
58+
working-directory: flutter-app/ble_ws2812b
59+
run: flutter build apk --release
60+
61+
- name: Create Arduino ZIP
62+
run: |
63+
cd bluetooth_ws2812b_light
64+
zip -r ../arduino-project.zip bluetooth_ws2812b_light.ino
65+
cd ..
66+
67+
- name: Get version from tag
68+
id: get_version
69+
run: |
70+
if [ "${{ github.ref_type }}" == "tag" ]; then
71+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
72+
else
73+
echo "VERSION=dev-$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT
74+
fi
75+
76+
- name: Create Release
77+
uses: softprops/action-gh-release@v1
78+
with:
79+
tag_name: ${{ steps.get_version.outputs.VERSION }}
80+
name: Release ${{ steps.get_version.outputs.VERSION }}
81+
draft: false
82+
prerelease: false
83+
files: |
84+
flutter-app/ble_ws2812b/build/app/outputs/flutter-apk/app-release.apk
85+
arduino-project.zip
86+
body: |
87+
## Release ${{ steps.get_version.outputs.VERSION }}
88+
89+
### What's included:
90+
- **app-release.apk**: Flutter Android application for controlling the LED ring
91+
- **arduino-project.zip**: Arduino sketch for ESP32-S3
92+
93+
### Installation:
94+
1. Flash the Arduino sketch to your ESP32-S3 board
95+
2. Install the APK on your Android device
96+
3. Connect via Bluetooth and control your WS2812B LEDs!
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

README.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
2+
3+
4+
# MicroGlow BLE
5+
6+
Minimalistic Bluetooth LED controller for ESP32-S3 and WS2812B. Use it for ringlights, strips, accent lighting, or any creative LED project.
7+
8+
<p align="center">
9+
<img src="assets/app.png" alt="App Screenshot" width="200"/>
10+
<img src="assets/hardware.png" alt="Hardware Photo" width="200"/>
11+
</p>
12+
13+
---
14+
15+
**Note:** The included Flutter app is a crude proof-of-concept (my first Flutter app!) and is meant to "just work" for basic control. It’s not polished, but it gets the job done for this project.
16+
17+
---
18+
19+
## Getting Started
20+
21+
1. **Download the latest release:**
22+
- [Go to Releases](https://github.com/MerzSebastian/bluetooth_ws2812b_light/releases/latest)
23+
- Download the APK for Android and the Arduino `.ino` sketch
24+
25+
2. **Flash the Arduino sketch:**
26+
- Open `bluetooth_ws2812b_light.ino` in Arduino IDE
27+
- Install the required libraries:
28+
- FastLED
29+
- Preferences (built-in for ESP32)
30+
- Select your ESP32-S3 board and COM port
31+
- Upload the sketch
32+
33+
3. **Install the Android app:**
34+
- Transfer the APK to your phone and install it
35+
36+
4. **Connect and control:**
37+
- Power up your hardware
38+
- Open the app and connect via Bluetooth
39+
- Send RGB values to control the LEDs
40+
41+
---
42+
43+
## Hardware
44+
45+
- ESP32-S3 development board
46+
- WS2812B LED ring/strip (default: 16 LEDs)
47+
- 5V power supply
48+
- Jumper wires
49+
50+
51+
**Wiring:**
52+
53+
```
54+
ESP32-S3 WS2812B Ring Light
55+
-------- ------------------
56+
GPIO 13 ------> Data In (DI/DIN)
57+
5V ------> VCC/5V
58+
GND ------> GND
59+
```
60+
61+
---
62+
63+
## BLE Commands
64+
65+
Send RGB values as comma-separated string: `R,G,B`
66+
67+
Examples:
68+
- `255,0,0` (red)
69+
- `0,255,0` (green)
70+
- `0,0,255` (blue)
71+
72+
---
73+
74+
## Features
75+
76+
- Minimalistic BLE control
77+
- Simple RGB text commands
78+
- EEPROM color memory
79+
- Serial debug output
80+
81+
---
82+
83+
## Troubleshooting
84+
85+
- Check wiring and power
86+
- Confirm board and port selection
87+
- Use Serial Monitor for debug info
88+
89+
---
90+
91+
## License
92+
93+
MIT
94+
95+
Edit these values in the `.ino` file as needed:
96+
97+
```cpp
98+
#define LED_PIN 13 // GPIO pin for WS2812B data
99+
#define NUM_LEDS 16 // Number of LEDs in your ring
100+
```
101+
102+
## Uploading
103+
104+
1. Open `bluetooth_ws2812b_light.ino` in Arduino IDE
105+
2. Select the correct board and port
106+
3. Click Upload
107+
4. Open Serial Monitor (115200 baud) to see connection status
108+
109+
## Usage
110+
111+
### Connecting via Bluetooth
112+
113+
1. Upload the code to your ESP32-S3
114+
2. The device will appear as **"ESP32-LED-Controller"** in Bluetooth settings
115+
3. Use a BLE app to connect:
116+
- **Android:** nRF Connect, BLE Scanner, Serial Bluetooth Terminal
117+
- **iOS:** nRF Connect, LightBlue
118+
- **Windows/Mac:** nRF Connect, Web Bluetooth apps
119+
120+
### Sending Commands
121+
122+
Send RGB values as a comma-separated string to control the LEDs:
123+
124+
**Format:** `R,G,B`
125+
126+
**Examples:**
127+
- `255,0,0` - Red
128+
- `0,255,0` - Green
129+
- `0,0,255` - Blue
130+
- `255,255,255` - White
131+
- `255,128,0` - Orange
132+
- `128,0,128` - Purple
133+
- `0,0,0` - Off
134+
135+
### Using nRF Connect App
136+
137+
1. Open nRF Connect and scan for devices
138+
2. Connect to "ESP32-LED-Controller"
139+
3. Look for the service UUID ending in `914b`
140+
4. Find the characteristic UUID ending in `26a8`
141+
5. Tap the write button (↑)
142+
6. Enter your RGB values (e.g., `255,0,0`)
143+
7. Send the command
144+
145+
## Features
146+
147+
- ✅ Bluetooth Low Energy (BLE) for low power consumption
148+
- ✅ Simple RGB control via text commands
149+
- ✅ Supports any number of WS2812B LEDs (adjust `NUM_LEDS`)
150+
- ✅ Auto-reconnection support
151+
- ✅ Serial debugging output
152+
- ✅ Input validation (0-255 range)
153+
154+
## Troubleshooting
155+
156+
**LEDs don't light up:**
157+
- Check wiring connections
158+
- Verify power supply is adequate (WS2812B needs 5V)
159+
- Confirm `NUM_LEDS` matches your actual LED count
160+
- Try a different GPIO pin and update `LED_PIN`
161+
162+
**Can't find Bluetooth device:**
163+
- Make sure ESP32 is powered and code is uploaded
164+
- Check Serial Monitor for "BLE device is ready!" message
165+
- Try restarting your phone/computer Bluetooth
166+
- Move closer to the ESP32
167+
168+
**Wrong colors:**
169+
- Some WS2812B variants use different color orders
170+
- Try changing `COLOR_ORDER` from `GRB` to `RGB` or `BRG`
171+
172+
**ESP32 resets/crashes:**
173+
- Use external power supply for LED strip
174+
- Ensure common ground between ESP32 and power supply
175+
- Add capacitor across power supply
176+
177+
## Customization Ideas
178+
179+
- Add brightness control
180+
- Implement color patterns and animations
181+
- Add multiple color zones
182+
- Create preset color modes
183+
- Add automatic color cycling
184+
- Implement music reactive lighting
185+
186+
## License
187+
188+
Free to use and modify for personal and commercial projects.
189+
190+
## Credits
191+
192+
- FastLED library by Daniel Garcia
193+
- ESP32 Arduino core by Espressif Systems

assets/app.png

337 KB
Loading

assets/case.scad

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
$fn=150;
2+
3+
translate([30,00,0]) difference(){
4+
//main body
5+
union(){
6+
7+
translate([-14.5,00,0]) cube([29,15.5,25]);
8+
translate([0,00,0]) cylinder(d=29, h=25);
9+
}
10+
11+
12+
cylinder(d=24, h=21-13.5);
13+
translate([0,0,21-13.5]) cylinder(d1=19, d2=18.5, h=13.5);
14+
15+
//top cup
16+
translate([0,00,23]) difference(){
17+
cylinder(d=27.1, h=2);
18+
}
19+
20+
cylinder(d=11.6, h=200);
21+
22+
23+
24+
translate([17-30,15.5,5]) rotate([180,180,90]) union(){
25+
cube([1.2,23.8,18.2]);
26+
translate([1.2,00,(18.2-14.3)/2]) cube([3.2-1.2,23.8,14.3]);
27+
28+
translate([1.2+1.5,5,5.8]) hull() {
29+
rotate([90,90,0]) cylinder(d=3,h=10);
30+
translate([0,00,5.8]) rotate([90,90,0]) cylinder(d=3,h=10);
31+
}
32+
}
33+
34+
35+
translate([17-30,5,20.9]) rotate([-5,0,0]) cube([13,13,3]);
36+
37+
translate([41.8-30,22,18]) union(){
38+
rotate([90,90,0]) cylinder(d=2,h=15);
39+
translate([0,-15,0]) rotate([90,90,0]) cylinder(d=4,h=3);
40+
translate([-12,-18,-2]) cube([12,3,4]);
41+
}
42+
}
43+

assets/case.stl

215 KB
Binary file not shown.

assets/hardware.png

6.79 MB
Loading

0 commit comments

Comments
 (0)