What would the ancient Greeks make of an iPod? According to Andrew Carol, they might have been more gadget-savvy than we give them credit for.

He’s paid homage to their ingenuity by building a functioning Lego model of the famous Antikythera Mechanism — a 2,000-year-old handheld “mechanical computer” that people in Hipparchus’ time used to make sophisticated astronomical predictions.

“Thousands of years ago, events like solar eclipses were terrifying to people,” Carol says. “But they were smart — they recorded the patterns of when these eclipses occurred, and eventually some Greek guy realized he could build those patterns into a box of gears. After that, anyone could predict these important events just by turning a crank.”

Carol builds software for Apple by day, but has explored the nexus “where computational mechanics and Lego meet” since 2006, when a cover story in an old Scientific American inspired him to build a working “difference engine” out of plastic bricks. (Charles Babbage’s 19th-century device used cranks and gears to calculate mathematical functions.)

An editor at Nature saw Carol’s model and asked if he could make a Lego Antikythera. Carol gladly accepted the challenge, but rebuilding antiquity’s Palm Pilot was no small feat. “Whoever designed it had the luxury of cutting their own custom gears,” he says, “whereas I just had to use what Lego makes.”

Starting in late 2009, he designed a modular system comprising seven mechanical differentials and more than 100 gears to achieve the “exotic ratios” necessary for computing lunar movements. Two prototypes, 10 days of Christmas vacation, and $500 worth of Lego Technic pieces later, Carol had a working version of the machine.

He recently presented it to adoring geeks at the annual Science Foo Camp held at Google’s headquarters in Mountain View, Calif. At roughly the size of a desktop printer, his replica “isn’t as compact as the original,” he concedes. “Then again, I had to use twice as many gears as they did.”

Andrew Carol’s Work:

Antikythera Device: