

Smart Bike Light Grp07 V03
An ESP32-based smart tracking and monitoring system for bicycles, combining GNSS (GPS) tracking, motion detection, power management, battery monitoring, and LoRa communication to create an intelligent, low-power system…
- Size
- 95 × 72 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 23
- Nets
- 52
- Pads
- 108
- Tracks, vias
- 221, 37
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 9.0 (file 20241229)
- Created
- 24 Mar 2025
- Updated
- 25 May 2025
Overview
Smart Bike Light Grp07 V03 is an open-source printed circuit board by Emwm, from the Emwm/BikeLightIoT7 repository on GitHub. It is a 2-layer board of 95 × 72 mm with 23 parts on 52 nets, routed with 221 tracks and 37 vias.
It is built around the MAX44009EDT+T, B5B-XH-A(LF)(SN) and KS-01Q-01, with the EG1218 among its other parts. Its parts include 7 resistors, 5 ICs, 2 capacitors, 2 diodes and 2 transistors. It belongs with the radio and wireless boards and the ESP32 and RISC-V boards of this library.
Main components
4MAX44009EDT+T
DFN-6-EP(2x2)Low power/sleep mode、Spectral correction/filtering、High dynamic range measurement、Interrupt/event trigger、Automatic gain control DFN-6-EP(2x2) Ambient Light Sensors ROHSMaxim Integrated (Analog Devices)Ambient Light SensorsB5B-XH-A(LF)(SN)
插件,P=2.5mm-25℃~+85℃ 1 14.9mm 1x5P 2.5mm 250V 3A 5 5.75mm 5P 7mm Brass K Pin PA66 Through Hole Tin UL94V-0 White XH 插件,P=2.5mm Wire To Board Connector ROHSJSTWire To Board ConnectorKS-01Q-01
-- Pushbutton Switches ROHSE-SwitchPushbutton SwitchesEG1218
插件-20℃~+70℃ 11.6mm 200mA 30V 4mm 7.4mm Black PC Pin Rectangular Columnar SPDT Through Hole Plugin Slide Switches ROHSE-SwitchSlide Switches
README
README.md🚲 ESP32 Smart Bike Tracker
An ESP32-based smart tracking and monitoring system for bicycles, combining GNSS (GPS) tracking, motion detection, power management, battery monitoring, and LoRa communication to create an intelligent, low-power system for bike security and telemetry.
📚 Table of Contents
- Features
- Getting Started
- Power Modes
- GNSS (GPS) Handler
- Motion Detector
- Light Control
- LoRa Communication
- Battery Monitoring
- Inactivity Handling
- Main Loop Overview
- Modules Summary
- Contributing
- License
📦 Features
- Real-time GPS tracking
- LoRa communication to send bike data remotely
- Motion detection using an accelerometer
- Battery monitoring via MAX17048 fuel gauge
- Smart power management with 3 modes: ACTIVE, PARK, SLEEP
- Inactivity-based sleep transitions
- Wake-up on button press or timer
- Integrated button and light control
🛠️ Getting Started
✅ Prerequisites
- PlatformIO or Arduino IDE
- ESP32 board definitions installed
- Required libraries:
- TinyGPS++
- Wire
- SPI
🚀 Flashing the Firmware
git clone https://github.com/youruser/esp32-smart-bike-tracker.git
cd esp32-smart-bike-tracker
# Open with Arduino IDE or PlatformIO and upload to your ESP32🔘 Button Handler
Manages button input from GPIO 33, used to:
- Wake up the system
- Trigger GPS updates
- Toggle power modes
⚙️ Configuration
| Constant | Description |
|---|---|
BUTTON_PIN_1 | GPIO pin for Button 1 (GPIO33) |
#define BUTTON_PIN_1 33📦 Variables
extern volatile bool button1Pressed;
extern unsigned long lastActivityTime;📋 API
| Function | Description |
|---|---|
setupButtons() | Initializes GPIOs as INPUT_PULLDOWN |
checkButtonPresses() | Resets flags, updates lastActivityTime |
🧠 Power Modes
System behavior varies by mode:
🟢 ACTIVE Mode
- Full GPS + LoRa operation
- Motion detection and lighting enabled
- Auto-exit on inactivity
🟡 PARK Mode
- Enters light sleep
- Periodic wake via RTC or button
- Ideal for short-term stationary periods
🔴 SLEEP Mode
- Enters deep sleep for max power saving
- Wake on button press only
- Best for long inactivity
🛰 GNSS (GPS) Handler
Handles GPS data using the TinyGPS++ library. Sends the location everytime the mode of the system changes.
📋 API
| Method | Description |
|---|---|
begin() | Initializes GPS module |
update() | Feeds serial data to TinyGPS++ |
isConnected() | Checks for GPS fix (≥4 satellites) |
checkLocation() | Returns GPSPosition with lat/lon |
📍 Example
This flag is used to update the location and send it.
if (sendLocationFlag) {
GPSPosition pos = gnss.checkLocation();
// Use pos.latitude, pos.longitude
}🕹️ Motion Detector
Detects bike movement using a 3-axis accelerometer (e.g. ADXL345).
📋 API
| Method | Description |
|---|---|
isMoving() | Returns true if movement detected |
begin() | Initializes the sensor |
MotionDetector(...) | Constructor with I2C address and threshold |
MotionDetector motion(0x53); // ADXL345 default I2C address💡 Light Control
Uses an LDR + MAX7219 LED matrix to control lights.
⚙️ Configuration
| Item | Pin |
|---|---|
LDR_PIN | Analog Input |
LED_LOW_BAT | Digital Output |
DIN | GPIO 14 |
CLK | GPIO 13 |
CS | GPIO 12 |
📋 API
| Function | Description |
|---|---|
setupLight() | Initializes LED matrix |
controlLight() | Enables/disables display based on LDR |
turnLightoff() | Manually disables display |
manageBatteryWarning(float) | Activates LED when battery < 25% |
📡 LoRaWAN Communication
Handles uplink/downlink communication via RN2483 LoRa module using OTAA.
🔧 ESP32 to RN2483 Wiring
| Function | ESP32 Pin |
|---|---|
| TX → RN | GPIO 19 |
| RX ← RN | GPIO 18 |
| RESET | GPIO 23 |
📋 API
| Function | Description |
|---|---|
init_lora() | Initializes LoRaWAN + joins TTN |
send_lora(devMode, battery, lon, lat) | Sends telemetry as CSV string |
recieve_lora() | Reads JSON downlink and parses value |
📤 Uplink Format (CSV)
1,3.85,12.34,56.78📥 Downlink Format
TTN → JSON string in HEX:
{"value": 2}TTN Payload: 7b2276616c7565223a20327d
Parsed into int value = 2.
🔋 Battery Monitoring
Powered by the MAX17048 fuel gauge.
batterypercentage = battery.percent();Low battery warning is triggered by:
manageBatteryWarning(batterypercentage);⏱️ Inactivity & Mode Handling
Automatically switches to PARK mode if idle for 60 seconds:
if (millis() - lastActivityTime > 60000) {
// Switch to PARK
}Button interrupt handler toggles modes:
void IRAM_ATTR handleInterrupt1();Transitions:
ACTIVE → PARKPARK → SLEEP
🔁 Main Loop Structure
switch (getCurrentMode()) {
case ACTIVE:
// Motion + LoRa
break;
case PARK:
// Light sleep
break;
case SLEEP:
// Deep sleep
break;
}🛠 Modules Summary
| Module | Description |
|---|---|
| powerModes | Manages sleep states and wake sources |
| GNSSHandler | Handles GPS via GNSS |
| MotionDetector | Reads accelerometer to detect movement |
| ESP32_lora | Sends and receives data via LoRa |
| MAX17048 | Monitors battery charge level |
| buttonHandler | Detects button presses |
| lightControl | Manages LED or light control |
Authors
Group 7 in the DTU course 34346 Networking technologies and application development for IoT
Parts
23| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 10k | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal | R2, R5, R7, R9 |
| 2 | 220 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_Horizontal | R6, R8 |
| 2 | NMOS | DigiKey:PinHeader_1x3_P2.54_Drill1.1mm | Q2, Q3 |
| 1 | 10uF | Capacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_Horizontal | C2 |
| 1 | 22uF | Capacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_Horizontal | C1 |
| 1 | 3.3V Regulator | DigiKey:PinHeader_1x3_P2.54_Drill1.1mm | U2 |
| 1 | ADXL345 | DigiKey:DIP-8_W7.62mm | U6 |
| 1 | Actual LED | Connector_JST:JST_XA_B05B-XASK-1-A_1x05_P2.50mm_Vertical | J2 |
| 1 | Bat_LED | LED_THT:LED_D3.0mm_Clear | D2 |
| 1 | Battery | DigiKey:Terminal_Block_D1.3mm_P5mm | BT1 |
| 1 | Break_LED | LED_THT:LED_D3.0mm_Clear | D3 |
| 1 | Button | Button_Switch_THT:SW_DIP_SPSTx02_Slide_9.78x7.26mm_W7.62mm_P2.54mm | S1 |
| 1 | CHG_Port | DigiKey:Terminal_Block_D1.3mm_P5mm | J1 |
| 1 | ESP32_C3_Heltec_Dev_Board | ESP32_C3_Heltec_Dev_Custom:DIP-40_W25.4mm | U1 |
| 1 | GY_NEO6MV2 | DigiKey:DIP-8_W7.62mm | U7 |
| 1 | LDR07 | OptoDevice:R_LDR_5.1x4.3mm_P3.4mm_Vertical | R1 |
| 1 | MAX17048 | DigiKey:DIP-8_W7.62mm | U5 |
| 1 | Switch | Button_Switch_THT:SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mm | S2 |
Similar boards
- 2 layers80 × 100 mm

- 2 layers129.5 × 114.3 mm

- 2 layers201 × 65.1 mm

- 2 layers177.8 × 177.8 mm

MainPowerBoard
ParadigmHyperloop/electrical
All schematics and layouts in KiCad, plus some simulations
263 parts11 - 2 layers197.3 × 121.2 mm

TeensyMaestro Main PCB
rimuadmin/TeensyMaestro-Hardware
Hardware for the TeensyMaestro
115 parts13CERN-OHL-P-2.0 - 4 layers99.9 × 69.9 mm

- 2 layers244.2 × 92.8 mm

Kai simple v3
kaihchang/Kai_Simple_split_keyboard
Kai Simple is a cradio (or some call it Sweep) variation that fits author's hands best. Author's first KB design: https://github.com/kaihchang/Ascendsplaysplitkeyboard
56 parts10 - 2 layers100 × 65 mm

Questions
How big is the Smart Bike Light Grp07 V03 PCB?
It measures 95 × 72 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Smart Bike Light Grp07 V03 use?
23 parts, built around the MAX44009EDT+T, B5B-XH-A(LF)(SN), KS-01Q-01 and EG1218. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Smart Bike Light Grp07 V03 KiCad files?
From the Emwm/BikeLightIoT7 repository on GitHub, at the commit this page was made from: the board is Electronic Hardware/KiCad/Smart_Bike_Light_Grp07_V03.kicad_pcb and its schematic Electronic Hardware/KiCad/Smart_Bike_Light_Grp07_V03.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Smart Bike Light Grp07 V03 design in my own project?
Its repository states no licence, so its author keeps all rights: ask Emwm before reusing the design.