Tiny Continuity Tester
27th October 2025
This is a simple continuity tester, based on an ATtiny202, a piezo buzzer, and an LED, for checking circuit wiring or tracing out the tracks on a PCB:

The Tiny Continuity Tester based on an ATtiny202.
The piezo speaker is on the reverse of the board.
It has a low threshold resistance of 50Ω to avoid false positives, and passes less than 0.1mA through the circuit under test, to avoid affecting sensitive components. It's powered from a small button cell, and automatically switches itself off when not in use, avoiding the need for an on/off switch.
Introduction
I design many of my projects for my own use, and the original Continuity Tester is one of the ones I use the most, to check the connections on other projects I'm building. I recently decided to revisit the design, and in the process I've made three improvements:
- I've used a more recent AVR processor from the ATtiny 0-series range, the ATtiny202, which is easier to program by UPDI and has a slightly lower power consumption.
- I've used a slightly larger battery, the CR1025, and a battery holder which gives a more reliable connection than the wire clip used on the original.
- The circuit drives the piezo speaker in bridged mode from two outputs, to make it louder.
Features
The Tiny Continuity Tester has the same features as the original design, namely:
- Smaller and more convenient than a multimeter.
- Continuity is indicated by a piezo buzzer and an LED.
- Low threshold resistance of 50Ω, avoiding false positives due to other components in the circuit.
- Fast response, so you can drag the probe across a line of pins to detect shorts.
- Low current, to avoid affecting sensitive components in the circuit under test. This circuit passes only 100µA through the probes, which is a factor of 10 less than most multimeters.
- No on/off switch, so there's no danger of leaving it switched on and running down the battery.
The circuit automatically goes to sleep if it's unused for 60 seconds, and the standby power consumption is less than 0.04µA, giving a battery life of several years. Touch the flying lead on the probe to wake it up before doing continuity tests.
How it works
The Continuity Tester uses the Analog Comparator in the ATtiny202 to detect the voltage on the probe. The circuit is equivalent to this:

Equivalent circuit of the Tiny Continuity Tester using the ATtiny202 analogue comparator.
When the voltage on the positive pin AIN0 is higher than the voltage on the negative pin AIN1, the Analog Comparator output, ACO, is set. Assuming a 3V supply, the voltage at AIN1 is held at 3V by the pullup resistor, and the voltage at AIN0 is held at 3mV by the resistor divider. If the resistance between the probe and ground becomes less than 50Ω, the voltage on AIN1 will be lower than the voltage on AIN0, taking the output of the comparator high. This is then used to enable the oscillator driving the piezo speaker.
The advantage of using the analog comparator rather than a regular digital input is that it allows us to precisely set the point at which the input will be triggered.
In fact the two pullup resistors are unnecessary, as we can use the internal pullups on the inputs corresponding to AIN0 and AIN1. This has two benefits; first, it saves two resistors, but more importantly, it allows us to turn off the pullup on AIN0 when the processor goes to sleep, avoiding the current drain through the 50Ω resistor.
In the original circuit the piezo speaker was connected between an output and ground. In this circuit the speaker is connected between two outputs that are driven with opposite polarity, doubling the voltage swing across the speaker and giving a louder beep.
The circuit
Here's the complete circuit of the ATtiny202 version of the Tiny Continuity Tester:

Circuit of the ATtiny202-based Tiny Continuity Tester.
Processor
The circuit will work with any 8-pin device in the ATtiny 0-series or 1-series, from the ATtiny 202 up to the ATtiny402, ATtiny212, or ATtiny412.
These processors are rated down to 1.8V at a clock rate of 5MHz or lower; for this circuit I've specified a clock of 1MHz to minimise power consumption.
Coin cell
The circuit is powered by a CR1025 cell, and I found a suitable battery holder on AliExpress. The holder will also accommodate a CR927 cell which has a similar capacity.
Piezo speaker
I chose the slimmest SMD piezo speaker I could find, so the board can be the same width as the diameter of the coin cell [1]. An identical item is available from DigiKey [2].
Here's the full parts list (click to expand):
► Parts list
Construction
For the final version I designed a board in Eagle and sent it to JLCPCB for fabrication.
Components
All the components are on the front of the board, apart from the piezo speaker which is on the back:

The back of the completed Tiny Continuity Tester showing the piezo speaker.
The ATtiny202 is in an SOIC package, and the resistors and LED are 0805 SMT components, so they should be fairly easy to solder by hand.
I used a Miniware MHP50-B5 50x50mm hotplate [3] [4] set to 235°C to solder the components on the front of the board after applying dots of Chip Quik SMD291AX10T3 solder paste to the pads with a pin. I then soldered the piezo speaker on the back with a soldering iron.
Coin cell
If a child might have access to the circuit please ensure that the coin cell can't be removed, by soldering a wire across the opening or encapsulating the whole board in heatshrink tubing.
Probe
For the probe I used a dressmaking pin, with the point blunted a bit, soldered to the board.
Flying lead
For the flying lead I used flexible silicone wire [5] terminated in a crimped header pin, but you could use a ready-made lead.
The program
Piezo speaker output
The program uses Timer/Counter TCA0 in Frequency Waveform Generation mode (WGMODE_FRQ) to generate the beep through the piezo speaker. This is set up by SetupBeep():
void SetupBeep () {
PORTMUX.CTRLC = 0;
PORTA.DIRSET = PIN3_bm; // Make WO0 an output
TCA0.SINGLE.CTRLD = 0; // Normal mode
TCA0.SINGLE.CTRLA = TCA_SINGLE_CLKSEL_DIV1_gc; // Clock divided by 1
TCA0.SINGLE.CTRLB = TCA_SINGLE_CMP0EN_bm | TCA_SINGLE_WGMODE_FRQ_gc;
TCA0.SINGLE.CMP0 = 479; // Gives 1042Hz (C6)
}
One side of the piezo speaker is connected to PA3, the waveform output WO0 from the Timer/Counter. I chose the frequency that sounded loudest through the piezo speaker I was using, 1042 Hz (C6). To get this frequency with a 1 MHz clock, the compare value you need to put in the compare register CMP0 is:
Driving the piezo in bridged mode
Rather than connecting the other side of the piezo speaker to GND I connected it to PA2, which is the Event output EVOUT0, and I drove this with an inverted version of the waveform on WO0. This doubles the voltage swing across the speaker, giving four times the power output.
This is done by the routine SetupEvents(). First these lines use an event to copy the signal from PA3 to PA2:
PORTMUX.CTRLA = PORTMUX_EVOUT0_bm; // Enable EVOUT0 EVSYS.ASYNCCH0 = EVSYS_ASYNCCH0_PORTA_PIN3_gc; // PA3 to Channel0 EVSYS.ASYNCUSER8 = EVSYS_ASYNCUSER8_ASYNCCH0_gc; // Channel0 to EVOUT0
Then this line inverts the output on PA2:
PORTA.PIN2CTRL = PORT_INVEN_bm; // Invert PA2
Events are trickier to use on the ATtiny 0-series and 1-series than on the more recent AVR DA, DB, and DD series, and it took me several attempts to get this to work. For example, I had to study the datasheet to realise that you have to refer to the Event output EVOUT0 as ASYNCUSER8, and that you have to enable it in PORTMUX for it to work.
Probe input
The Tiny Continuity Tester probe is connected to the negative input of the Analogue Comparator, PA6, and a reference voltage is connected to the positive input, PA7. The reference voltage is produced by a voltage divider, consisting of the 51Ω resistor and an input pullup.
An input pullup is also set on the probe input, as well as a pin-change interrupt. These are configured in setup():
PORTA.PIN7CTRL = PORT_PULLUPEN_bm; // Reference input PORTA.PIN6CTRL = PORT_PULLUPEN_bm | PORT_ISC_FALLING_gc; // Interrupt falling edge
An interrupt on the Probe input calls an interrupt service routine that resets the sleep timer, and will also wake up the processor from sleep:
ISR (PORTA_PORT_vect) {
Time = millis();
PORTA.INTFLAGS = PIN6_bm; // Clear interrupt flag
}
Main loop
The main loop, loop(), then repeatedly checks the analog comparator status register, AC0.STATUS, and calls Beep() if the comparator is enabled:
bool Continuity = AC0.STATUS & AC_STATE_bm; if (Continuity) Beep(); else NoBeep();
The routines Beep() and NoBeep() simply enable or disable Timer/Counter TCA0, and enable or disable the LED:
void Beep () {
TCA0.SINGLE.CTRLA = TCA0.SINGLE.CTRLA | TCA_SINGLE_ENABLE_bm;
PORTA.OUTSET = PIN1_bm; // LED on
}
void NoBeep () {
TCA0.SINGLE.CTRLA = TCA0.SINGLE.CTRLA & ~TCA_SINGLE_ENABLE_bm;
PORTA.OUTCLR = PIN1_bm; // LED off
}
Sleep
To avoid the need for an on/off switch the circuit automatically puts the processor to sleep if more than 60 seconds have elapsed, specified by the constant Timeout. This is handled by the following code in loop():
if (millis() - Time > Timeout) {
PORTA.PIN7CTRL = 0; // Pullup off saves power
NoBeep(); // LED and beep off
sleep_enable();
sleep_cpu();
// Carry on here when we wake up
PORTA.PIN7CTRL = PORT_PULLUPEN_bm; // Reference pullup on
}
Before putting the processor to sleep this code disables the Reference pullup resistor to save power. A low-going level on the probe, even if it's not low enough resistance to activate the comparator, will generate a pin-change interrupt and reset the timer, or wake up the processor if it's asleep.
Compiling the program
Compile the program using Spence Konde's megaTiny Core on GitHub. Choose the ATtiny412/402/212/202 option under the megaTinyCore heading on the Board menu. Check that the subsequent options are set as follows (leave any other options at their default settings):
Chip: "ATtiny202" (or as appropriate if you're using a different chip)
Clock: "1 MHz internal"
millis()/micros() Timer: TCB0 (breaks tone() and Servo)
The clock is set to 1 MHz rather than the default 20 MHz to minimise the power consumption; if you forget to set this, only your dog will be able to hear the beep.
The millis()/micros() Timer is set to TCB0 rather than the default TCA0 because we're using TCA0 for the piezo beep. If you don't set this correctly the circuit will still work, but it won't automatically go to sleep, and the battery won't last as long as expected.
To program the processor the recommended option is to use a 5V or 3.3V USB to Serial board, such as the SparkFun FTDI Basic board [6], or a USB to Serial cable [7], connected with a Schottky diode as follows. You can substitute a 4.7kΩ resistor for the Schottky diode:

Connect the +5V/+3.3V, GND, and UPDI pins to the three terminals on the bottom edge of the Walkie-Textie. I held three pins in contact with the terminals to avoid the need to permanently solder a header to the board. If there's a coin cell in the board leave the +5V/+3.3V connection unconnected. Then proceed as follows:
- Set Programmer to "SerialUPDI - 230400 baud".
- Select the USB port corresponding to the USB to Serial board in the Port menu.
- Choose Upload from the Arduino IDE Tools menu to upload the program.
Resources
Here's the whole Tiny Continuity Tester program: Tiny Continuity Tester Program.
Get the Eagle or Gerber files for the PCB on GitHub here: Tiny Continuity Tester.
Or order a board from OSH Park here: Tiny Continuity Tester.
- ^ Kingstate KMTG1102-A1 on Farnell.
- ^ Same Sky CMT-1102-SMT-TR on DigiKey.
- ^ MHP50-B5 on Adafruit.
- ^ MHP50-B5 on AliExpress.
- ^ Silicone Cover Stranded-Core Wire - 26AWG Red on The Pi Hut.
- ^ SparkFun FTDI Basic Breakout - 5V on Sparkfun.
- ^ FTDI Serial TTL-232 USB Cable on Adafruit.
blog comments powered by Disqus
