Actually, there are two various self-powered sensors: One is active sensor, the other is passive sensor.
Here is the details where the above two sensors get energy to keep functioning:
Active sensor: An energy transfer naturally that doesn’t need additional power supply;
Passive sensor: It need input power supply(Generally it’s +5V) to output electric signal, such as temperature sensor,etc.