Sensible discussion on "open collector circuit" for sensor

Just found this on hackaday:

" ... Why open collector?
An open collector output doesn’t toggle between high and ground, it toggles between ground and unconnected. The unconnected state, also called high impedance, exerts nothing on the output and allows the signal line to float.
Open collector outputs are useful when several sensors need to share the same microcontroller pin. ..." (my emphasis)


More in the article about a sharp IR proximity sensor, with video and this circuit diagram.


interesting… How does one
interesting… How does one make it switch? By an output?

not sure if I understand the question

The line called “output” is attached to the micro controller’s ADC input pin.

When several of these sensors are connected to the same ADC pin, the MCU would register the highest value of all connected sensors. In this case the sensor that registers the nearest object.


Digital not analog

The GP2Y0D02 is a digital sensor, not an analog, so would go to an IO pin, not an ADC pin. They are pulled up, as in the diagram and article, and switches low when something is reflected closer than 80 cm, floating to be pulled up when nothing is detected. You could use it on an ADC pin, but you’d never get a value other than ground or 5 volts.

I’m not aware of an analog output sensor that is open collecterr, and not sure it would be possible.


But how is the "multiple sensors on one pin" still an improvement?

The pin would go high when one of the sensor registers an object nearer than 80 cm?

From the article

The last paragraph of the article :

“Open collector outputs are useful when several sensors need to share the same microcontroller pin. Multiple sensors outputting high to the same microcontroller pin is generally considered a bad practice that can damage parts of a circuit.”

Most of the Sharps have a narrow beam of detection, on the order of a 5 to 15 degree spread. If you have a wide robot, one side or the other or even the middle might overlook an obstacle. So you could have 3 (or more) sensors connected to a single IO pin, to detect “Obstacle Ahead” without all three overloading fighting each other since they all are open collector. 1 or 2 or all 3 could have a hit, and the micro pin would have the same low, and none of the of the sensor would be trying to pull high since they can’t being open collector.

Damage would occur with active outputs, where one tried to output a high, while another tried to go to ground, causing a direct short that one or both of the 2 sensors would lose and be fried.