A bench instrument built from an Arduino Uno, four resistors and a 16x2 LCD. It measures resistors with automatic range selection, capacitors from their RC charge time, and identifies diodes and LEDs from their forward voltage.
It is designed as a practical project for a general electronics course: each measurement is a direct application of a circuit law (voltage divider, RC charging curve, diode forward characteristic), and the maths lives in a small library that is unit-tested on a computer.
| Mode | Principle | Range |
|---|---|---|
| Resistance | Voltage divider with one of three reference resistors (680 ohm, 10 k, 470 k). The range whose reading is closest to mid-scale is used, where the divider is most sensitive | About 10 ohm to 5 Mohm |
| Capacitance | Discharge, then charge through a known resistor and time how long the node takes to reach 63.2 % of Vcc (one time constant): C = t / R | About 100 nF to several thousand uF |
| Diode | Forward voltage at about 4 mA through the 680 ohm reference; classified as Schottky, silicon, LED, short or open | 0 to 5 V |
Quantisation error of the resistance measurement computed with the firmware's own functions (lib/Measure). Each reference resistor is accurate around its own value; bestRange() switches to the one whose reading is nearest mid-scale, which keeps the error around 0.2 to 1 % across five decades. Regenerate with python docs/make_figures.py (needs g++).
D2 ──[ 680R ]──┐
D3 ──[ 10k ]──┼──── A0 (TEST) ────┐
D4 ──[ 470k ]──┤ │
D5 ──[ 220R ]──┘ (discharge) [ DUT ]
│
GND
D6 ── push button ── GND (mode select)
A4 / A5 ── LCD 16x2 I2C (SDA / SCL), address 0x27
Only one reference pin is driven HIGH at a time; the others are switched to high-impedance inputs so they do not load the node. Use 1 % resistors: the reference values set the accuracy of every measurement.
Always discharge capacitors before connecting them, and never test components that are still in a powered circuit.
git clone https://github.com/GUELORD-MWENDERWA/arduino-component-tester.git cd arduino-component-tester pio test -e native # measurement library unit tests, on your computer pio run -e uno -t upload pio device monitor
Press the button to cycle through resistor, capacitor and diode modes. Results appear on the LCD and on the serial port at 115200 baud.
Each release contains arduino-component-tester-uno.hex for the Arduino Uno (ATmega328P). Flash it without installing PlatformIO:
avrdude -p m328p -c arduino -P /dev/ttyUSB0 -b 115200 -U flash:w:arduino-component-tester-uno.hex:i
On Windows the port is COM3 or similar; avrdude ships with the Arduino IDE.
- Measure the 5 V rail with a multimeter and set
VCCinsrc/main.cpp(used for diode voltages). - Measure the actual value of each reference resistor and update
RANGE_OHMSinlib/Measure/Measure.h.
test/test_measure checks the measurement maths without hardware:
- resistance round trip from simulated ADC readings stays within 3 % from 47 ohm to 1 Mohm thanks to auto-ranging
- range selection picks the reference that keeps the ADC near mid-scale
- open and short circuits are detected
- capacitance from charge time matches C = t / (R ln(1 / (1 - k))) at 50 % and 63.2 % thresholds
- diode classification thresholds
- engineering-notation formatting without
printffloat support (not available by default on AVR)
lib/Measure/ Measurement maths and formatting (no Arduino dependency)
src/main.cpp Pin control, range switching, timing, LCD and button handling
test/test_measure/ Host-side Unity tests
- The ATmega328P ADC is 10-bit; accuracy depends mostly on the reference resistors and on the stability of the 5 V rail.
- Capacitors under about 100 nF charge faster than the ADC can sample reliably on the 10 k range.
- Electrolytic capacitor leakage slightly inflates the measured capacitance.
The firmware compiles for the Arduino Uno and the measurement library passes its unit tests on the host. It has not yet been validated against reference components on hardware.
MIT. See LICENSE.
