A can body spraying machine comprises a can body spinning device, a spray gun for spraying a coating onto an interior of a can body mounted on the can body spinning device and a controller configured to cause the spray gun to switch when the can body spinning device is in a correct spraying position. A sensor coupled to the can body spinning device determines when the can body spinning device has undergone a predefined rotation following commencement of spraying and, in response to such determination, causes the spray gun to be switched off.