Neopixel Hat
Individually-addressable LED hat using my own animation workflow
October 2019
PythonArduinoC
Project Overview
Originally created for Halloween, this project evolved into a display piece for offseason First Robotics competitions. It uses an Arduino with one strip of 576 NeoPixel LEDs to create a cylindrical display on a top-hat, capable of showing various animations.
Technical Implementation
- Hardware: Arduino controlling a strip of 576 NeoPixel LEDs
- Animation Storage: Animations are stored as 8-bit and 32-bit arrays
- Compression Algorithm:
- Created a Python program to import sets of images
- Compresses images by grouping sets of pixels together based on their color
- Stores group-size and color-id information in one large unsigned integer array
- Color palette of the animation stored in another 32-bit integer array
- Memory Management: Animations stored in Arduino's
PROGMEM
(flash storage) to maximize the number of animations that could be stored at once
Animation Workflow
To create complex animations efficiently:
- Used Blender to render out 2D animations
- Processed these animations using the custom Python script
- Imported the processed data into the Arduino program
Results
This solution allowed for dozens of animations to be stored on the hat at a time, a significant improvement over the previous method which only allowed for about one animation (approximately 50 frames) at a time.
Future Improvements
- Implement wireless control to change animations on the fly
- Develop a mobile app for creating and uploading new animations
- Explore more efficient compression algorithms for even more animation storage