Measurements and tests

The routines to read a pot have been tried out and they works really well.

A pic 16F84 has been programmed to measure A and B, and the ratio is scaled to a value between 0 to 300.

For the results below, the Chip was programmed with VTMR001.asm which has a routine that measures A, then half a second later measures B, the result is then scaled and output using a simple RS232 routine.

My PIC chip outputs the values ( in HEX ) of A, B and the scaled values:

tA:A+B=SUM:min<meas<Max:Scaled values
t13:13+AE=C1:00<13<C1:001C,0000:
t13:13+AE=C1:00<13<C1:001C,0000:
t13:13+AE=C1:00<13<C1:001C,0000:

I use an AWK script to convert these to a .CSV file, suitable to import into Excel.

The graph below shows the stable values plotted against the measured A value. The chip calculates the scaled value using the MRcalcABdivC routine. This calculates A/(A+B)*300 = scaled.

Generaly A+B is a constant, but sometimes where the Pot gets dirty, the Value of A&B increases, however, this does not affect the scaled value too much.

The next graph shows the effect of changing the battery voltage, The chip was powered by either 2 or 3 AA ni cads cells.

I made measurements of the pot position with the Chip powered by 2 cells then three cells, I then changed the pot position. The value of sum was different with 3 cells to that with 2 cells. However, the ratio of A/B for a given pot position remains reasonably constant.

Here is the capture from the RS232 output. I changed the pot position and then used 2 to 3 cells to power the PIC chip. The calculated value e.g :0114, does not change by more than a couple of values.
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
t97:97+0D=A4:00<97<A4:0q14,020D:
wð
; Change pot 
; - three AA cells
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
tB2:B2+0F=C1:00<B2<C1:0114,020D:
; - two AA cells
t97:97+0D=A4:00<97<A4:0114,020D:
t97:97+0D=A4:00<97<A4:0114,020D:
t97:97+0D=A4:00<97<A4:0114,02A4:0114,020D:
t97:97+0D=A4:00<97<A4:0114,020D:
t97:97+0D=A4:00<97<A4:0114,020D:


t97:97+0D=A4:00<97<A4:01à
; Change pot 
; - three AA cells
t9F:9F+22=C1:00<9F<C1:00F6,020D:
t9F:9F+22=C1:00<9F<C1:00F6,020D:
t9F:9F+22=C1:00<9F<C1:00F6,020D:
t9F:9F+22=C1:00<9F<C1:00F6,020D:

; - two AA cells
tÿà
t87:87+1C=A3:00<87<A3:00FA,020D:
t87:87+1C=A3:00<87<A3:00FA,020D:
t87:87+1C=A3:00<87<A3:00FA,020D:
t87:87+1C=A3:00<87<A3:00FA,020D:
t87:87+1C=A3:00<87<A3:00FA,020D:
t87:8·wý÷ÿà

; Change pot 
; - three AA cells for a few measurements then two cells
t8E:8E+33=C1:00<8E<C1:00DB,020D:
t8E:8E+33=C1:00<8E<C1:00DB,020D:
t8E:8E+33=C1:00<8E<C1:00DB,020D:
t8E:8E+33=C1:00<8E<C1:00DB,020D:
t8E:8E+33=C1:00<8E<C1:00DB,020D:?à
t45:45+2C=71:00<45<71:00B8,020D:
t79:79+2B=A4:00<79<A4:00DD,020D:
t79:79+2B=A4:00<79<A4:00DD,020D:
t79:79+2B=A4:00<79<A4:00DD,020D:
t79:79+2B=A4:00<79<A4:00DD,020D:
t79:79+2B=A4:00<79<A4:00DD,020D:
t79:79+2B=A4:00<79<A4:00DD,4B1D:
t79:79+2B=A4:00<79<A4:00DD,4B1D:
t79:79+2B=A4:00<79<A4:00DD,4B1D:
t77:77+2B=A2:00<77<A2:00DB,4B1D:

; Change pot 
; - three AA cells for a few measurements then two cells
t68:68+32=9A:00<68<9A:00CB,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4Bñfòïÿ@ÿ
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:
t6B:6B+38=A3:00<6B<A3:00C5,4B1D:

; Change pot 
; - three AA cells for a few measurements then two cells
t6B:6B+38=A3:00<à
twð
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7D:7D+40=BD:00<7D<BD:00C9,4B1D:
t7E:7E+41=BF:00<7E<BF:00C9,4B1D:
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7D:7D+42=BF:00<7D<BF:00C7,4B1D:
t7E:7E+42=C0:00<7E<C0:00C2,4B1D:


; Change pot 
; - two AA cells for a few measurements then three AA cells
t58:58+4B=A3:00<58<A3:00A2,4B1D:
t59:59+4B=A4:00<59<A4:00A2,4B1D:
t58:58+4B=A3:00<58<A3:00A2,4B1D:
t58:58+4B=A3:00<58<A3:00A2,4B1D:
t58:58+4B=A3:00<58<A3:00A2,4B1D:
t41:41+58=99:00<41<99:0080,6B15:ÿèà
t68:68+58=C0:00<68<C0:00A2,6B15:
t68:68+58=C0:00<68<C0:00A2,6B15:
t68:68+58=C0:00<68<C0:00A2,6B15:
t68:68+58=C0:00<68<C0:00A2,6B15:
t68:68+58=C0:00<68<C0:00A2,6B15:
t68:68+58=C0:00<68<C0:00A2,6B15:

; Change pot 
; - two AA cells for a few measurements then three AA cells
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t48:48+7A=C2:00<48<C2:006D,6B15:
t48:48+7A=C2:00<48<C2:006D,6B15:
t48:48+7A=C2:00<48<C2:006D,6B15:
t48:48+7A=C2:00<48<C2:006D,6B15:
t48:48+7A=C2:00<48<C2:006D,6B15:
t48:ô
t3E:3E+68=A6:00<3E<A6:0071,6B15:
t3D:3D+68=A5:00<3D<A5:006D,6B15:
t3D:3D+68=A5:00<3D<A5:006D,6B15:


; Change pot 
; - two AA cells for a few measurements then three AA cells
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+65=91:00<2C<91:005B,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t34:34+8C=C0:00<34<C0:0050,7B16:
t2C:2C+42=6E:00<2C<6E:007C,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2C:2C+77=A3:00<2C<A3:0052,7B16:
t2A:2A+6D=97:00<2A<97:0055,7B16:Úà


; Change pot 
; - two AA cells for a few measurements then three AA cells
t22:22+89=AB:00<22<AB:003C,7B16:
t22:22+9F=C1:00<22<C1:0033,7B16:
t22:22+9A=BC:00<22<BC:0035,7B16:
t22:22+A0=C2:00<22<C2:0033,7B16:
t22:22+A0=C2:00<22<C2:0033,7B16:
t22:22+A0=C2:00<22<C2:0033,7B16:
t22:22+A0=C2:00<22<C2:0033,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:
t1D:1D+88=A5:00<1D<A5:0035,7B16:

; Change pot 
; - two AA cells for a few measurements then three AA cells
t13:13+8E=A1:00<13<A1:0022,7B16:à
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
t0C:0C+B7=C3:00<0C<C3:0010,7B16:
ùoø
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:
t0A:0A+9C=A6:00<0A<A6:0010,7B16:

; Change pot 
; - two AA cells for a few measurements then three AA cells
t03:03+BB=BE:00<03<BE:0005,7B16:
t03:03+BB=BE:00<03<BE:0005,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003,7B16:
t02:02+BB=BD:00<02<BD:0003üà
t02:02+87=89:00<02<89:0°à
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+9E=A0:00<02<A0:0003,7B16:
t02:02+84=86:00<02<86:0003,7B16:
t01:01+93=94:00<01<94:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:

; Change pot 
; - two AA cells for a few measurements then three AA cells
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
t00:00+B9=B9:00<00<B9:0000,7B16:
tÿà
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
tðª
t01:01+9D=9E:00<01<9Eösò
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:
t01:01+9D=9E:00<01<9E:0001,7B16:

; Change pot 
; - two AA cells for a few measurements then three AA cells
t15:15+5A=6F:00<15<6F:003E,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:007A,7B16:
t43:43+61=A4:00<43<A4:00ÿà
t4F:4F+72=C1:00<4F<C1:007A,7B16:
t4F:4F+72=C1:00<4F<C1:007A,7B16:
t4F:4F+72=C1:00<4F<C1:007A,7B16:
t4F:4F+72=C1:00<4F<C1:007A,7B16:
t4F:4F+72=C1:00<4F<C1:007A,7B16:

The techniques described on this web page make the use of a pot with a PIC chip much less hit and miss. It shows how tolerences in components can be calibrated out.

some thoughts and ideas...

first page...

Doug Rice, 13th July 2001.