According to the Encyclopedia Britannica

The invention of the equal-arm balance dates back to the time of the ancient Egyptians, possibly as early as 5000 BC. In the earliest types, the beam was supported at the centre and the pans were hung from the ends by cords. A later improvement in design was the use of a pin through the centre of the beam for the central bearing, introduced by the Romans about the time of Christ.

The Babylonians are alleged to have made important improvements upon the invention of the balance.

 Quoting from cftech's BrainBank

"Instead of just comparing the weights of two objects, they compared the weight of each object with a set of stones kept just for that purpose. In the ruins of their cities, archaeologists have found some of these stones finely shaped and polished. It is believed that these were the world's first weight standards."

Aside from the ubiquitous problem found in number theory books about representing integers as sums and differences of powers of 3, references to this ancient computing device are virtually impossible to find in mathematics textbooks. Perhaps some indication of the general level of awareness of the underlying mathematics is that when the first author submitted, to the American Mathematical Monthly [1], the problem of determining a necessary and sufficient condition on the "stones" so that every integer weighted object X could be weighed, there were only 22 solvers from all over the world, [2].

Your project is to develop an algorithm for accomplishing the weighing. Then, go on to discover (or read about) this necessary and sufficient condition. The interactive balance scales are here for you to experiment with.

This document in Adobe Acrobat's PDF format shows that the underlying mathematics and an effective algorithm are essentially inseparable.  You need to download the free Acrobat Reader to view it.

The interactive balance scales on this site require the use of specific browsers with the LiveMath plug-in.  Even if the LiveMath plug-in is already installed on your computer, please download the latest version of the LiveMath plug-in as specified below.