A set of solderless breadboards with op amps and their functions annotated

Op-Amp Challenge: Virtual Ball-in-a-Box Responds To Your Motions

With the incredible variety of projects submitted to our Op-Amp Contest, you’d almost forget that operational amplifiers were originally invented to perform mathematical operations, specifically inside analog computers. One popular “Hello World” kind of program for these computers is the “ball-in-a-box”, in which the computer simulates what happens when you drop a bouncy ball into a rigid box. [wlf647] has recreated this program using a handful of op amps and a classic display, and added a twist by making the system sensitive to gravity.

All the physics simulation work is performed by a set of TL072 JFET input op amps. Four are configured as integrators that simulate the motion of the ball in the X and Y directions, while four others serve as comparators that detect the ball’s collisions with the edges of the box and give it a push in the opposite direction. Three more op amps are connected to form a quadrature oscillator, which makes a set of sine and cosine waves that draw a circle representing the ball.

A miniature CRT viewfinder showing a small circleThe simulator’s output signals are connected to a tiny viewfinder CRT as well as a speaker that makes a sound whenever the ball hits one of the screen’s edges. This makes for a great ball-in-box display already, but what really makes this build special is the addition of an analog MEMS accelerometer that modifies the gravity vector in the simulation.

If you tilt or shake the sensor, the virtual box experiences a similar motion, which gives the simulation a beautiful live connection to the real world. You can see the result in a demo video [wlf647] recently posted.

The whole setup is currently sitting on a solderless breadboard, but [wlf647] is planning to integrate everything onto a PCB small enough to mount on the viewfinder, turning it into a self-contained motion simulator. Analog computers are perfect for this kind of work, and while they may seem old-fashioned, new ones are still being developed.