QRE1113 (sensor part) and Multiplexing possible or ON Resistance too high?

I like to set up some QRE1113 Reflective Sensors to count bees and copy this project http://www.instructables.com/id/Honey-Bee-Counter/ The disadvantage of the documented setup is that you need with 44 QRE1113 also 44 input pins. So I decided to use a Mux (or more precisely 3 x 16-Channel) to reduce the number of required input pins. This posting is about the sensor part of the QRE1113 not the IR-LED element.

First I set up the QRE1113 referred to this schematic http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/Proximity/QRE1113-Analog-Breakout-v11.pdf and did some test. All worked great! You can also use the ~20K internal pullup from the Arduino or a 100K pulldown as described in the original Instructables what leads to different sensitivities, but all worked smooth without the Mux.

In the final version I will use some 16-Channel Analog Multiplexer, CD74HC4067, http://www.sparkfun.com/datasheets/IC/cd74hc4067.pdf. But for testing i grabbed this 8-Channel chip: MC14051B, http://www.produktinfo.conrad.com/datenblaetter/150000-174999/172901-da-01-en-4051_4052_4053.pdf in a local store (the CD74HC4067 was not available).

With the internal pullups enabled I got a enormous sensitivity fare above the spec and not usable (it switches in a range of 70 mm, spec is around some mm, also a halogen bulb in the room "fires" the sensors). Now I tried to replace the internal pullups of the Arduino with external pullups. But I can see only different values on the input with different pullups (1K, 10K, 20K, 100K) but the sensors do not switch by approximation.

I noticed that the MC14051B has a 250 Ohm Typ. “ON” Resistance (I measured a resistance of 100 to 110 Ohm between in and out pin of the Mux when the channel is switched). Could this be the problem with my poor readings? Is this “ON” resistance the reason, or other stuff? How can I fix the problem? Is the CD74HC4067 better (datasheet says 70 Ohm Typ. “ON” Resistance). Or is there a general problem with such sensors as the QRE1113 and multiplexing?

There are two ways you can connect the pullup resistors:

  1. Between each multiplexer input and +5V. In this case, the 250 ohm resistance of the mutiplexer doesn't matter. But you will need one pullup per sensor.

  2. Between each multiplexer output/analog input pin and +5V (replicating the situation using the internal pullups). In this case there are 2 additional considerations:

(a) the 250 ohm resistance of the multiplexer will mean that low values of pullup resistor will not work well. I suggest you go no lower than 1K.

(b) because phototransistors are quite slow, you will need to include a delay between the code that switches the multiplexer to the correct channel and the code that does the analog read. Try 100us to 1ms.

Thanks a lot! The delay between switching the multiplexer and reading the pin made it work as expected. In my case 400 µs made the difference! Many thanks!