Most sensors use radiation such as light or laser, infrared waves or other waves such as ultrasonic waves to detect objects and changes in their surroundings. They can do this by having an energy source in them that allows them to emit radiation towards their target.
The main goal of an electronic sensor is to convert physical environmental parameters into electrical parameters [i.e. H. voltage or current] Different sensors work in different ways.
A temperature sensor can be made from a substance whose resistance changes as the temperature changes, and this change in resistance is observed using Ohm’s Law and electronic parameters are noted.
Since the physical parameters of the substance are known, this change is represented by temperature units.
The same applies to different sensors. Some changes in strain, resistance, temperature, etc., and these changes are mapped to electrical parameters and used to calculate the physical values.