Below is the “classic” way hobbyists (and most breakout-boards, e.g. Pololu / SparkFun) wire a single QRE1113GR.
Just repeat the same little circuit 16 × and feed each OUT line to X0…X15 of your CD74HC4067.
─────────────────────────────────────
Pinout recap (QRE1113GR package)
┌───────────┐ view from top, pins downward
LED A — │ 1 4 │ — C (phototransistor collector / OUTPUT)
LED K — │ 2 3 │ — E (phototransistor emitter, GND)
└───────────┘
• 1 = LED anode • 2 = LED cathode • 3 = phototrans. emitter • 4 = phototrans. collector
─────────────────────────────────────
Parts you mentioned and how they are wired
| Designator | Typical value | Where it goes | Why it’s there |
|---|
| RLED | 100 Ω (5 V) ‑- 220 Ω (3 V3) | In series between VCC and pin 1 (LED A) | Limits IR-LED current (≈20 mA max) |
| RPULL | 10 kΩ | Between VCC and pin 4 (collector / OUT) | Pull-up for the phototransistor so you get a voltage the µC can read |
| CFILT | 100 nF (0.1 µF ceramic) | As close as possible between pin 4 (OUT) and GND | Low-pass filter, kills noise / PWM ripple, smooths ADC readings |
Optional: a 100 nF decoupling cap across VCC–GND for each group of sensors is always good practice, but CFILT is the “mystery” cap most people ask about.
─────────────────────────────────────
Full single-sensor schematic
VCC (5 V or 3 V3)
│
├─ RLED (100–220 Ω)
│
┌─────► │ 1 LED A
│ │
│ └── LED inside ───┐
│ │
│ 2 LED K ─────────────┘
│ │
│ └── GND
│
│ VCC
│ │
│ ├─ RPULL (10 kΩ)
│ │
OUT ────────┴─────────┤ 4 COLLECTOR (to MUX Xn)
│
├─ CFILT (0.1 µF)
│
GND ──────────────────┤ 3 EMITTER / GND
│
└── GND
How it works
• The IR LED shines continuously; the resistor RLED makes sure you don’t fry it.
• Reflected IR light hits the phototransistor. More light ⇒ more current from C→E ⇒ voltage on COLLECTOR (OUT) drops (because RPULL is being sunk).
• Your Arduino reads that voltage through the CD74HC4067.
• CFILT forms a simple RC with RPULL (~1 kHz corner when 10 k and 0.1 µF) which removes high-frequency junk.
─────────────────────────────────────
Wiring 16 sensors to the CD74HC4067
- Build the little circuit above for each sensor.
- Tie all LED “K” pins and all phototransistor emitters to the common GND rail.
- The 16 OUT lines (pin 4 of each sensor) go to X0 … X15 on the HC4067.
- RPULL and CFILT can be placed right next to the sensor or on a small carrier board; electrically it doesn’t matter as long as they’re between OUT ↔ VCC / GND.
Tip: If you want to save board space you can share one RPULL per channel on the multiplexer board (i.e., 16 resistors) instead of placing them at the sensor—just don’t omit them!
That’s it—two resistors, one capacitor, done 🎉.