# Animated LED Sand

## Overview

https://youtu.be/rDo1S-UWtdg

## Simulated Glowy Physics!

These LEDs interact with motion and looks like they’re affect by gravity.&nbsp;An Adafruit LED matrix displays the LEDs as little grains of sand which are driven by sampling an accelerometer with an Adafruit Feather.

The code, written by [Phillip Burgess](../../../../users/pburgess), simulates physics by calculating collisions and terminal velocity.

We designed 3d printed enclosures to take advantage of sensor readings by allowing it teeter totter as well as a gimbal to create interesting simulations.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/886/medium800thumb/3d_printing_gimbal-loop.jpg?1515358792)

## Prerequisite Guides

I suggest walking through the following guides to get a better understanding of the electronics.

- [Adafruit LIS3DH Triple-Axis Accelerometer](../../../../adafruit-lis3dh-triple-axis-accelerometer-breakout)
- [Adafruit 15x7 CharliePlex LED Matrix](../../../../adafruit-15x7-7x15-charlieplex-led-matrix-charliewing-featherwing)
- [Adafruit Feather M0 Basic](../../../../adafruit-feather-m0-basic-proto)

![](https://cdn-learn.adafruit.com/assets/assets/000/049/887/medium800/3d_printing_parts.jpg?1515360792)

### Part: M2X8mm Screws
quantity: 6
M2x8mm screws

### Part: M2X4mm screws
quantity: 2
M2X4mm screws

### Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0

[Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0](https://www.adafruit.com/product/2772)
Feather is the new development board from Adafruit, and like its namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.

This is the&nbsp; **Feather M0 Basic Proto** ,&nbsp;it has a bunch of prototyping space...

In Stock
[Buy Now](https://www.adafruit.com/product/2772)
[Related Guides to the Product](https://learn.adafruit.com/products/2772/guides)
![Angled shot of a Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0. ](https://cdn-shop.adafruit.com/640x480/2772-09.jpg)

### Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings

[Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings](https://www.adafruit.com/product/2965)
You wont be able to look away from the mesmerizing patterns created by these&nbsp; **Adafruit 15x7 CharliePlex LED Matrix Display FeatherWings**.&nbsp; These 15x7 LED displays can be paired with with any of our [Feather...](https://www.adafruit.com/categories/830)

Out of Stock
[Buy Now](https://www.adafruit.com/product/2965)
[Related Guides to the Product](https://learn.adafruit.com/products/2965/guides)
![Five different colors of Charlieplex LED wings with a wave of lights pulsing.](https://cdn-shop.adafruit.com/product-videos/640x480/2965-03.jpg)

### Lithium Ion Polymer Battery - 3.7V 350mAh

[Lithium Ion Polymer Battery - 3.7V 350mAh](https://www.adafruit.com/product/2750)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 350mAh for a total of about 1.3 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/2750)
[Related Guides to the Product](https://learn.adafruit.com/products/2750/guides)
![Angled shot of a rectangular lipo battery with a 2-pin JST connector. The battery specs are listed on the body: 3.7V 250mAh.](https://cdn-shop.adafruit.com/640x480/2750-05.jpg)

### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

In Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
![Top down view of a Adafruit LIS3DH Triple-Axis Accelerometer.](https://cdn-shop.adafruit.com/640x480/2809-08.jpg)

### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
![Small, black, SPDT slide switch.](https://cdn-shop.adafruit.com/640x480/805-03.jpg)

- [Next Page](https://learn.adafruit.com/animated-led-sand/circuit-diagram.md)

## Featured Products

### Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0

[Adafruit Feather M0 Basic Proto - ATSAMD21 Cortex M0](https://www.adafruit.com/product/2772)
Feather is the new development board from Adafruit, and like its namesake it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.

This is the&nbsp; **Feather M0 Basic Proto** ,&nbsp;it has a bunch of prototyping space...

In Stock
[Buy Now](https://www.adafruit.com/product/2772)
[Related Guides to the Product](https://learn.adafruit.com/products/2772/guides)
### Adafruit 15x7 CharliePlex LED Matrix Display FeatherWing Yellow

[Adafruit 15x7 CharliePlex LED Matrix Display FeatherWing Yellow](https://www.adafruit.com/product/3135)
You wont be able to look away from the mesmerizing patterns created by this **Adafruit 15x7 CharliePlex LED Matrix Display FeatherWing**.&nbsp; This 15x7 LED display can be paired with any of our [Feather boards](https://www.adafruit.com/categories/830) for a...

In Stock
[Buy Now](https://www.adafruit.com/product/3135)
[Related Guides to the Product](https://learn.adafruit.com/products/3135/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

In Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
### Lithium Ion Polymer Battery - 3.7V 350mAh

[Lithium Ion Polymer Battery - 3.7V 350mAh](https://www.adafruit.com/product/2750)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 350mAh for a total of about 1.3 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/2750)
[Related Guides to the Product](https://learn.adafruit.com/products/2750/guides)
### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
### PLA Filament for 3D Printers - 1.75mm Diameter - Teal - 1KG

[PLA Filament for 3D Printers - 1.75mm Diameter - Teal - 1KG](https://www.adafruit.com/product/3069)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. That's why we've started carrying a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3069)
[Related Guides to the Product](https://learn.adafruit.com/products/3069/guides)
### Ultimaker 2+ 3D Printer

[Ultimaker 2+ 3D Printer](https://www.adafruit.com/product/2673)
The **Ultimaker 2+** is one of our favorite 3D printers on the market. It's a well-built open-source compact machine with an excellent UX.&nbsp;Every inch of the Ultimaker 2+ is designed to create the most effortless and reliable 3D printing experience ever!&nbsp;<a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2673)
[Related Guides to the Product](https://learn.adafruit.com/products/2673/guides)

## Related Guides

- [Proper Debugging of ATSAMD21 Processors](https://learn.adafruit.com/proper-step-debugging-atsamd21-arduino-zero-m0.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [MicroPython Displays: Drawing Shapes](https://learn.adafruit.com/micropython-displays-drawing-shapes.md)
- [NeoPixel LED Mickey Ears](https://learn.adafruit.com/neopixel-led-mickey-ears.md)
- [MX MIDI Guitar](https://learn.adafruit.com/mx-midi-guitar.md)
- [Mini Commodore PET with Charlieplexed LED Matrix](https://learn.adafruit.com/mini-commodore-pet-with-charlieplexed-led-matrix.md)
- [Using Piezo Buzzers with CircuitPython & Arduino](https://learn.adafruit.com/using-piezo-buzzers-with-circuitpython-arduino.md)
- [Melting Picture Frame for PyPortal IoT images](https://learn.adafruit.com/pyportal-art-display.md)
- [CircuitPython Hardware: LIS3DH Accelerometer](https://learn.adafruit.com/circuitpython-hardware-lis3dh-accelerometer.md)
- [Adafruit 15x7 CharliePlex FeatherWing](https://learn.adafruit.com/adafruit-15x7-7x15-charlieplex-led-matrix-charliewing-featherwing.md)
- [CircuitPython Hardware: SSD1306 OLED Display](https://learn.adafruit.com/micropython-hardware-ssd1306-oled-display.md)
- [Raspberry Pi LED Matrix Sand Toy](https://learn.adafruit.com/matrix-led-sand.md)
- [MIDI Solenoid Drummer](https://learn.adafruit.com/midi-solenoid-drummer.md)
- [CircuitPython Basics: Analog Inputs & Outputs](https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs.md)
- [LED Acrylic Sign](https://learn.adafruit.com/led-acrylic-sign.md)
