Skip to the content
2 layers95 × 72 mmSmart Bike Light Grp07 V03, the printed circuit board in 3D

Smart Bike Light Grp07 V03

Emwm/BikeLightIoT7

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

4

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

  • 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

bash
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

ConstantDescription
BUTTON_PIN_1GPIO pin for Button 1 (GPIO33)
cpp
#define BUTTON_PIN_1 33

📦 Variables

cpp
extern volatile bool button1Pressed;
extern unsigned long lastActivityTime;

📋 API

FunctionDescription
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

MethodDescription
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.

cpp
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

MethodDescription
isMoving()Returns true if movement detected
begin()Initializes the sensor
MotionDetector(...)Constructor with I2C address and threshold
cpp
MotionDetector motion(0x53); // ADXL345 default I2C address

💡 Light Control

Uses an LDR + MAX7219 LED matrix to control lights.

⚙️ Configuration

ItemPin
LDR_PINAnalog Input
LED_LOW_BATDigital Output
DINGPIO 14
CLKGPIO 13
CSGPIO 12

📋 API

FunctionDescription
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

FunctionESP32 Pin
TX → RNGPIO 19
RX ← RNGPIO 18
RESETGPIO 23

📋 API

FunctionDescription
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)

text
1,3.85,12.34,56.78

📥 Downlink Format

TTN → JSON string in HEX:

json
{"value": 2}

TTN Payload: 7b2276616c7565223a20327d

Parsed into int value = 2.


🔋 Battery Monitoring

Powered by the MAX17048 fuel gauge.

cpp
batterypercentage = battery.percent();

Low battery warning is triggered by:

cpp
manageBatteryWarning(batterypercentage);

⏱️ Inactivity & Mode Handling

Automatically switches to PARK mode if idle for 60 seconds:

cpp
if (millis() - lastActivityTime > 60000) {
    // Switch to PARK
}

Button interrupt handler toggles modes:

cpp
void IRAM_ATTR handleInterrupt1();

Transitions:

  • ACTIVE → PARK
  • PARK → SLEEP

🔁 Main Loop Structure

cpp
switch (getCurrentMode()) {
    case ACTIVE:
        // Motion + LoRa
        break;
    case PARK:
        // Light sleep
        break;
    case SLEEP:
        // Deep sleep
        break;
}

🛠 Modules Summary

ModuleDescription
powerModesManages sleep states and wake sources
GNSSHandlerHandles GPS via GNSS
MotionDetectorReads accelerometer to detect movement
ESP32_loraSends and receives data via LoRa
MAX17048Monitors battery charge level
buttonHandlerDetects button presses
lightControlManages LED or light control

Authors

Group 7 in the DTU course 34346 Networking technologies and application development for IoT

Parts

23
QtyValueFootprintReferences
410kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR2, R5, R7, R9
2220Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR6, R8
2NMOSDigiKey:PinHeader_1x3_P2.54_Drill1.1mmQ2, Q3
110uFCapacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_HorizontalC2
122uFCapacitor_THT:C_Axial_L3.8mm_D2.6mm_P7.50mm_HorizontalC1
13.3V RegulatorDigiKey:PinHeader_1x3_P2.54_Drill1.1mmU2
1ADXL345DigiKey:DIP-8_W7.62mmU6
1Actual LEDConnector_JST:JST_XA_B05B-XASK-1-A_1x05_P2.50mm_VerticalJ2
1Bat_LEDLED_THT:LED_D3.0mm_ClearD2
1BatteryDigiKey:Terminal_Block_D1.3mm_P5mmBT1
1Break_LEDLED_THT:LED_D3.0mm_ClearD3
1ButtonButton_Switch_THT:SW_DIP_SPSTx02_Slide_9.78x7.26mm_W7.62mm_P2.54mmS1
1CHG_PortDigiKey:Terminal_Block_D1.3mm_P5mmJ1
1ESP32_C3_Heltec_Dev_BoardESP32_C3_Heltec_Dev_Custom:DIP-40_W25.4mmU1
1GY_NEO6MV2DigiKey:DIP-8_W7.62mmU7
1LDR07OptoDevice:R_LDR_5.1x4.3mm_P3.4mm_VerticalR1
1MAX17048DigiKey:DIP-8_W7.62mmU5
1SwitchButton_Switch_THT:SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mmS2

Similar boards

  • 2 layers80 × 100 mmPir, the printed circuit board in 3D

    Pir

    buha/pir-trigger

    Camera trigger using PIR sensor

    137 partsGPL-3.0
  • 2 layers129.5 × 114.3 mmHOPE Project, the printed circuit board in 3D

    HOPE Project

    NSagan271/HOPE-Project

    31 parts
  • 2 layers201 × 65.1 mmPrototype, the printed circuit board in 3D

    Prototype

    rubend056/samn_design

    Kicad project for samn

    44 parts
  • 2 layers177.8 × 177.8 mmMainPowerBoard, the printed circuit board in 3D

    MainPowerBoard

    ParadigmHyperloop/electrical

    All schematics and layouts in KiCad, plus some simulations

    263 parts11
  • 2 layers197.3 × 121.2 mmTeensyMaestro Main PCB, the printed circuit board in 3D

    TeensyMaestro Main PCB

    rimuadmin/TeensyMaestro-Hardware

    Hardware for the TeensyMaestro

    115 parts13CERN-OHL-P-2.0
  • 4 layers99.9 × 69.9 mmPocketFT8Xcvr, the printed circuit board in 3D

    PocketFT8Xcvr

    conr2286/PocketFT8Xcvr

    Pocket FT8 Revisited

    59 parts12MIT
  • 2 layers244.2 × 92.8 mmKai simple v3, the printed circuit board in 3D

    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 mmAstroplant AL, the printed circuit board in 3D

    Astroplant AL

    AstroPlant/astroplant-hardware

    Raw data files for hardware PCB's

    102 parts3

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.