Yes, a motor can generate electricity! A motor works by converting electrical energy into mechanical energy (movement). However, if you reverse the process, where you apply mechanical energy (like turning a shaft or wheel), a motor can generate electrical energy.
This is essentially how a
generator works. In both motors and generators, the key component is the
rotor (the part that moves), which is inside a magnetic field. When the rotor spins, it moves through the magnetic field, which causes an electrical current to flow in the wire coils, generating electricity.
So, if you turn a motor's shaft by hand or with another source of power, it will act like a generator and produce electricity. The amount of electricity generated depends on factors like the motor's design, speed, and the strength of the magnetic field.