Community project

Dual-Channel Resistance Tester

Photo of Dual-Channel Resistance Tester
Generated with AI

Shaikh M.Umar

Published November 24, 2026

This dual-channel resistance tester measures two independent resistive inputs and displays their values on an SSD1306 OLED screen. Channel 1 measures resistances from 1 to 200 ohms, while Channel 2 handles the 1k to 200k ohm range, making it useful for testing photoresistors, thermistors, and other variable resistors in maker projects.

The guide provides a complete parts list, wiring diagram showing how to connect the OLED display and build the two measurement channels using voltage dividers, and the Arduino firmware for the ESP32 that calculates resistance values and renders them with logarithmic gauge displays. Assembly takes about 30 minutes and requires only basic soldering skills.

Wiring diagram

Wiring diagram for Dual-Channel Resistance Tester
Loading diagram…

Gather all the parts

QtyComponent
1

SSD1306 OLED

0.96-inch 128 x 64 white monochrome OLED display module driven by an SSD1306 controller over I2C (address 0x3C). It runs from 3 V to 5 V and connects through a 4-pin 2.54 mm header (GND, VCC, SCL, SDA); the self-emitting pixels need no backlight.

1

Photo Cell (CdS Photoresistor)

CdS light-dependent resistor. Resistance decreases as light increases. Adafruit product 161 currently specifies approximately 1 kΩ in light and 10 kΩ in dark. Use either symmetric lead in a voltage divider and read the divider with an analog input.

1

Resistor

150 Ω

Through-hole resistor (current-limiting in series with an LED)

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

1

Photo Cell (CdS Photoresistor)

CdS light-dependent resistor. Resistance decreases as light increases. Adafruit product 161 currently specifies approximately 1 kΩ in light and 10 kΩ in dark. Use either symmetric lead in a voltage divider and read the divider with an analog input.

1

Resistor

150 kΩ

Through-hole resistor (current-limiting in series with an LED)

1

Ceramic Capacitor

100 nF

Through-hole ceramic capacitor bought by value, such as 22 pF, 10 nF or 100 nF (0.1 µF). It is non-polarised, so either lead can go to either net. Its most common job is decoupling: a 100 nF capacitor between an IC's supply pin and ground, placed as close to the chip as possible.

Assemble it in 3 steps

1. Connect the OLED

With USB unplugged, connect the 0.96-inch SSD1306 OLED. VCC goes to 3V3, GND to GND, SDA (data) to GPIO0 and SCL (clock) to GPIO1. Follow the labels on your screen, not the order of the pins.

2. Build the R1 input

Connect one LDR leg to GND and the other to GPIO3. Connect a 150 Ω resistor from 3V3 to GPIO3, and a 100 nF capacitor from GPIO3 to GND.

  • Only connect loose, unpowered parts to the test inputs.

3. Build the R2 input

Connect one LDR leg to GND and the other to GPIO4. Connect a 150 kΩ resistor from 3V3 to GPIO4, and a 100 nF capacitor from GPIO4 to GND.

  • Only connect loose, unpowered parts to the test inputs.

Review all connections

1. Connections between "oled" and "ESP32"

FunctionoledESP32
powerVCC3V3
groundGNDGND
i2cSDAGPIO 0
i2cSCLGPIO 1

2. Connections between "ldr1" and "ESP32"

Functionldr1ESP32
groundTerminal 1GND
passiveTerminal 2 → Resistor P2EXT

3. Connections between "top1" and "ESP32"

Functiontop1ESP32
powerP13V3
digitalP2GPIO 3

4. Connections between "filter1" and "ESP32"

Functionfilter1ESP32
digital1 → Resistor P2EXT
ground2GND

5. Connections between "ldr2" and "ESP32"

Functionldr2ESP32
groundTerminal 1GND
passiveTerminal 2 → Resistor P2EXT

6. Connections between "top2" and "ESP32"

Functiontop2ESP32
powerP13V3
digitalP2GPIO 4

7. Connections between "filter2" and "ESP32"

Functionfilter2ESP32
digital1 → Resistor P2EXT
ground2GND

Deploy the firmware

#include <Arduino.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <math.h>
#include <string.h>

constexpr int SDA_PIN=0, SCL_PIN=1, R1_PIN=3, R2_PIN=4;
// Measure 3V3 relative to GND under USB power; replace this default if needed.
constexpr float SUPPLY_MV=3300.0f;
Adafruit_SSD1306 oled(128,64,&Wire,-1);
struct Channel { float top, low, high; };
constexpr Channel r1={150,1,200};
constexpr Channel r2={150000,1000,200000};

float resistance(float adc, const Channel &c) {
  if(adc>=SUPPLY_MV) return INFINITY;
  return c.top*adc/(SUPPLY_MV-adc);
}
struct Gauge { char text[12]; int tick; };
Gauge gauge(float ohms, const Channel &c, bool kilo) {
  Gauge g={};
  float f=logf(constrain(ohms,c.low,c.high)/c.low)/logf(c.high/c.low);
  g.tick=lroundf(f*24);
  const char *unit=kilo?"k":"";
  const char *prefix=ohms<c.low?"<":ohms>c.high?">":"";
  const float value=constrain(ohms,c.low,c.high)/(kilo?1000.0f:1.0f);
  snprintf(g.text,sizeof(g.text),value<10?"%s%.2f%s":"%s%.1f%s",prefix,value,unit);
  return g;
}
void centered(int x,int y,const char *s) {
  oled.setCursor(x-int(strlen(s))*3,y); oled.print(s);
}
void draw(int x,const char *name,const Gauge &g) {
  int px=x-27, py=41;
  for(int i=1;i<=24;++i){
    const float a=PI*(24-i)/24;
    int nx=x+lroundf(27*cosf(a)),ny=41-lroundf(27*sinf(a));
    oled.drawLine(px,py,nx,ny,SSD1306_WHITE); px=nx;py=ny;
  }
  const float a=PI*(24-g.tick)/24;
  oled.drawLine(x,41,x+lroundf(23*cosf(a)),41-lroundf(23*sinf(a)),SSD1306_WHITE);
  centered(x,1,name); centered(x,46,g.text); centered(x,56,"ohms");
}
void setup(){
  analogReadResolution(12);
  analogSetPinAttenuation(R1_PIN,ADC_11db);
  analogSetPinAttenuation(R2_PIN,ADC_11db);
  Wire.begin(SDA_PIN,SCL_PIN);
  if(!oled.begin(SSD1306_SWITCHCAPVCC,0x3C,true,false)) while(true) delay(1000);
  oled.setTextColor(SSD1306_WHITE);
  oled.setTextWrap(false);
}
void loop(){
  unsigned long a=0,b=0;
  for(int i=0;i<64;++i){
    analogReadMilliVolts(R1_PIN); a+=analogReadMilliVolts(R1_PIN);
    analogReadMilliVolts(R2_PIN); b+=analogReadMilliVolts(R2_PIN);
    delayMicroseconds(350);
  }
  const Gauge g1=gauge(resistance(a/64.0f,r1),r1,false);
  const Gauge g2=gauge(resistance(b/64.0f,r2),r2,true);
  static Gauge old1={},old2={};
  if(g1.tick!=old1.tick || g2.tick!=old2.tick || strcmp(g1.text,old1.text) || strcmp(g2.text,old2.text)){
    oled.clearDisplay(); draw(31,"R1",g1); draw(96,"R2",g2); oled.display();
    old1=g1; old2=g2;
  }
  delay(130);
}

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik