Miniature photoelectric reflex sensor with automatic switching threshold adaptation for reliable detection of transparent objects.