He spent his early adult years in Eliot, Maine and Cambridge, Massachusetts.
In 1847, Farmer constructed and exhibited in public what he called "an electro-magnetic locomotive, and with forty-eight pint cup cells of Grove nitric acid battery drew a little car carrying two passengers on a track a foot and a half wide".
At Boston in 1851, he constructed an electric fire-alarm service with William Francis Channing.
With his partner William Wallace, he invented the early dynamo which powered a system of arc lights he exhibited at the Centennial Exhibition of 1876 in Philadelphia, and which inspired Thomas Edison to work on an improved incandescent light.
Edison used the Wallace-Farmer 8 horsepower (6.0 kW) dynamo to power his early electric light demonstrations.