He studied medicine at the University of Edinburgh and moved to India in 1797.
His knowledge of chemistry helped him provide the administration with a method to recover damp gunpowder in 1802, on the eve of Lord Lake's Maratha war.