Fluid simulation is a way of replicating the movement and behavior of liquids and gases in different environments. It’s widely used in fields like gaming, animation, engineering, and physics to create realistic visual effects and solve complex fluid-related problems.

This time I will present you a very simple way to make a fluid motion simulator using a few components. This is a simulator with a relatively low resolution of 256 dots and for that purpose a Display made of 16x16 LEDs with WS2812B LED chips is used.
Specifically, I am using a cheap ready-made module with 16x16 LEDs. However, on this small "Display" I will create some really cool visualizations.
The device is extremely simple to build and consists of only a few components.
- ESP32 Microcontroller Dev Board
- MPU6050 accelerometer module
- 16x16 Led module with WS2812B chips
- and Button

This project is sponsored by PCBWay. They has all the services you need to create your project at the best price, whether is a scool project, or complex professional project. On PCBWayyou can share your experiences, or get inspiration for your next project. They also provide completed Surface mount SMT PCB assemblY service at a best price, and ISO9001 quality control. Visit pcbway.com for more services.

For this project I am using a box from one of my previous devices, for which I have also made a 3D printed grille for a better visual impression. Otherwise, even without this addition, the visual effect is impressive. It is important to note that the IMU sensor should be mounted in the way you see in the description, because otherwise you will get an undefined movement that does not comply with the laws of physics.

Now a few words about the software. The code is designed in a way that allows us to change multiple parameters, so we can simulate the movement of sand particles, liquids, gases, and other fluids.
First of all, we can change the number of active fluid particles and the light intensity of the LEDs. With the button, we can also choose one of the three colors for the LEDs that we have defined previously. At the beginning of the code, numerical values are given for some of the colors.

I will also present you a version of the code where the color of the particles changes dynamically depending on their location, which gives an even more interesting visual effect.
Then follow the basic physical quantities in the form of constants. By combining their values, various ways of moving fluids are obtained.

Now let's see how the device behaves in real conditions. I'll present you with just a few different situations, and you can experiment with many different combinations of physical constants.




And finally, a brief conclusion. This simple device serves only as a visual presentation of the way several different fluids move, i.e. primarily as a visually interesting toy for describing fluid dynamics.
