<< Back

 

Cesky: , English:

RCLmeter

Meter for resistors, capacitors, coils, ESR, voltage and short circuit indicator, with automatic change of ranges.

RCLmeter is controlled by ATmega8 processor. It contains 3 independent meters. The RC meter measures resistance, capacitance and ESR, by measuring the charge and discharge constants of the RC circuit. It uses 8 precision reference resistors and voltage measurement by ADC converter. The inductance meter uses a resonant LC circuit with LM311D circuit, whose frequency is measured by the processor and converted to inductance. The third meter is a voltage measurement by an ADC converter. The voltage measurement is only an auxiliary function and is used to measure the residual voltage on the capacitor connected to the discharge input (the capacitor measured at the RC input must be pre-discharged through the discharge input U).

The accuracy of the ESR measurement is only indicative, to compare the quality of the capacitors (an accurate measurement would require measuring very small voltages with a long time, which similar simple circuits with processors do not allow). ESR measurements are made with as small voltages as possible, so it is possible to measure capacitors connected to the circuit. However, it is necessary to take into account the distortion of the measurement result by parasitic circuits, e.g. connected ceramic capacitors.

An additional function of the meter is a short-circuit indicator. If a resistance of less than 5 Ohms is detected, an acoustic signal sounds from the built-in speaker. The loudspeaker is also used in the indication of zeroing of the instrument by the TARE button and in the indication of the quality of the ESR resistance.

The RC measuring input can also be used to test LEDs. When an LED is connected (anode to RC input, cathode to GND), the LED flashes.

Note: Click to enlarge the images on the page

Circuit diagram and measurement method

The heart of the meter in the schematic is the ATmega8 processor. I used the stock ATmega8L, which is designed for low voltages and low frequencies, but even at 5V with 16 MHz it worked fine.

The resistor and capacitor meter uses reference resistors R1 to R8. They should, if possible, be accurate to 0.1%. The resistors are used to charge and discharge the RC circuit being measured and are switched directly by the processor outputs. The voltage on the RC circuit is measured by the ADC converter (input RC_IN).

The measured capacitor must be discharged before connecting to the RC input. The discharge input U (DISCHARGE) is used for this purpose. A power resistor of 22 kOhm/5 W is connected in parallel to the discharge input. At the same time, a zeroing current is applied to the divider (via R23), which shifts the center of the input voltage. This converts the input voltage range of -500V to +500V to a range of 0 to +5V (which is measured by the ADC).

Inductance measurement is performed by the LM311D circuit. A resonant LC circuit consisting of capacitor C1 and inductor L1 is connected to its input. The measured inductor is connected in series with inductor L1. The frequency of the circuit is measured by the processor (input L_OUT).

The TARE button is used to zero the instrument, i.e. to set the measurement ranges to zero. Its function depends on the connection of the measuring pins. If the RC input is not connected, the zero is set for the capacitance measurement (the current value of the capacitance is measured and this value is subtracted from the measured value). When the RC input is shorted to zero, the resistance measurement is reset. Shorting the L input resets the inductance measurement to zero. The voltage measurement is always zeroed.

A two-row LCD display (2x16 characters), operating in 4-bit mode, is connected to the processor. LCD two-row displays tend to be electrically compatible (usually compatibility with the Hitachi HD44780 controller is maintained), but there are differences with the pin layout. Therefore, be careful with other displays - you may have pins 15 and 16 (swapped LED- and LED+) differently against the schematic.

Resistor trimmer R18 is used to adjust the contrast of the display. It can be replaced by a single resistor 1K0, connected between pin V0 and ground.

Click on the image to enlarge...

The measurement of resistors and capacitors is done in several steps. First, it is detected whether a capacitor or resistor is connected. Charging with resistor R1 (for 2 ms) followed by a short discharge with resistor R5 takes place. If a voltage is detected on the component after 10 us, it is a capacitor. The capacitor detection is only needed to distinguish whether to measure the normal resistance or the ESR.

If it is not a capacitor, the resistance value will be measured. A fast measurement (with lower accuracy) will measure the voltage on the component with the resistors R1 to R8 connected in series. A table is used to find the limits of which resistors will give the most accurate result. For the resistors found, a slow (more accurate) voltage measurement is made and the value is converted to a resistance. The result is added to the circular buffer of the resistor filter to provide filtering (smoothing) of the results for multiple measurements. One measurement takes 65 ms, the filter length is 15 samples, and the reading should stabilize within 1 second. For rapid changes (e.g., resistor connection), the filter is reset to reflect the change immediately.

If a capacitor is detected, an ESR (Equivalent Series Resistance) measurement is performed. Connecting resistor R1 to zero first discharges the capacitor. Then all resistors are switched off and the current residual voltage is measured. The charging of resistor R1 is activated, the voltage across the capacitor is measured, the charging is switched off and the voltage is measured again. From the voltages before and after charging, calculate the mean value of the voltage that would correspond to the voltage on the ideal capacitor at the time of charging. From the difference between the mean value and the measured value, the corresponding series resistance is calculated (the measured value will be greater than the calculated mean value). If this is a valid value, the reading is added to the resistance measurement filter. If the reading is invalid (e.g. ESR greater than 100 Ohms), a standard resistance measurement is made - this is in case high resistance values can sometimes be considered as a capacitor (because the measurement is distorted by industrial interference).

Independent of capacitor detection, capacitance is always measured (capacitor detection may not be reliable, large resistor values may also be detected as capacitor, due to induced interference). First a quick (inaccurate) capacitance measurement is made, using resistors R1, R4 and R8. When measuring capacitance with one resistor, the capacitor is first discharged by grounding all resistors. The initial voltage value is measured and charging is started with the selected resistor. When a certain end voltage is reached, or after a limit time has elapsed, charging is interrupted and the end voltage is measured. The capacitor value is derived from the voltage gain and the elapsed time. From the result of the fast measurement, the 2 closest resistors are determined to give the most accurate result. A slow (accurate) measurement is made using the selected 2 resistors, the capacitor value is determined from the result and the result is stored in the circular buffer of the capacitor filter. The reading should stabilize within 1 second.

Timer 0 is used for internal timing measurements. An interrupt from the timer occurs approximately every 1 ms. When an interrupt occurs, the system time is updated (with 1 us accuracy) and if 250 ms has elapsed, the inductance measurement is updated.

The inductance measurement uses Timer 1 counter. The counter reads the pulses coming from the LC oscillator on pin T1. When an overflow occurs, the overflow counter is incremented (higher order counter). The inductance measurement is updated every 250 ms, where the elapsed time since the last update and the pulse counter status are stored. From these two readings, the oscillator frequency is calculated. From the frequency and the known value of L1 and C1, the measured inductance is derived. The calculation of inductance is done in integer mathematics and hence is done in 4 bounds to avoid overflow operations.

Surface connection and fitting

The PCB is designed as a single-sided connection with several wires.

For power supply I chose 9V AC power supply from old modem, bridge rectifier and 7805 regulator. The stabilizer requires a heat sink. To fit under the display I had to bend the fins of the heatsink, a lower heatsink is preferable. It would have been possible to use a USB power supply (from a +5V USB charger) without the need for a rectifier and stabilizer, but one would have to reckon with lower accuracy of voltage measurement. The other measured quantities do not require an accurate +5V supply voltage value (the measurement method is not voltage dependent), but good voltage smoothing is required.

A series of pins is soldered to the display and is pluggable into a connector in the PCB. I highly recommend the connector solution, rather than a wired cable connection - much easier to handle and you can swap displays easily. The difficulty you may have is with the choice of display. Electrically, the displays tend to be compatible (the controller is compatible with the Hitachi HD44780), but the pinouts may differ. The display I used has a pin layout that most closely matches the WINSTAR WH1602A-YGH-ET display - which means: the pins are located on the bottom left, in the order 14 (=DB7) ... 1 (=Vss), 16 (=K LED-), 15 (=A LED+). While you can use a different display (may even work out cheaper), you may need to change the pins on the PCB, such as reversing the pin order and moving them up.

Before assembling, check how the electronics will fit in the box in portrait mode. I used a box similar to the KM78 box, only it is a few millimeters taller. You may need to skimp on the height of the connector for the LCD (choose a lower connector - precision) and consider whether you can fit a possible heatsink stabilizer and power connector (possibly shimming the lid of the box to create more space).

I would recommend soldering the power circuits first and checking the supply voltage. After the other components are soldered, it is hard to find power supply errors or even some circuits may be damaged.

Resistors R1 to R8 should be used as accurate as possible, with 0.1% accuracy. It is also possible to use less accurate resistors (e.g. 1%), in which case it will be necessary to either assume a lower accuracy of resistors (2%) and capacitors (15%) or to calibrate the meter - i.e. write the actual resistor values into the config.h configuration file. Coil L1 and capacitor C1 should be used stable, with an accuracy of at least 5%. The resistors in voltage divider R20, R21 and R23 should also be used if possible accurate, at least 1%.

There is a hint of "ground spill" on the PCB, it is done manually, at that time I did not know how to use the automatic function yet. :-)

Bottom side (connection side):

Top side (replaced by wire connections):

Fitting of components:

Prints:

The board is attached to the bottom of the box with 2 screws at the bottom and 2 M3 spacers at the top. The KM78 box can be used, but you may need to use a lower connector for the LCD, a lower heatsink for the stabilizer and a lower power connector.

The display is attached to the bottom side with a connector and to the top side with screws to the posts. The top holes in the display may need to be widened a bit with a file to accommodate the M3 screws.

4 banana plugs are fixed into the lid of the box and a hole is cut for the display.

Printing of the box (I printed on an inkjet printer):

I glued the label on the top of the box and re-glued it with anti-abrasion adhesive.

Programming and revival

The code to program the processor in HEX or BIN format can be found in the source file package. After programming, set the fuses as follows (16 MHz crystal configuration):

low = 0xEF (11101111), high = 0xC9 (11001001).

Important - unfortunately, the entire processor code does not fit in ROM. Some tables and texts had to be placed in EEPROM. Therefore, in addition to the ROM, the contents of the EEPROM must also be programmed. In the translation using MAKEFILE, the location of the EEPROM section is set to address 0x810000, which is a standard setting expected even by common programming tools. If you know the EEPROM address used by your programming tool, you can change it in the MAKEFILE file in the parameter "-Wl,--section-start=.eeprom=0x810000". Otherwise, you can use separate binary files: the RCLmeter_rom.bin is the contents of the ROM without EEPROM, the RCLmeter_eeprom.bin is the contents of the EEPROM without ROM, and the RCLmeter.bin is the ROM and EEPROM immediately following each other (the ROM contents end at address 0x2000).

When power is applied, the display should light up as follows:

The top left is the resistance measurement reading, the top right is the capacitance measurement reading, the bottom left is the inductance measurement reading, and the bottom right is the voltage measurement reading. Resting readings may indicate a non-zero value, in which case it may be necessary to reset the meter with the TARE button. Resistance and capacitance measurement readings may skip around random values in the unconnected at rest state (resistance reading in the MOhm range, capacitance reading in the pF range) because the measurement leads pick up industrial noise (the measurement inputs are very sensitive).

If you want to modify the program, it is compiled using WinAvr 20100110 (avr-gcc 4.3.3). The installer can be downloaded e.g. from SourceForge https://sourceforge.net/projects/winavr/. The program is compiled with the command file c.bat (=compile).

Calibration

If you want to increase the measurement accuracy (or if you use less accurate components), you can calibrate the meter by setting the exact (measured) values of resistors R1 to R8 (R1_VAL to R8B_VAL) in the config.h configuration file, translating and writing the modified program to the processor. The value R8B_VAL is the value of the resistance R8 in the case of high resistance measurements (22 MOhm) - it is used to correct the characteristic in the high resistance region. Similarly, the reset values (TARE R, C, L and U), the actual value of the reference capacitor C1 (C0REF) and the reference inductor L1 (L0REF) can be set in the configuration.

The actual values of the components connected in the circuit may differ slightly from the exact values measured. Typically, the values of R1 to R8 are affected by other influences such as the output resistance of the switches. Therefore, better results can be achieved by additional configuration correction.

If you wish to refine the values of resistors R1 to R8, connect reference resistors with known exact values to the RC input so that they roughly match the value of the resistor being corrected. For example, to correct resistor R4 (with a value of 10 kOhm), connect a precision resistor of 10 kOhm to the input. Adjust the value of R4 so that the meter shows the correct result. After correcting all resistors, perform the correction again, as the resistors may slightly influence each other. For small resistors, the internal resistance of the processor switches must still be taken into account - the value R0_VAL.

Similarly, try to correct the values of L1 and C1. Use 2 coils with an exact known value, from the lower and upper end of the range. The measurement of the coil with the large value is affected more by the C1 value, the coil with the small value is affected more by the L1 value. Use multiple alternating corrections to gradually refine the L1 and C1 values.

Resistance measurement error graph:

Graphs of measurement deviation characteristics of individual resistors R1..R8B:

Measurements

The meter display is divided into 4 fields. The top left shows the measured resistance and ESR, the top right the measured capacitance, the bottom left the measured inductance and the bottom right the measured voltage.

It may be necessary to reset the measurement ranges after the instrument is powered on. The TARE button, located on the back of the instrument, is used to zero the ranges. The zeroing function depends on the connection of the measuring leads. Zeroing values are not stored in the EEPROM. If it is necessary to store them, this can be done by setting constants in the config.h configuration file.

Resistance value measurement is done by connecting the resistance between RC and GND inputs. When measuring large resistors (from tens of kOhms), a false capacitance reading (in the order of tens of nF) may be displayed at the same time - this is due to the trapping of industrial noise in the measuring leads, which is treated as residual voltage on the capacitor. At resistance values of less than 5 Ohms, an audible alarm sounds to indicate a short circuit. The RC measurement input can also be used to test LEDs. When an LED is connected (anode to RC input, cathode to GND), the LED will flash.

Capacitor value measurement is done by connecting a capacitor between RC and GND inputs.

When measuring small capacitances (units and tens of pF), more frequent zeroing with TARE may be necessary because parasitic capacitances, such as the way the measuring leads are laid or the proximity of the hands, are more apparent.

When measuring electrolytic capacitors, the + pole is connected to the RC input, the - pole to the GND input. In addition to the capacitance, the ESR (Equivalent Series Resistance) value is displayed in the upper left field. After the measured ESR value, a mark is displayed, evaluating the quality of the capacitor. At the same time, the corresponding acoustic signal sounds.

Excellent quality, ESR < 1 Ohm

Good quality, 1 Ohm <= ESR < 6 Ohm

Poor quality, ESR >= 6 Ohm

When measuring inductances, the coil to be measured is connected to the L and GND inputs. It may be necessary to zero the leads before measurement (connect the leads and press TARE).

The U and GND inputs can be used to measure voltage. The input voltage range is -500V to +500V. The input is loaded with a power resistor of 22 kOhm/5W. Normally, however, this input is not intended for voltage measurement. It is used to discharge capacitors that may be charged from the instrument to high voltages that would damage the instrument. The voltage is measured here only as an auxiliary function, to monitor the capacitor discharge status.

Downloads

Source codes of RCLmeter with firmware

Schematic diagram in Eagle Free

Graphics documents (schematic and PCB)

Complete download of RCLmeter documents

Used components

The parts selection was tailored to a GM Electronics store near me. The display I chose here is one that matches the display I used with its pins, i.e. the pins are on the bottom left. A different display (2 rows of 16 characters) should work with the same functionality, and may be cheaper, but may have a different pin layout. Typically, many displays have the pins on the top left, which will mean the PCB will need to be modified. Anyway, still try wiring the LED for the backlight (on my displays, the pins are reversed from the datasheet).

I have listed the KM78 box that is most similar to the box I used. However, the box listed is a few millimeters lower and therefore adjustments may need to be made to make the electronics fit the box in height - use a precision connector for the display, a low heat sink and a low power connector. Or pad the top of the box.

Total price for everything is 576 Kc (including box, photocuprextit, more expensive display and more expensive connector).

Miroslav Nemecek

<< Back