Sensors and modules (having extra electronic circuitry along with sensor) are Electronic devices that detect and respond to some type of input from the physical environment.
a motor is a machine that converts electrical energy to mechanical energy.In another words, the electrical energy is a “battery” and the mechanical energy is the “rotation.”