Blender/UPBGE + Python + Arduino = Digital twin

I have developed several digital twins : a sliding gate, a lift and a rolling shutter.

At first, we program the behavior of the digital model with a Python script. After, we link the PC to an Arduino board and the real system executes the same program simultaneously.

I’m a teacher and I use them with students (french high school) to teach to system programming (input, output, state machine, …) . At this time, the documentation is French only.

Project website (git) : https://forge.aeif.fr/blender-edutech/jumeau-numerique


9 Likes

Stuff like this should be teached on every high school, i mean this is really cool and projects like this are many times the only thing that is needed to motivate someone, plus in high schools where everything is too much theorical.
Sorry if some expressions are a bit clumsy my englis is not very good. Cool bro

1 Like

Thanks !

You’re right, the main advantage is that the students can see immediately the result (3D scene) after coding.

Oh yeah UPBGE’s python is awesome for making visualizations and stuff, since you can essentially load any python library and use it directly in-game. For example, I made a quick IMU visualizer in a few minutes by just adding the pyserial library and reading the data from an arduino.

Yes, we can imagine to walk in a real and a digital 3D scene simultaneous : VR helmet with https://www.youtube.com/watch?v=6ijArKE8vKU .

With UPBGE, you can read data for visualisation in 3D scene … but you can interact with 3D object easily for making real action → it’s bi-directional (not like matplotlib).

With arduino, the pyfirmata protocol ( http://firmata.org/ ) is a simple way to read/write digital/analog pin.

About the IMU sensor, last year, I developed a digital twin of a plate with electrical linear actuators.

https://forge.aeif.fr/blender-edutech/blender-edutech/-/blob/master/berceau/berceau.pdf (in french)