There's a detailed guide to building the LED Matrix Sand Toy at Adafruit:
These LEDs interact with motion and looks like they’re affect by gravity. An Adafruit LED matrix displays the LEDs as little grains of sand which are driven by sampling an accelerometer with Raspberry Pi Zero!
The 3D Printed handles make it easy to hold the 64×64 LED Matrix and the two buttons make it easy to switch modes or reset simulations!
The code, written by Phillip Burgess, simulates physics by calculating collisions and terminal velocity.
It looks particularly beautiful in the dark:
One of the more mesmerizing things I've built. pic.twitter.com/5JiDzbbj3y
— Hunter Scott (@hunterscott) September 30, 2019