Electronics Fun & Fundamentals: Sensor Smörgåsbord

The mass production first of automobiles, and now of smartphones, has resulted in a surplus of inexpensive sensor modules. Devices are trickling down rapidly into the hobbyist market, with industrial surface-mount components installed on breakout boards for easy soldering. I’m in the process of researching the sensors section for my new book, Make: More Electronics, but wanted to take a break and share a few of my most interesting finds.


The Open-Collector System

Many all-in-one sensor modules operate on the principle of open-collector output. The detecting element in the sensor connects with the base of an internal transistor whose collector is “open,” meaning you can access it via one of the external leads.

Figure A
Figure A
A typical arrangement is shown in Figure A. The positive side of the power supply sinks current through an external pull-up resistor, through the transistor, to negative ground. When the detecting element switches on the transistor, its effective internal resistance falls, and the collector voltage drops. When the transistor turns off, the voltage rises to near the power supply value (provided the collector isn’t connected with a low-impedance device that takes too much current).

Figure B
Figure B
Instead of the meter in Figure A, you could substitute an input pin to a microcontroller, or the base of another transistor. A PNP transistor will give a positive output from a sensor whose effective internal resistance drops when triggered. The datasheet for a sensor should tell you its operating voltage and the maximum current it can sink, but won’t necessarily reveal the appropriate value of the pull-up resistor. You can find out by starting with 100K and working downward, while checking the voltage (as in

Figure A) and the current (as in Figure B). The current should not exceed the limit stated by the manufacturer.

In the pleasant days when I was a senior writer for Wired magazine, I had enough free time and spare cash to build a 12-sided tower on top of an outcropping of rock that locals began referring to as Charlie Mountain. I could drive to it up a steep dirt road that a friend installed for me with his trackhoe. But, access to that road required a drive of about 8 miles on other badly maintained dirt roads, and I realized that I was never going to make much use of the place. It was just too inconvenient. Someone else owns it now, but the location remains in my head as a state that I would like to find inside myself, enabling serene, detached objectivity. In reality of course I am neither serene nor detached.

View more articles by CPlatt