  We describe a simple and inexpensive method for automating the data
collection in the well-known Cavendish torsion balance experiment to determine
the gravitational constant $G$. The method uses a linear array of
phototransistors and requires no moving parts. Multiplexers and a
data-acquisition device are used to sample the state of each phototransistor
sequentially. If the sampled phototransistor is illuminated by the laser spot,
the position and time are recorded to a data file. The recorded data does an
excellent job of capturing the damped harmonic oscillations. The resulting data
were analysed to extract an experimental value of $G$ that was within 5% of the
accepted value.
