A generator is a device that converts mechanical energy into electrical energy. This conversion is based on the principle of electromagnetic induction, where a relative motion between a conductor and a magnetic field induces an electric current in the conductor. Mechanical work is done to cause this relative motion. A motor is a device that converts electrical energy into mechanical energy. A voltmeter is an instrument used to measure electric potential difference (voltage). An ammeter is an instrument used to measure electric current.