adih-20 / saber-core

Controls a DIY lightsaber powered by Pi Pico + MPU-6050.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Saber-Core

This project utilizes the Raspberry Pi Pico microcontroller alongside a MPU-6050 chip to create a lightsaber using PlatformIO/VS Code with earlephilhower's arduino-pico core.

The MPU6050_light library is used to get orientation data.

Getting Started

These steps were written to try to be platform-agnostic, but may need to be modified for your needs. This software should work without modification if the wiring guide is followed.

Prerequisites

Installation

  1. Clone the repo:
git clone https://github.com/adih-20/saber-core.git
  1. Import saber-core into PlatformIO/VSCode.

  2. Build and upload to Pico.

Usage

When switched on, the lightsaber should glow blue.

To switch colors, hold the lightsaber upside down (with the hilt facing the sky) for five seconds, which will cause the colors (Red, Orange, Green, Blue, Cyan, Purple, White) to switch every two seconds.

The software has an inbuilt watchdog to check for I2C communication errors with the MPU-6050. If any occur, the lightsaber will begin flashing red, indicating that the lightsaber must be manually restarted.

Materials

This project uses the following components:

  1. Raspberry Pi Pico microcontroller

  2. MPU-6050 Accelerometer/Gyroscope

  3. SMD5050 LED Strip (not the NeoPixel!)

  4. 3x Logic Level N-MOSFET (I used the FQU13N10LTU, though you are welcome to use any other)

  5. DC-DC Boost Converter (make sure it steps up the voltage, not steps down)

  6. 3x AA batteries

OPTIONAL

  1. SPST switch (strongly recommended to switch lightsaber on and off)

Wiring Guide

Wiring Diagram (Fritzing) Wiring Diagram

Schematic (KiCAD) Schematic

If you change any of the connections (with the exception of ground), make sure to update the code with your changes!

Roadmap

High-priority:

  • Add over-temperature protection

Low-priority:

  • Add flash-to-crash functionality
  • Implement audio output

License

This project is licensed under the GPLv3.

About

Controls a DIY lightsaber powered by Pi Pico + MPU-6050.

License:GNU General Public License v3.0


Languages

Language:C++ 100.0%