Multiplexing LEDs of optical sensors

I'm developing a hobby project inspired by WARBL: https://warbl.xyz/WARBL_2.2%20Schematic.pdf

I have separated the relevant section in an image attached to this post.

To avoid the large current draw from all the LEDs in the QRD1113 sensors (~20mA * 8), the author is doing a clever trick. As I understand, he uses Arduino to turn on only a single LED at a time and then reads the corresponding phototransistor value (also dealing with the calibration for ambient light).

I would like to implement a similar project, but I'll need 16 optical sensors. So, for reading them, I could use a 74HC4067. Initially, I wanted to use another 74HC4067 to also turn off the LED of the same QRD1113 I'm about to read. This would be simple to implement as I could connect both 74HC4067 control pins in parallel.
However, I read in a few topics here that 74HC4067 is not supposed to be used for driving LEDs.
I'm wondering if that's the case even if I want to switch a single LED for a brief moment to read QRD1113 through the other 74HC4067? Would it be a bad idea? Should I use 74HC595 instead? It would make things more complex and require more pins from Arduino to control both the mux and the shift register.

I'm afraid that synchronization between turning the LED on, turning the needed QRD1113 transistor on through 74HC4067 and reading the value might get unstable if I mix 74HC4067 and 74HC595. I would want it to work in real-time, with less than a 1ms delay for reading all QRD1113 values, if possible. Essentially, reading all 16 QRD1113 values 1000 times a second.

Is it feasible at all?

You can use a TPIC6C595N to drive the LEDs
CD74HCT166E for the phototransistor outputs

Provide more details about your project.

Are you using the Atmega32U4?
Or another platform.

Could you use an Arduino Mega? Due?
They have more pins available.

Also study the possibility of using Charlieplexing.

Currently, it looks like I'll be using RF-Nano GitHub - emakefun/rf-nano: emakefun arduino nano V3.0 + nrf24L01+ (a clone of v1.0). I have tested a couple and their RF communication works pretty well. However, that means that SPI will not be usable for any other purpose because those pins are occupied by the RF chip. So, SPI-based muxes are not an option. I also want to keep some pins free for other sensors, so maybe Charlieplexing would make it too complex and occupy too many pins.

I guess, I'll have to try with two 74HC595 (for 16 LEDs) and a 74HC4067 (for reading analog data from phototransistors).

I watched a video where someone was using 74HC4067 also for LED output and noticed that during the boot, many LEDs flashed briefly.

https://youtu.be/j_ZP_zd0WHI?si=zXid36m-JQFiJ5NJ&t=410 (time 6:52)

Not sure what is the current draw for the LEDs in that video, but with 16 QRD1113 that would cause a spontaneous draw of 16 * 20 mA, which might be an overload for 74HC4067. So maybe two shift registers are my best option here, even if it complicates things.

What's wrong with the TPIC6C595 and the CD74HCT166E?

TPIC6C595 is a bit more harder to find where I live and it's also more expensive. I'm not sure what are its benefits when compared to 74HC595?

CD74HCT166E seems to be 8 bit logic? For phototransistors, I need 16 analog inputs, and 74HC4067 seems to be a good fit if I'm not mistaken.

I'm sorry the TPIC6C595 is 5V only, forget I mentioned it

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.