HomeArticlesProjectsBlogContact
Articles
In Circuit Electro-Tester
Colin Mitchell
Colin Mitchell
Make sure to subscribe to our newsletter and be the first to know the news.

Table Of Contents

01
A "Stand-alone" project using a PIC12c508A chip
02
CONSTRUCTION
03
USING THE ELECTROLYTIC TESTER
04
ELECTROLYTIC TESTER Stand-alone version PARTS LIST
05
BURNING THE PROGRAM
06
WRITING THE PROGRAM
07
Combining Hardware and Software
08
The Sub-routines
09
IF THE PROJECT DOESN'T WORK

A “Stand-alone” project using a PIC12c508A chip

  • Page 1
  • Page 2
  • Page 3
  • Page 4

CONSTRUCTION, BURNING and USING


CONSTRUCTION

This is the “Stand-alone” version. All the components fit on a small PC board. The end of the board contains a probe or tip that can touch the positive lead of an electro while it is in circuit.
The board also contains a lead on an alligator clip. This is connected to the negative rail of the project-under-test.


The top and bottom layers of the Electrolytic Tester

Two green LEDs produce a zener reference voltage for the correct operation of the circuit while 9 LEDs are used for the display. The only other components are a push button, on/off switch, 3 transistors, a chip, 4 cells, 12 resistors, 10u electrolytic, signal diode and a 100n capacitor.
Making the holders for the 4 buttons cells takes the longest time. Firstly use the very fine tinned copper wire to make the two terminals for the negative side of each cell. Pull the wire tight and solder the ends. Using the thicker tinned copper wire, make a loop to hold the cell in position. This is a single loop at the top of each cell.
Place a cell in position, against this loop and solder two wires over the cell so that they allow the cell to be slipped out, for replacing. Solder a small strap across the two wires, remove the cell and push the holding wires so the the cell slips firmly in position. Repeat with the other three cells. The process of making the cell holders may take up to an hour as it is a lot of fiddly work.
All the other components are easy to fit. The earth lead is firstly passed through the hole at the end of the board and then soldered in position.
The probe is made from the paper chip, included in the kit. Do not cut the paper clip with your side-cutters as the wire will damage the cutters. Open-out the clip and hold it in a pair of pointed-nose pliers. Bend the wire back-and-forth and it will break. Solder the paper clip to the underside of the board.The “ON” side of the switch can be painted with “white-out” and then a small amount of red nail polish. This makes the “ON” position easy to see.
Fit a pre-programmed IC or “burn” one yourself and the project is complete.

USING THE ELECTROLYTIC TESTER

Switch the project ON and some of the LEDs will flash. This is just a start-up to show the project has been turned on.
If the Electrolytic Tester is not connected to an electrolytic, the “0” LED will flash three times to indicate a “000” result. The two green LEDs will also flash.
If the project is connected to an electrolytic and switched on, it will “read” the value and provide the answer on the LEDs.
To make another reading, fit another electrolytic to the leads and push the “TEST” button until the two green LEDs illuminate. Release the button and the LEDs will display the value. It does not matter how long you hold the “Test” button after the green LEDs have illuminated, the program remembers the result.
The tester will measure values from 1u to 999u. Placing two 470u electrolytics in parallel will produce a reading of 940u (approximately).
If the tester is left on for more than 5 minutes, the display goes into an “attract mode” to remind you to turn it off.

ELECTROLYTIC TESTER Stand-alone version PARTS LIST

Cost $xx.75 plus $2.20 postage

  • 5 - 100R 1/4 watt
  • 1 - 220R ”
  • 1 - 1k ”
  • 3 - 2k2 ”
  • 1 - 10k ”
  • 1 - 22k ”
  • 1 - 100k ”
  • 1 - 100n
  • 1 - 10u
  • 2 - 3mm green LEDs
  • 9 - 3mm red LEDs
  • 1 - 1N 4148 signal diode
  • 3 - BC 547 transistors or similar
  • 1 - 8-pin IC socket
  • 1 - PC mount push switch
  • 1 - on/of slide switch
  • 1 - black crocodile clip
  • 30cm - black hook-up wire
  • 20cm - very fine solder
  • 30cm - fine tinned copper wire
  • 30cm - very fine tinned copper wire
  • 1 - paper clip for probe tip
  • 4 - LR932 cells - from a 12v lighter battery
  • 1 - PIC12c508A microcontroller (blank)
  • 1 - Electro-Tester PC board

PC Board only
$x.50 plus $2.20 postage
Pre-programmed PIC12C508A chip:
$xx.00 plus $2.20 post

Buy a kit

BURNING THE PROGRAM

The complete program for the Electrolytic Tester is shown below, including the .hex file. You will need the Multi-Chip Programmer to burn a PIC12c508A chip, plus IC_Prog.zip Programming software. Go to the Multi-Chip Programmer project for a step-by-step detail on burning the program into the chip.

WRITING THE PROGRAM

All programs should be produced in small stages called sub-routines, with each sub-routine being tested before adding the next.
If you are going to create a project similar to this or if you want to copy the project and start from scratch, here is the approach we took:
With any project, the first thing to do is connect the display to the chip and test its operation. This will give you a visual indication of the operation of the program and help you trouble-shoot each section. In this case the display is 10 LEDs. The circuit diagram shows how they are connected, plus the two gating transistors. If you are going to design with a PIC16F84, you will need to add a 4k7 and 22p ceramic to the clock-in line of the micro for the oscillator. This is all you need. A program is then written to output to each of the LEDs.
The program consists of a delay routine and a “look-up table”.
Even though you may think a particular circuit will work, it’s best to double-check by getting the micro to output to the device, just in-case you have made a mistake in the wiring or in “theory.”
Here is the test routine:

  ;ELECTROLYTIC TESTER Test routine to test the LEDs
   ;Program for PIC16F84

 Start    ORG 0x00
          BSF 03,5    ;Go to page1 for setting-up the ports
          MOVLW 00h   ;Put 00 into W
          MOVWF 06h   ;to make port 06 (RB) output
          BCF 03,5    ;Go to page0 for programming
          GOTO Main

 Table1   ADDWF 02h,1 ;Add W to Program Counter
          RETLW 21h   ;1
          RETLW 22h   ;2
          RETLW 24h   ;3
          RETLW 11h   ;4
          RETLW 12h   ;5
          RETLW 16h   ;6
          RETLW 14h   ;7
          RETLW 31h   ;8
          RETLW 32h   ;9
          RETLW 34h   ;0

    ;Delay for testing LEDs

 Delay2   MOVLW 04
          MOVWF 1C
 Delay3   DECFSZ 1Ah,1   ;Delay for main program for scanning
          GOTO Delay3
          DECFSZ 1B,1
          GOTO Delay3
          DECFSZ 1Ch,1
          GOTO Delay3
          RETURN

   ;MAIN ROUTINE

 Main   MOVLW 0A
        MOVWF 0D    ;decrementing file
        CLRF 0C
 Main1  MOVF 0Ch,0   ;Copy 0C into W
        CALL Table1
        MOVWF 06h    ;output the table value
        CALL Delay2
        INCF 0Ch,1
        DECFSZ 0D,1
        GOTO Main1
        GOTO Main

    END

When the display is working, you can use it to check each sub-routine as you add it to the program.
The next thing to do is build the circuit for the “front-end.”

Combining Hardware and Software

The most difficult part of creating a program is combining the hardware with the software. In this case the difficulty lies in the front-end. You need to know how long it takes to charge an electrolytic.

The Sub-routines

All programs consist of a number of sub-routines. Each sub-routines carries out a particular task. It is best not to make the sub-routines too small or break them up so that the micro is darting off to other sub-routines all over the page. The micro is perfectly happy doing this, but when you have to physically check a routine to try and locate a fault, fragmented program take a long time to diagnose.
In addition, it is best to use simple programming with easy to understand instructions as “clever” programming will also take a long time to decipher.
Place the sub-routines in alphabetical order, after “start” and “table” routines, with the last routine, “main”.
The first routine we will cover is “Start”.
Start. Start has an instruction: CALL Button. This sub-routine contains the instructions to set the port (the GP lines). The Alert flag (bit 7 in file 1E) is cleared and the micro goes to Main.
Alert is the last routine to be executed in the operation of the program was the last routine to be added. It creates a running LED routine on the display if the project is left ON after 5 minutes of non-use.
It is called from the main menu. File 1E is incremented each time the Main routine is cycled and when 1E is 40h, the micro goes to Alert. 1E is reset each time the Test button is activated.
There was a small “adaptation” or “adjustment” needed between the values in Table1 and the LEDs on the PC board. The zero LED on the PC board is placed after “9” but in the table it is the first data value. If the table is executed as a list, it will create a jumping-effect on the display when the “0” is encountered. This means the routine must leave out “0”.
The routine loads a file (0C) with 9 and decrements it to zero. At the same time it uses the value in 0C to select a byte of data from the table. It jumps out of the routine before the “0” byte is reached. To scan the LEDs in the opposite direction, a count file (0D) must be loaded with a value and decremented to zero. The “look-up” value for the table is file 0C (as previously) and it is zero from the previous decrementing. It is incremented so that is does not select “0” in the table and the loop is executed. This is how the “0” is avoided. The CALL Button instruction is positioned in the routine so that it is passed by the micro during the display of each LED. This makes it “fast acting” when the button is pressed.
Button routine only set the “button-press” flag, bit 7 in file 1F. To do this, one of the lines must be changed from an output to an input. The instructions in Button do this. These instructions work for both the PIC12c508A and PIC16F84 microcontrollers. This program can be used “as is” for either chip, and the two .hex files have been included below.
Charge. This sub-routine charges the electro to 3.8v as governed by the accurate voltage produced by the two green LEDs. It firstly discharges the electro, just to make sure the charge comes from this sub-routine. The discharge is not really needed.
Dis. This sub-routine discharges the electro to 0.7v through a 220R resistor. This takes a definite amount of time for each value of capacitance. The program creates a timing loop made up of the instructions at LoopX and LoopY, plus the instructions needed to load the counter files. A files is incremented and looked at to see if it is “ten” (0A). If it is ten, the file is zeroed and the next digit is incremented. This next digit must also be looked at to see if it is ten.
Delay1 is a 1/4 sec delay for the blanking time for the display. Each digit must be turned off for a short period of time just in case the next digit is the same value.
Delay2 produces the 1 second ON time for the display.
Main is the main sub-routine. The micro loops around this routine and creates the operations of the project. If 40h loops are executed without the Test button being pressed, the micro goes to Alert, and loops it until the Test button is pressed.
When the power is turned ON, the micro goes to Main and the first instruction is CALL Charge. This sub-routine charges the electro and goes to Dis where the electro is discharged and the time it takes to discharge is counted by a counter. When the micro comes back to Main, the counter files (11h, 12h, and 13h) contain the value equivalent to the microfarad value of the electrolytic. Main displays the value (hundreds first) for 1 second then blanks the screen for 1/4 second. The micro loops around Main, displaying the value of the electrolytic for 40h loops, then goes to Alert. Alert creates a “running LED” sequence on the display to tell the operator to turn off the project.

 Electrolytic Tester for 508A
    ;Program for PIC12c508A
    ;This program will also work "as is" in a PIC16F84

 Start  ORG 0x00
   CALL Button    ;To set up the port
   CLRF 1E        ;Clear the Alert flag
   GOTO Main

Table1  ADDWF 02h,1   ;Add W to Program Counter
        RETLW 34h     ;0
        RETLW 21h     ;1
        RETLW 22h     ;2
        RETLW 24h     ;3
        RETLW 11h     ;4
        RETLW 12h     ;5
        RETLW 16h     ;6
        RETLW 14h     ;7
        RETLW 31h     ;8
        RETLW 32h     ;9

   ;Running LEDs to alert user to turn OFF Project

 Alert  MOVLW 09h
        MOVWF 0Ch
 Alert1   MOVF 0Ch,0    ;Copy 0C into W
          CALL Table1
          MOVWF 06      ;Output data to LEDs
          CALL Delay1
          CLRF 06
          CALL Button
          BTFSC 1F,7
          GOTO Start    ;Button pressed
          DECFSZ 0C,1
          GOTO Alert1
          MOVLW 09
          MOVWF 0Dh     ;Decrementing file
          INCF 0Ch,1    ;Start at 1 in table
 Alert2   MOVF 0Ch,0    ;Copy 0C into W
          CALL Table1
          MOVWF 06      ;Output data to LEDs
          CALL Delay1
          INCF 0Ch,1
          CLRF 06
          CALL Button
          BTFSC 1F,7
          GOTO Start    ;Button pressed
          DECFSZ 0Dh,1
          GOTO Alert2
          GOTO Alert

   ;Button routine puts flag in file 1Fh
   ; It also sets up the port (port B) for a '508A and/or a PIC16F84

 Button   BCF 1F,7    ;Clear the button-press flag
          MOVLW 10h   ;Put 10h into W
          TRIS 06h    ;to make RB4 (GP4) input
          BTFSC 06,4  ;Is "test button" pressed?
          GOTO But2   ;Yes
 But1   MOVLW 08h     ;Put 08 into W
        TRIS 06h      ;to make RB3 (GP3) input (GP3 can only be input anyway)
        RETURN
 But2   BSF 1F,7      ;Set the button-press flag
        GOTO But1

  ;This routine charges the electro

 Charge   BCF 06,5     ;Discharge the electro before charging
          CALL Delay2
          BSF 06,5     ;Charge the electro
          CALL Delay2
          CALL Delay2
          GOTO Dis

   ;00 to 999 COUNTER  (each unit = 1u)

 Dis    CLRF 11h  ;11h is units file. Start=0
        CLRF 12h  ;12h is 10's file. Start=0
        CLRF 13h  ;13h is 100's file. Start=0
        CLRF 06   ;Make GP5 LOW to discharge electro and all other lines
        NOP       ;Give the circuit time to settle down
        NOP       ; and produce 000 readout if no
        NOP       ; electrolytic is connected
        NOP
        NOP
        NOP
 Dis1   BTFSC 06,3
        RETURN    ;Electro discharged
        MOVLW 08h
        MOVWF 1Bh
 LoopX  MOVLW 10h
        MOVWF 1A
 LoopY  DECFSZ 1Ah,1
        GOTO LoopY
        DECFSZ 1Bh,1
        GOTO LoopX
        INCF 11h,1    ;Increment the 1's file
        MOVLW 0A
        XORWF 11h,0
        BTFSS 03,2
        GOTO Dis1     ;File 11h is not 10!
        CLRF 11h      ;Zero the digits file
        INCF 12h,1    ;Increment the 10's file
        MOVLW 0A
        XORWF 12h,0
        BTFSS 03,2
        GOTO Dis1     ;File 12h is not 10!
        CLRF 12h      ;Zero file 12h
        INCF 13,1
        MOVLW 0A
        XORWF 13h,0   ;Clear 13h just in case it is over 9
        BTFSS 03,2
        GOTO Dis1
        CLRF 13h
        GOTO Dis1

 Delay1 DECFSZ 1Ah,1   ;1/4 sec Delay for OFF time
        GOTO Delay1
        DECFSZ 1B,1
        GOTO Delay1
        RETURN

 Delay2   MOVLW 04   ;1sec delay for ON time
          MOVWF 1C
 Delay3   DECFSZ 1Ah,1 ;
          GOTO Delay3
          DECFSZ 1B,1
          GOTO Delay3
          DECFSZ 1Ch,1
          GOTO Delay3
          RETURN

   ;MAIN ROUTINE

 Main   CALL Charge
 Main1  MOVF 13h,0    ;Copy hundreds into W
        CALL Table1
        MOVWF 06      ;Output the digit
        CALL Delay2   ;Show digit for 1 sec
        CLRF 06
        CALL Delay1   ;Off for 1/4 sec
        CALL Button
        BTFSC 1F,7    ;Is button pressed
        GOTO Start    ;Yes
        MOVF 12h,0    ;Copy 10's into W
        CALL Table1
        MOVWF 06
        CALL Delay2
        CLRF 06
        CALL Delay1
        CALL Button
        BTFSC 1F,7    ;Is button pressed
        GOTO Start    ;Yes
        MOVF 11h,0
        CALL Table1
        MOVWF 06
        CALL Delay2
        CLRF 06
        CALL Delay2
        INCF 1E,1     ;Increment the Alert file
        MOVLW 40h     ;Put 40h into W for 5 minutes Alert
        XORWF 1E,0
        BTFSC 03,2    ;Test zero flag. Is Alert file 40h!
        GOTO Alert    ;Yes
        CALL Button   ;No
        BTFSC 1F,7    ;Is button pressed
        GOTO Start    ;Yes
        GOTO Main1    ;No

     END

The block of numbers below is the HEX file for Electrolytic Tester-508A version. Copy and paste it into a text program such as TEXTPAD or NOTEPAD and call it: Etst508A.hex (for Electro-Tester508A version). This version is for the Electrolytic Tester project using a PIC12C508A chip.

:1000000029097E006E0AE20134082108220824082A
:10001000110812081608140831083208090C2C00BF
:100020000C0203092600600966002909FF06000A80
:10003000EC02100A090C2D00AC020C020309260088
:100040006009AC0266002909FF06000AED021D0ADC
:100050000E0AFF04100C06008606310A080C060082
:100060000008FF052E0AA6046509A60565096509AD
:10007000390A710072007300660000000000000081
:1000800000000000000066060008080C3B00100C91
:100090003A00FA02490AFB02470AB1020A0C91012E
:1000A0004307430A7100B2020A0C92014307430A54
:1000B0007200B3020A0C93014307430A7300430A18
:1000C000FA02600AFB02600A0008040C3C00FA0213
:1000D000670AFB02670AFC02670A00083309130279
:1000E000030926006509660060092909FF06000A60
:1000F0001202030926006509660060092909FF0646
:10010000000A110203092600650966006509BE029E
:10011000400C9E0143060E0A2909FF06000A6F0AD9
:00000001FF

NOTE: The block of numbers below is the HEX file for Electrolytic Tester-F84 version. Copy and paste it into a text program such as TEXTPAD or NOTEPAD and call it: EtstF84.hex (for Electro-TesterF84 version). This version is for those who have made their own circuit using a PIC16F84 chip.

:1000000029209E016E28820734342134223424347E
:1000100011341234163414343134323409308C0033
:100020000C08032086006020860129209F1B0028E1
:100030008C0B102809308D008C0A0C0803208600D8
:1000400060208C0A860129209F1B00288D0B1D280B
:100050000E289F1310306600061A312808306600FB
:1000600008009F172E2886126520861665206520B9
:1000700039289101920193018601000000000000DF
:100080000000000000008619080008309B001030B6
:100090009A009A0B49289B0B4728910A0A301106AF
:1000A000031D43289101920A0A301206031D4328BA
:1000B0009201930A0A301306031D43289301432833
:1000C0009A0B60289B0B6028080004309C009A0B58
:1000D00067289B0B67289C0B6728080033201308B0
:1000E0000320860065208601602029209F1B0028B0
:1000F00012080320860065208601602029209F1BAE
:1001000000281108032086006520860165209E0ACC
:1001100040301E0603190E2829209F1B00286F2837
:00000001FF

IF THE PROJECT DOESN’T WORK

There are 3 separate areas where a fault can develop:

  1. The circuit

  2. The Program

  3. Programming the chip.
    If your project doesn’t work, you should be happy. This is when you will start to learn electronics. It’s only by fixing a fault that you will improve your understanding of electronics.

  4. The Circuit
    If you have used one of our kits and built the project on our PC board, you should have little problem with the correctness of the circuit. Most of the problems we have had to date (20 years of Talking Electronics) have been in “junk parts” or home-made PC boards. Many “junk” resistors are 1% or 2% tolerance devices and you must look at our “1% tolerance” web page to correctly identify them. (5% resistors HERE.) Home-made PC boards are especially difficult to check as we have found. One board had a track going to the wrong pad and another had a hairline crack in one of the tracks. There are lots of other faults like un-etched copper between tracks creating shorts, borders around the edge of the board causing a short-circuit. The only solution is to buy a kit and start again.

  5. The program
    If you have developed your own program, you will have to go to our programming section(s) and follow our guide (using beep etc) until the problem has be located.

  6. Programming the chip.
    Programming the chip is the most difficult section to investigate. If you have built the Multi-Chip Programmer and burnt a ‘508A chip previously, (Logic Probe for instance), you will know the programmer works. The Watchdog Timer must be set to OFF. You can place the chip in the Programmer and read the “fuses.” You can also read the program from the chip and if you have made a (photo)copy of the .hex file from this project, you can compare the two.

Hopefully, you will have the project working by now. As a last resort, it can be sent to talking electronics for checking. If the chip is faulty we will burn a new one ($10.00) and let you know of any other faults.
The main point is this. Don’t let a faulty project beat you. It must be fixed, before you can go on to the next step.


Colin Mitchell

Colin Mitchell

Expertise

electronics
writing
PIC-Chips

Social Media

instagramtwitterwebsite

Related Posts

TODO
Transistor Test
© 2021, All Rights Reserved.

Quick Links

Advertise with usAbout UsContact Us

Social Media