Logic probe with three LEDs
A probe shows high, low or floating states of a digital pin using three LEDs.
Build it step by step
0 of 8 doneWire the divider
Two 10 kilohm resistors to A0, one to 5V, one to GND.
Wire the three LEDs
Red D4, green D5, yellow D6, each with 220 ohm.
Add the probe wire and ground clip
Probe on A0, ground clip on GND.
Upload the sketch
With the probe in the air, yellow is on.
Touch the probe to 5V
Green lights.
Touch it to GND
Red lights.
Probe the LED pin of another board running Blink
Red and green blink together as a pulse.
Probe a 3.3 V pin
Green lights.
How do you build a logic probe with three LEDs?
A probe shows high, low or floating states of a digital pin using three LEDs. You need Arduino Nano, LED 5 mm red, LED 5 mm green, LED 5 mm yellow, Resistor 220 Ω × 3, Resistor 10 kΩ × 2, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 8 steps and about 120 minutes.
- Level
- Beginner
- Time
- About 120 min
- Parts
- 8
Parts list
- Development BoardsBuyArduino Nano × 1
- SemiconductorsBuyLED 5 mm red × 1
- SemiconductorsBuyLED 5 mm green × 1
- SemiconductorsBuyLED 5 mm yellow × 1
- PassivesBuyResistor 220 Ω × 3
- PassivesBuyResistor 10 kΩ × 2
- PrototypingBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Probe tip wire | Nano A0 | Touch this to the pin you are testing |
| 10 kilohm from 5V to A0 | Nano A0 | Pulls a floating pin up to the middle |
| 10 kilohm from A0 to GND | Nano A0 | Together they hold an open probe near 2.5 V |
| Red LED plus through 220 ohm | Nano D4 | Low |
| Green LED plus through 220 ohm | Nano D5 | High |
| Yellow LED plus through 220 ohm | Nano D6 | Floating or in between |
| LED minus legs | Nano GND | Common ground |
| Probe ground clip | Nano GND | Join to the circuit under test |
Code
A digital pin is normally either high or low, but an unconnected pin is neither: it floats and picks up noise. Two equal 10 kilohm resistors hold an open probe at about 2.5 V, which falls between the low and high limits, so the yellow LED shows floating, a broken wire or a tri-stated output. A driven output is much stiffer than the 5 kilohm divider, so it overrides it and the reading goes high or low as expected. The sketch uses 0.8 V and 2.9 V as the limits so it works for 5 V logic and for 3.3 V logic, where a high is about 3.3 V. The Nano reads the pin as fast as it can for 60 milliseconds, and if it sees both high and low in that window it shows red and green together to tell you the signal is pulsing, such as a PWM or clock line. This probe is for 5 V and 3.3 V logic only. Never touch it to mains, a motor supply or anything above 5 V.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const uint8_t PIN_PROBE = A0;
const uint8_t LED_LOW = 4; // red
const uint8_t LED_HIGH = 5; // green
const uint8_t LED_MID = 6; // yellow
// Thresholds in ADC counts (5 V reference, 1023 counts).
const int LOW_MAX = 164; // below about 0.8 V counts as low
const int HIGH_MIN = 594; // above about 2.9 V counts as high (works for 3.3 V and 5 V logic)
void setup() {
pinMode(LED_LOW, OUTPUT);
pinMode(LED_HIGH, OUTPUT);
pinMode(LED_MID, OUTPUT);
}
void loop() {
bool sawLow = false, sawHigh = false;
unsigned long t0 = millis();
while (millis() - t0 < 60) { // watch for 60 ms, long enough to catch slow pulses
int v = analogRead(PIN_PROBE); // about 110 microseconds per reading
if (v <= LOW_MAX) sawLow = true;
else if (v >= HIGH_MIN) sawHigh = true;
}
int last = analogRead(PIN_PROBE);
if (sawLow && sawHigh) { // a pulse train: show both red and green
digitalWrite(LED_LOW, HIGH);
digitalWrite(LED_HIGH, HIGH);
digitalWrite(LED_MID, LOW);
} else if (last <= LOW_MAX) {
digitalWrite(LED_LOW, HIGH); digitalWrite(LED_HIGH, LOW); digitalWrite(LED_MID, LOW);
} else if (last >= HIGH_MIN) {
digitalWrite(LED_LOW, LOW); digitalWrite(LED_HIGH, HIGH); digitalWrite(LED_MID, LOW);
} else {
digitalWrite(LED_LOW, LOW); digitalWrite(LED_HIGH, LOW); digitalWrite(LED_MID, HIGH);
}
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Probe open in the air | Yellow on |
| Probe on 5V | Green only |
| Probe on GND | Red only |
| Probe on a 3.3 V logic high | Green only |
| Probe on a fast PWM pin | Red and green on together |
If it does not work
Always yellow
The probe is not reaching a driven pin, or the ground clip is not joined.
Red and green flicker when touching 5V
Check for a loose probe connection.
Open probe shows green or red
One divider resistor is the wrong value or missing.
3.3 V high shows yellow
Check the supply is really 3.3 V and lower HIGH_MIN a little.
Slow pulses seem steady
Increase the 60 ms watch window to catch slower signals.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the logic probe with three LEDs?
Arduino Nano, LED 5 mm red, LED 5 mm green, LED 5 mm yellow, Resistor 220 Ω × 3, Resistor 10 kΩ × 2, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).
How long does the logic probe with three LEDs take to build?
About 120 minutes for a beginner maker, in 8 steps.
How do I know the logic probe with three LEDs works?
Probe open in the air: Yellow on. Probe on 5V: Green only. Probe on GND: Red only.
Always yellow: what should I check?
The probe is not reaching a driven pin, or the ground clip is not joined.
Red and green flicker when touching 5V: what should I check?
Check for a loose probe connection.
Open probe shows green or red: what should I check?
One divider resistor is the wrong value or missing.
3.3 V high shows yellow: what should I check?
Check the supply is really 3.3 V and lower HIGH_MIN a little.
