Dr Karl Kruszelnicki is fascinated by how bacteria rotate their flagella counter-clockwise, much like a manmade electric motor. But unlike the motors that humans make, this dynamic microscopic molecular machine is constantly being rebuilt and reconfigured on the run.

Last time, I talked about the most efficient electric motor currently known to the human race. Amazingly, it's not built by humans. It's entirely organic, and it sits inside the cell wall of many bacteria. It makes the wavy hairs on bacteria (known as flagella) spin, just like a propeller on a boat will spin round-and-round. That's right, the flagella don't wave back and forth, they spin like a propeller.

The bacterial flagellar motor is the 'pinnacle of evolutionary bionanotechnology'.

On the inside, just like an industrial electric motor, this organic bacterial flagellar motor has a rotor that spins. But wait, there's more.

In our industrial electrical motors, there's a part called the 'stator', which has the job of spinning the rotor into rotary motion. And sure enough, just like an industrial electric motor, the biological electrical motor has its 'stators'. The bacterium, E. coli, has up to 11 stators associated with each of its electric motors—the more stators, the more powerful is the motor.

But there are differences.

Unlike the electric motors that we humans make, this dynamic microscopic molecular machine is constantly being rebuilt and reconfigured on the run—the stators continuously come and go. In fact, the average 'lifetime' of any given stator in the bacterial flagellar motor is of the order of a half-a-minute.

Rather cleverly, the bacterial flagellar filaments behave very differently when they rotate clockwise or anticlockwise.

When they rotate counterclockwise, they automatically wind themselves into spinning bundles that push the bacterium forward through its liquid environment. The bacterium can now swim at up to 100µm per second (or about 50 to 100 times its own body length per second).

But when the filaments rotate clockwise, they unwind and splay out from the bundle. Suddenly the bacterium goes into a tumble, and ends up pointing in a different direction. And this is how the bacterium changes direction.

It turns out that there are many different versions of this bacterial flagellar motor. Evolution has taken many separate pathways, to arrive at different motors that are optimised for different bacteria and their different environments.

For example, the bacterium Campylobacter jejuni lives in a high-nutrient high-viscosity environment—your gut. Its motor is optimised to be so powerful that it can easily push through the gut wall, and cause food poisoning. On the other hand, Caulobacter crescentus lives in low-nutrient low-viscosity freshwater environments, and its motor is optimised for speed.

The bacterial flagellar motor is the 'pinnacle of evolutionary bionanotechnology: a self-assembling nanoscale electric rotary motor that performs at a higher speed and with greater efficiency than any manmade device'.

And yes, 'self-assembly' is exactly correct. This is not a misprint, nor is it a mistake. These electric motors actually assemble themselves.

Once the components have been manufactured, they come together by themselves. It's similar to you having a bag full of random Lego pieces, and after you give it a vigorous shake, suddenly the pieces assemble themselves into a perfectly constructed pirate ship.

We're still learning how the bacterial flagellar motor does this, but we do know that it starts with bits of the rotor. Here, one of the individual components has a 'wound-up spring' inside. Only when it matches up perfectly with another identical component do the two 'springs' unwind and lock them together.

But how do the motors know where to assemble? After all, you want your electric motors straddling and punching only through the cell wall, and not anywhere else inside the bacterium. So far, we are pretty sure that a part of the cell wall (the scaffold upon which the rest of the motor is built) is important. We think that once enough of them congregate inside the cell wall, the components will self-assemble. We also think that once the first stage of self-assembly starts, they and the scaffold provide a platform on which the rest of the motor can be built.

So next time you're struggling to build a Lego pirate ship, instead of letting it bug you, try to think like a bacterium. After all, that's where the world's fastest and most efficient nanomachine builds itself, in the dark, with no instructions. Now that's a master builder.