Real world engineering: Using the NXT for earthquake simulation

Earthquakes are not all alike, and are identified by their strength on the Richter Scale of magnitude. The seismic waveforms generated during a quake depend on many factors including including fault geometry and rock type, wave travel path, soil composition, nearby mountains and other geological structures, and location of the origin of the quake.


The interaction of an earthquake with a structure is modeled by engineers, particularly civil or structural engineers, to produce the Response Spectrum for that particular quake. The Response Spectrum is a measure of how much a structure will respond to that particular earthquake and depends on the stiffness and mass of the structure and its damping. When an engineer wishes to perform a test on a structure in the laboratory, he or she defines a Required Response Spectrum, or RRS. This RRS can then be used to create a motion in the lab to simulate a quake based on its particular wave patterns, allowing for further study through the reproduction of the original motions. The equipment that reproduces these motions is called a shake table. RRS are typically used when a quick description of the earthquake is needed, as they clearly indicate what effects a certain waveform will have on a certain building.

Real world engineering: ANCO earthquake simulation

ANCO Engineers, Inc. ( is a producer of custom-built shake tables and portable vibration testing equipment since the company’s establishment in 1971. ANCO’s seismic shake tables are used to simulate the vibrations of an earthquake in a safe and controlled manner. These tables can move in three dimensions and vibrate to realistically reproduce earthquake motions and the RRS. This simulation is useful for the investigation of engineering problems related to maintaining safety during an earthquake. This includes ensuring the stability of structures such as hanging fixtures, the attachment of shelving and other fixtures to walls, and ensuring that any furniture present will not tumble about in the event of an earthquake or any moderate to severe vibrational force.

In industry, for example, shake tables are used to assure that the safety equipment in a nuclear power plant will perform correctly during and after an earthquake. Some specially designed earthquake simulators can be used in public locations, such as museums or universities, in order to give observers — and, in some cases, riders — an idea of what a real earthquake entails. Demonstrations may include visual, auditory, and even tactile information as such systems may be designed with the capability to carry human passengers safely during the earthquake simulation sequence.

ย a1 a2

ANCO Hydraulic Shake Table (left); ANCO All-Electric Shake Table (right)

ANCO engineers used LabVIEW, a graphical programming software produced by National Instruments, to provide a realistic model of an earthquake for testing and observation in public venues containing a shake table. LabVIEW is used to play a series of recorded earthquakes through the table to show how variable they are. The engineers took advantage of LabVIEW’s spectral analysis capabilities to generate waveforms of a quake based on an experimentally recorded RRS. The generated waveform is then put through filters and other signal processing to produce a more accurate model of earthquake motion. This process is automated, making earthquake simulation relatively quick and easy as long as the RRS data or time history is available.

A companion LabVIEW program controls two or more long stroke (12″) displacement actuators while streaming audio and video through a dual VGA output. During the vibrational simulation of an earthquake, this video can be projected onto a screen and the audio can be played back to create a more immersive experience for any onlookers. The use of fog machines, flashing lights, and sound effects can also enhance the realism of the situation and more readily grab the attention of passersby in a public setting.

Users can tap into these programs to generate earthquake simulations with specific frequency energy signatures that also account for factors such as soil composition and resonance (caused by the swaying of a building or structure at certain characteristic frequencies or “resonances”). A GUI (graphical user interface) allows for the use of this software control with relatively little training. To further keep control of the system simple, a library of approximately 50 earthquake scenarios can be dragged and dropped to form short sequences up to several minutes in length. These are then played back for an audience in order to showcase the effects of that particular generated earthquake, sometimes using a miniature city on the shake table to make the experience more tangible.

As previously mentioned, some shake tables manufactured by ANCO are safe for humans to experience – that is, people can sit or stand on the table and actually feel the vibrations of a simulated earthquake. This can promote earthquake readiness and awareness by familiarizing the subjects to a quake’s effects.

Earthquake simulation using the LEGO NXT


Completed earthquake simulator

The main considerations when transitioning from an industrially manufactured shake table to a student-accessible shake table are keeping cost to a minimum, making sure building time and effort are reasonably small, and ensuring that any programming and operation necessary is relatively simple and easy to do. The scale of the earthquake simulator also must dramatically change if the project is to be completed quickly and easily, especially in a classroom setting where space is often very limited.

As a solution to this transition, LEGO bricks were used as a building material, and LEGO Mindstorms NXT was used as a means of programming the earthquake simulator.



The earthquake simulator can be easily programmed using LEGO Mindstorms. The program used to run the simulation includes a few motor blocks and a loop. Motor C, connected to the lower motor, runs continuously to move the surface in the horizontal direction. Motors A and B are connected to the upper motors, and their directions at first match, then rotate clockwise, then rotate counterclockwise. This program is shown below:


Earthquake simulation program v1: ย changing rotation of motors A and B

These loops and motor blocks can be customized to suit a number of earthquake-like situations. Changing the motor power over time, for example, could create interesting variation in the simulation. A random number generator could output the motor power for an even more varied effect. In the program shown below, three random number generators output a number between 25 and 75. Each number generator controls the power level of motors A and B at different points in the simulation sequence, causing the motion of the simulator to be slower or faster at random.


Earthquake simulation program v2: Random power levels for motors A and B

A simpler model of vibrational motion can be used as an activity in the classroom or as a demonstration. The following program consists of quick changes in direction of both motors A and B, while motors A and B are always moving in the same direction at any given time. This is looped to emulate a slower version of the vibrations caused by seismic waves during an earthquake. This program could be used as a base to be expanded upon for users who are comfortable programming with NXT-G.


Earthquake simulation program v3: Quick switch of direction of motors A and B

LEGO earthquake simulator in action

The simulator’s behavior varies rather widely due to programming changes among the example NXT code blocks above. A total of five versions of the simulator were tested and included in the video file available for download above.

Version 1: Constant power

Using NXT code version 1, the simulator’s arms rotate and the surface where the plate would go (the darker grey square of rounded beams towards the top, not the lighter grey square beams that form the base) moves in 3 dimensions. It undulates in a wavelike fashion, moving at times back and forth and at times lifting one side of the platform higher than the other. The lowest motor moves the structure along a horizontal axis in a back-and-forth motion.

Version 2: Variable power

Using NXT code version 2, the simulator moves in a similar way to version 1. However, since the power is variable, the rate of motion of the upper two motors varies randomly. The movement of this simulated quake is much less regular than that of version 1, at times bursting forth in quick motions and at other times going much more smoothly and slowly. The lowest motor moves the structure along a horizontal axis in a constant-power back-and-forth motion.

Version 3: Vibration effects

Using NXT code version 3, this simulation attempts to show off the effects of simple vibrational movement on a few different objects. A LEGO brick platform is added to the shake table. A large ball is placed in a cage made of netting, while a vine hangs off of a rigid part of the netting structure.A chain is attached to a rigid part of the netting structure and is anchored at its opposite end to the brick platform. During the simulation, the ball rolls around in the net cage, the vine’s unattached end moves, and the chain shakes between its attached ends.

Version 4: LEGO platform

Using NXT code version 3 and a LEGO brick base, a simple scene is set up. The scene includes two windows, two minifigures, a ladder propped on a window, a snake, and two pieces of greenery. During the simple vibrational motion, the ladder falls off of its place on the window quickly, and knocks one of the minifigs off of the platform as it continues to slide. Eventually, both the ladder and the minifigure hit by the ladder are knocked off of the platform entirely, while the other elements remain attached to the platform.This demonstrates the ability of objects to remain stable during earthquake-like conditions, provided they are anchored well.

Version 5: Paper platform

Using NXT code version 3 and a piece of paper attached with tape over a LEGO brick base, another simple scene is set up. This scene includes a large bay window, two minifigures, a snake, two pieces of greenery, and a ladder. A minifigure quickly tumbles backwards off of the platform, soon followed by the ladder, shrub, and second minifigure. The bay window tumbles off, and the second piece of greenery soon slides off the platform, accompanied by the snake. This demonstrates how lack of sound attachment of objects affects their ability to remain stable during earthquake-like circumstances

While the LEGO version of the shake table is nowhere near as precise as an ANCO manufactured shake table, it still provides students with the ability to model simple vibrations. The effects of these vibrations can be seen when the NXT programs are run and a platform is used with the test objects placed on its surface. The effect of changing variables on the stability of objects on the simple shake table can be demonstrated and tested. Some variables that can be tested include mass, shape, size and method of attachment to the platform. This tool, although relatively simple, can represent much more complex situations involving quakes while introducing concepts in physics (think force of weight, friction, and inertia), the scientific method, and engineering design.




Richter Scale of magnitude – quantifies the seismic energy released by an earthquake on a logarithmic scale. A magnitude of 3-4 can be felt near the epicenter and is a moderate quake, whereas a magnitude of 6-7 can be largely destructive and is a major quake that can be felt for tens of miles around the epicenter. The largest earthquakes that occur may have a Richter magnitude as high as 9.
seismic waves – waves that travel through the earth, due to wind, ocean waves, earthquakes or explosions.
damping – the ability to dissipate the earthquake energy injected into the structure. The earthquake energy injected into a structure is eventually dissipated to heat, minor scraping and deformation, and sound. A structure with high damping will not vibrate as much as one with low damping.
RRS – required Response Spectrum, or the peak response of a building or structure to an earthquake, depending on its resonant frequencies and damping.
actuator – a mechanical device for moving or controlling a mechanism or system, in this case moving a shake table. These can be electric or hydraulically driven.


Article by Karen Wickert

The following two tabs change content below.


The Tufts Center for Engineering Education and Outreach (CEEO) in Boston, Massachusetts, is dedicated to improving engineering education in the classroom, from Kindergarten to college. The Center houses faculty, staff, and graduate students from engineering disciplines and the education department.

Latest posts by CEEO (see all)