Questions about a circuit? Ask in the Wirecora Discord →Questions? Ask in the Wirecora Discord →

Hand distance sensor with a 10-LED bar

Hold your hand over the two small sensors: the closer it gets, the more of the ten red LEDs light up, from the bottom of the bar to the top. Pull the hand away and the bar goes dark again.

From the Short Hand Distance Sensor Lights a 10-LED Bar | LM3914 (280K views, posted 10 October 2026). Opens on YouTube.

An LM3914 chip, a bar of ten red LEDs, an IR LED and an IR phototransistor side by side, a 10 k pot, a 330 ohm and a 2.2 k resistor, and a 9 V battery
The circuit as wired in the Short. Every wire end is a real pin; the netlist was checked before the video went out.

Parts

  • LM3914N bar/dot driver, DIP-18
  • 10 red 5 mm LEDs (no series resistors; the LM3914 outputs set the current)
  • IR LED, 940 nm, 5 mm
  • IR phototransistor, 5 mm
  • 330 ohm resistor, 1/4 W (for the IR LED)
  • 2.2 k resistor (sets the reference current)
  • 10 k potentiometer used as a rheostat (wiper tied to one end), set to about 7 k
  • 9 V battery

How it is wired

  1. Battery plus to LM3914 pin 3 (V+), pin 9 (MODE, tied to pin 3 for bar mode), the IR LED anode (long leg), the phototransistor collector, and all ten LED anodes.
  2. Battery minus to LM3914 pin 2 (V-), pin 4 (RLO), pin 8 (REF ADJ), the bottom of the 2.2 k resistor, the pot's free end (the end not tied to the wiper), and the bottom of the 330 ohm resistor.
  3. IR LED cathode through the 330 ohm resistor to minus.
  4. Phototransistor emitter to LM3914 pin 5 (SIG) and to the pot's wiper, which is tied to the pot's other end; so the pot sits between pin 5 and minus as a variable resistor.
  5. LM3914 pin 6 (RHI) to pin 7 (REF OUT) and to the top of the 2.2 k resistor.
  6. LED1 cathode to pin 1; LED2 to LED10 cathodes to pins 18 down to 10 (LED n on pin 20 - n).

How it works

  1. The IR LED shines invisible light forward; with 330 ohm it draws about 24 mA from the 9 V battery.
  2. Your hand bounces some of that light back into the phototransistor. The closer the hand, the more light it gets and the more current it lets through. That current flows through the pot to minus, so the voltage on pin 5 (the voltage across the pot) rises.
  3. The LM3914 compares pin 5 with a ladder of ten steps between 0 V (RLO, pin 4) and 1.25 V (RHI, pin 6, fed from its own REF OUT). Every 0.125 V more on pin 5 lights one more LED, so the bar fills from LED1 upwards.
  4. The 2.2 k resistor sets the reference current to about 0.67 mA, and each lit LED gets about ten times that, roughly 6.7 mA, so no LED resistors are needed. With all ten lit the battery gives about 95 mA.
  5. Turning the pot down lowers the voltage for the same light, so it sets how close the hand must be.

What the video simplifies

  • The hand distance and how the signal follows it are dramatised; a real IR pair only works over a few centimetres with a bright LED and a hand that reflects well.
  • The IR rays are drawn but infrared light is invisible; the LED glow, the fades, the hand speed and the sound are for the video.
  • Not drawn: the 2.2 uF supply capacitor the datasheet suggests for long LED wiring, and a power switch.
  • The 2.2 k reference resistor has no label on screen (no room).
  • The phototransistor's lead order (which leg is collector) depends on the part: check its datasheet.

All 9 V from a battery, nothing dangerous. With all ten LEDs lit the LM3914 runs warm (about half a watt), so leave it room for air. There is no switch: the IR LED alone takes about 24 mA all the time (about 28 mA with the bar dark), so unclip the battery when you are done.

Build it yourself

The wiring board has no LM3914 yet, so this one cannot be opened on it. Start with the guided first build on the wiring board, where a circuit really works as you wire it, then try the ready-made ones.

Your first circuit, step by stepAll circuits from the Shorts

Stuck, or built it?

Ask about this circuit or show your build in the Wirecora Discord. Questions get an answer every day.

Ask in the Wirecora Discord