Sensors and transducers can sometimes be confused because they both react to some change in their environment but they are not the same thing.
A sensor is a component in an electronic system that can detect (sense) various types of changes in the physical environment and as a result, communicate these to the bigger system it is a part of. In other words they do the same job as what our 5 senses do for us. A sensor can measure how much the change occurs and transmits this information in a convenient format such as electrical signals to the system. The change can be about any physical quality that can be detected and measured, such as light, sound, pressure, acceleration, distance, motion, temperature, humidity and many more.
Most sensors can also be categorized as transducers. So a sensor is a specific type of transducer.
A transducer on the other hand, is a device that converts one form of energy into another. So, while the duty of a sensor is to detect, the duty of a transducer is to transform or convert. Transducers contain sensors. So a transducer is a more general term than a sensor.
Transducers can be separated into two as input and output transducers.
An input transducer takes energy in it and converts it into something such as signals that can be understood.
An output transducer converts signals into energy. For example a motor transforms electrical energy into mechanical energy.