In the 19th century engineers found ways to use electricity to power trains. Scottish engineer Robert Davidson designed and built an electric locomotive in 1837 using batteries. Locomotives powered by batteries could not be used on the main railways due to the frequent need to charge them. 