In 1940, Farmer began working as assistant physicist in the radiography department at Middlesex Hospital, one of a group of physicists employed by London hospitals during the war to work on issues related to the emerging technology of X-rays, and the use of radium to treat cancer. These issues would become the central focus of Farmer's subsequent career. One of the instruments he invented while at Middlesex, the Farmer dosimeter, became a standard tool used in hospitals around the world to calibrate X-ray machines, and is still produced commercially today.