I have an instrument which sparges a gas stream through a bubble tube. This allows water in the gas stream to condense. However, when running lots of samples, the jacket can actually overflow soaking the downstream drying agent (and generally causing a mess). A while ago, I made a bubble sensor with a slotted optical switch. I used it in "switch mode" into a microcontroller as shown in this application bulletin. I want to do something similar, but I have a different slotted switch (inherited it). It is called a totem-pole. The datasheet here. I'm very confused. I understand "powering" the anode/cathode with a current-limiting resistor to "light up" the IR LED. What I don't understand is that this model has three wires on the "transistor" side. It appears as VCC (white), ground (green) and output (blue). With the four-wire version, I used a 10K resistor as in Figure 1 on the app note to create a bubble detection "switch." What I don't understand on this version is whether I have to calculate an R2? Could I just hook the anode to +5V through a limiting resistor, then hook cathode and "ground" to ground, then the white wire directly to 5V? Would I get high-to-low or low-to-high on the output (blue) wire? I don't understand which components are "inside" the package on Pg. 3. On the app note, there's a rectangle around the physical device on the circuit diagram. Has anyone ever used one these and can provide some direction? Thanks as always...