They are all interchangeable and generally depend more on shape, power requirements, and surrounding environment for ultimate selection.
Inductive have coils that have an alternating current passed thru them. The energy that leaves the coil is a function of the coils proximity to iron(steel). When the energy transfer reaches a certain level the sensor trips.
Capacitive works the same way but uses a different physical property and can detect more than just iron.
Photoelectric uses a light source and a light receiver. A modulated signal is put out as light, (modulated to reduce ambient light issues). A receiver looks for that modulated signal for determining the presence of the sensed item.
Inductive and capacitive are good for short distances only. They do not care about dirt and grit and are single units. Photoelectric units can work to hundreds of feet, can be single units, or have a sender and a receiver spaced widely. They
do care about dirt and grit.
Cost is all over the place. If you are talking about industrial versions they range from $45 for a small pig-tailed plastic inductive sensor to about $550 for a NEMA 4 version of any of them.
A distance sensor is nothing like any of those described and will output an actual measured distance. They use many different methods. Time-of-flight, Doppler, radar, light, microwaves, sound, etc. You will likely have to spend over $2k for anything providing distance unless you roll your own.
Keith Cress
kcress -