Skip to main content
Version: ACS CC

LightSaber Pi

Straight out of Star Wars — with just a bit of Rust — we bring you... The LightSaber Pi.

info

Author: Armega Andrei 331CC
GitHub Project: UPB-PMRust-Students/proiect-AndreiArmega

Description

The project revolves around — as much as fictional laser technology allows — a lightsaber, the iconic weapon from the Star Wars franchise. Instead of Kyber crystals from Ilum, the blade will be powered by batteries and an addressable LED strip (WS2811). Iconic sound effects will be played through a speaker, while a gyroscope detects movement to trigger those sounds. Finally, all components will be encapsulated in a DIY hilt.

Motivation

The primary drive behind this project is simple: lightsabers are cool. Beyond that, it brings a fun and creative break from the seriousness of everyday life and demonstrates embedded systems in an engaging way.

Architecture

3D Model

Lightsaber

Components

  • Raspberry Pi Pico W
  • LED strip WS2811
  • Level Shifter HW-221
  • Gyroscope MPU6500
  • Current Source Stabilizer (5V to 3.3V)
  • LiPo Battery: GENS ACE Tattu 7.6V / 300 mA / 75C
  • Amplifier: MAX98357A
  • 4-pin Buttons
  • Breadboards

Log

Week 5 (May 11)

  • Created the initial documentation, 3D concept, and schematic of the project.
  • Ordered all the necessary components.
  • Researched libraries for audio and LED control.

Week 12 (May 18)

(To be filled)

Week 19 (May 25)

(To be filled)

Hardware

We use two Raspberry Pi Pico W boards — one for the core functionality, the other for debugging.

Movement detection (e.g., to play a whoosh sound) is done using the MPU6500 gyroscope.

For sound output, we use an 8Ω 2W speaker and a MAX98357A amplifier.

The lightsaber blade is illuminated using a WS2811 addressable LED strip. A level shifter ensures proper communication between the 3.3V logic of the Pico and the 5V LEDs.

Power is supplied via a 7.6V LiPo battery, regulated to 5V and 3.3V using a power supply module.

User input (powering on/off, switching modes) is handled via 4-pin push buttons.

Schematic

Schematic

Bill of Materials

DeviceUsagePrice
2× Raspberry Pi Pico WMain microcontroller and debugging75 RON
WS2811 48 LEDBlade lighting25 RON
Level Shifter HW-221Voltage conversion (3.3V to 5V)8 RON
MPU6500 GyroscopeMovement detection15 RON
MAX98357A AmplifierAudio output17 RON
Power Supply Module (5V–3.3V)Voltage regulation5 RON
GENS ACE Tattu 7.6V LiPo BatteryPower source60 RON
6×6×6 Push ButtonControl interface1 RON
2× Breadboard (750 Points)Circuit prototyping18 RON
Jumper WiresCircuit connections8 RON
20cm 40p Male-Female WiresCircuit connections8 RON
USB to MicroUSB Adapter ShimConnectivity3 RON
USB CablePower and data6 RON
Speaker (8Ω, 2W)Audio playback5 RON

Software

LibraryDescriptionUsage
defmtLogging framework for embedded systemsEfficient development-time logging
defmt_rttReal-Time Transfer loggerReal-time debug output
embassy_executorAsync task executor for embedded devicesManages async task scheduling
embassy_rpEmbassy support for the RP2040Low-level hardware access
embassy_timeTime abstraction for async systemsTimers and delays
panic_probeLightweight panic handler with loggingDebugging panic causes
ws2811-spiSPI driver for WS2811/WS2812 LED stripsControls RGB lighting
embedded-audioAudio traits and tools for embedded systemsAudio playback abstraction
mpu6050I²C driver for MPU6050 motion sensorMotion detection
  1. Building a Lightsaber Wall Light with the Raspberry Pi Pico W
  2. New Toby made us RP2040 lightsabers for SiliCon
  3. Making Anakin/Luke/Rey's Lightsaber — Lights, Sounds & FREE 3D Files