Skip to the content
PCBKitNew board
2 layers120 × 35 mmStardance, the printed circuit board in 3D

A bike light with automatic brake lights and turn signals powered by an esp32-s3 and an mpu6050

Size
120 × 35 mm
Copper layers
2
Thickness
1.6 mm
Parts
31
Nets
28
Pads
66
Tracks, vias
166, 0
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
11 Oct 2026
Updated
23 Oct 2026

Overview

Stardance is an open-source printed circuit board by emdcomputer-crypto, from the emdcomputer-crypto/Automatic-bike-light repository on GitHub. It is a 2-layer board of 120 × 35 mm with 31 parts on 28 nets, routed with 166 tracks and 0 vias.

Its parts include 10 resistors, 10 diodes, 2 connectors and 1 IC. It belongs with the ESP32 boards of this library.

README

README.md

Smart Bike Dynamic Lighting System

This is my custom built smart bike lighting system powered by a Seeed Studio XIAO ESP32-S3 and an MPU6050 inertial sensor. I designed this project from scratch to provide safety features on the road including automatic deceleration triggered brake lights, dynamic turn signals, crash detection, and a local Wi-Fi web server that lets me control and monitor everything directly from my phone without needing an internet connection or an external app.


Everything you need

  • schematic, pcb and others in Hardware
  • Firmware Firmware (wich i highly reccomend to make changes to)
  • Fabrication files (gerber) FabricationFiles needed to produce the pcb

Core Features

  • Tilt-Compensated Braking: The system calculates true deceleration using a sort of filter, filtering out false triggers caused by riding up or down hills.
  • Brake time: Uses independent thresholds to turn the brake light on and off, preventing annoying flickering during gradual slowing.
  • Turn Signal effect: Cool and progressive sliding animations across the side LEDs when turning wich i really like.
  • Crash Detection (SOS): Automatically monitors for severe impacts or vehicle rollovers, triggering a Morse code SOS beacon (... --- ...) in an emergency. (Random feature honestly but still cool)
  • Local Wi-Fi Web Server: The ESP32 hosts a local hotspot serving a dashboard for live data showing the lights state and the possibility of different modes with also a manual customization mode wich lets you customize wich leds stay on (The mode will always go back to "auto" after every 2 minutes, of course you can change that).

Hardware & PCB Design

I designed a custom PCB in KiCad measuring 120x35 mm with rounded edges (2mm diametre) and two mounting holes in opposite corners for securing it in any custom 3d printed enclosure

Component Breakdown

  • Microcontroller: Seeed Studio XIAO ESP32-S3 (chosen for its size and built-in Wi-Fi).
  • Inertial Sensor: MPU6050 6-axis accelerometer and gyroscope.
  • LEDs (Rear View Layout):
    • Left Turn Indicator: 3 yellow LEDs (LEFT1, LEFT2, LEFT3).
    • Brake Lights: 4 red LEDs (BRAKE1, BRAKE2, BRAKE3, BRAKE4). Note: Due to pin constraints on the XIAO, brake LEDs 3 and 4 share a single control pin in the original firware when testing it was made for the full size esp32 wich may lead to bugs in the firmware.
    • Right Turn Indicator: 3 yellow LEDs (RIGHT1, RIGHT2, RIGHT3).
  • Power Management: LiPo battery connected via a 2-pin header paired with a USB-C charging circuit is the best option.

PCB Layout Strategy

I routed the entire board and placed the XIAO ESP32-S3, the MPU6050 header, and the battery connector flipped onto the back layer. This left plenty of space on the front layer exclusively for all 10 LEDs. I added custom icons on the silkscreen, poured a solid GND copper plane across the bottom layer for signal integrity, and completed the layout with 0 DRC errors.

image image image

Bill of Materials (BOM)

Category / RoleItemQtyPriceLink
MicrocontrollerSeeed Studio XIAO ESP32-S31$18.99Amazon Link
Boost ConverterYoumile DC-DC Step Up Boost Module (2V-24V to 5V-28V 2A) with 24AWG wire1$18.32Amazon Link
Battery ChargerGreluma Type-C USB-C 5V 1A 18650 LiPo Charger Module (with protection)1$8.93Amazon Link
BatteryEEMB 963450 3.7V 1800mAh LiPo Rechargeable Battery with JST1$15.03Amazon Link
Inertial SensorARCELI GY-521 MPU6050 6-Axis Accelerometer & Gyroscope1$7.81Amazon Link
LEDs & ResistorsLyeteung 450 Pcs 3mm LED Diode Kit (Red, Yellow, Green, White) + Resistors1 kit$11.16Amazon Link
PCB FabricationJLCPCB Custom PCB Manufacturing (Gerber files in Hardware folder)119.46JLCPCB

Total Estimated: $80.24 USD (excluding PCB manufacturing)

Total Estimated: $99.70 USD (including PCB manufacturing)

Startup Sequence & Behavioral Diagnostics

When I power on the system, it has some simple and usefull sequences before starting:

  1. LED Self-Test:
    • Left LEDs -> Brake LEDs -> Right LEDs light up briefly in sequence so we can verify all leds work.
  2. Full Flash:
    • All LEDs flash simultaneously to confirm everything is fine.
  3. Sensor Diagnostics:
    • 3 yellow flashes indicate whether the MPU6050 is detected. If it fails to get detected it will keep flashing .
  4. initial Calibration:
    • Alternating yellow and red lights indicate MPU6050 calibration. I keep the bike completely still during this step to calibrate accelerometer and gyro biases.
  5. Ready Animation:
    • A sweeping light sequence from left to right followed by one full flash indicates the system is on everything should work.

Firmware Architecture

Using the help of AI i wrote a lot of firmwares (still learning c++ in school but can't write full firwmwares so i'm sorry i'm still working and watching tutorials) went thru different bug fixes and all but this was the best most stable one wich still due to the lack of space in the pcb i had to go with a smaller and different microcontroller than the original one (that's why i included the original firmware that was built on the full sized esp32 wrom) so the firmware might be unstable or make some stuff not work either way feel free to take this firmware fix it, customize it or make one from scratch as i will provide the schematic too.

Phone Controller & Web Dashboard

Connecting to the bike's Wi-Fi hotspot (SmartBike) opens a website control dashboard with the following capabilities:

  • Live data: data for deceleration, pitch, roll, and motion status (MOVING / STILL).
  • Mode Switching: the ability to toggle between different preset modes RIDE AUTO, HAZARD, MANUAL TEST, FLASH ALL, CHASE, and LIGHTS OFF.
  • Individual LED Control: a grid, allowing manual toggling of individual LEDs for testing or for customization.

Getting Started & Requirements

Required Arduino Libraries

Make sure you have the following libraries installed in your Arduino IDE environment to be able to use the firmware

  • Wire
  • Adafruit_MPU6050
  • Adafruit_Sensor
  • Preferences
  • WiFi
  • WebServer

Flashing

  1. Open Code_3.ino in the Arduino IDE.
  2. Select your target board as Seeed Studio XIAO ESP32-S3 or something similar.
  3. Compile and upload the sketch to the board.
  4. Open the Serial Monitor at 115200 baud to view boot logs or type HELP into the console to use the live serial tuning interface.
  5. Connect your phone to the Wi-Fi network SmartBike (password: Bike123) and on your browser navigate to http://192.168.4.1.

Parts

31
QtyValueFootprintReferences
10220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R3, R4, R5, R6, R7, R8, R9, R10
10LEDLED_THT:LED_D5.0mmD1, D2, D3, D4, D5, D6, D7, D8, D9, D10
4LOGOs:starG***, G***, G***, G***
15vConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1
1LOGOs:vectorG***
1LOGOs:brain2G***
1XIAO_ESP32_S3esp32foot:MODULE_XIAO_ESP32_S3U1
1mpu6050Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ2

The 29 most common of 31 parts.

Questions

How big is the Stardance PCB?

It measures 120 × 35 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Stardance use?

31 parts. 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 Stardance KiCad files?

From the emdcomputer-crypto/Automatic-bike-light repository on GitHub, at the commit this page was made from: the board is Hardware/stardance.kicad_pcb and its schematic Hardware/stardance.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Stardance design in my own project?

Its repository states no licence, so its author keeps all rights: ask emdcomputer-crypto before reusing the design.

Similar boards

  • 2 layers44.5 × 46.9 mmOSO SWAT B1-jig, the printed circuit board in 3D

    OSO SWAT B1-jig

    joeycastillo/Sensor-Watch

    A board replacement for the classic Casio F-91W wristwatch

    31 parts2.1k
  • 2 layers65 × 30 mmRgb to hdmi, the printed circuit board in 3D

    Rgb to hdmi

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    31 parts1kGPL-3.0
  • 2 layers191 × 98.5 mmMacroKeypad, the printed circuit board in 3D

    MacroKeypad

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    31 parts915
  • 2 layers39 × 45.2 mmCH32V003F4P6-R0-1v1, the printed circuit board in 3D

    CH32V003F4P6-R0-1v1

    openwch/ch32v003

    CH32V003 is an ultra-cheap RISC-V MCU with 2KB SRAM, 16KB flash, and up to 18 GPIOs that sells for under $0.10

    31 parts599
  • 2 layers26.7 × 27.9 mmBreakout board, the printed circuit board in 3D

    Breakout board

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    31 parts546MIT
  • 2 layers100 × 50 mmPixelix, the printed circuit board in 3D

    Pixelix

    BlueAndi/Pixelix

    Full RGB LED matrix, based on an ESP32 and WS2812B LEDs or emulated LEDs on TFT.

    31 parts447MIT
  • 2 layers77.2 × 69.8 mmCubesatsim solar, the printed circuit board in 3D

    Cubesatsim solar

    alanbjohnston/CubeSatSim

    CubeSatSim, the AMSAT CubeSat Simulator

    31 parts419GPL-3.0
  • 2 layers103 × 55 mmTd neck-294, the printed circuit board in 3D

    Td neck-294

    tdaede/td-crt

    tubes

    31 parts373