You are on page 1of 10

How to adjust electronic components tester to get more accuracy

(related to ATmega8 components tester project. Also known as transistor tester)

.
Many thanks to Mr. Smaeel.
(smartb7@yahoo.com).
Who is provided this article.

I built AVR components tester , it works very good. Identifying transistors pins names and type of them,
Measuring components was as well as such details that its designer MR. Markus_F written on:
http://www.mikrocontroller.net/articles/AVRTransistortester
but in measuring capacitors , I faced a problem.
No problem with transistors identification but inaccuracy in measuring capacitors.
It gave 1.5 times more reading in measuring CAPs.
For example it read 1.5NF for 1NF or 150F for 100F.and so on for other ranges.
I checked my circuit. No error found.
After reading many pages I found out this problem caused by using ATmega8A instead of ATmega8.
In one section in the author webpage, this problem reported by some users.

Mr.Karkus_F advised for fixing this problem, it is necessary to change capacitor factors.
I did those changes and after some practice , the result became very good and accurate.
So, I wrote this article to show you visually by examples if faced same problem, to know what to do.
. .
, 1.5 .
100 150 1 1.5 .

ATmega8 ATmega8A .
.
.
. .
.
.

here is the solution:


Open source code. It is written in C language.
There are 4 commands in code.
2 of them determine capacitors value and 2 others determine resistors values.
There are also 4 numbers in those commands. Actually they are co ecient for resistors and capacitors.
:
. C .
4 .
2 .
4 . .
Here:
*****************************************************

***********************************************************************************
Notice to commands:
unsigned int H_CAPACITY_FACTOR EEMEM = 394
changing above number, normally change low value reading of capacitors . normally for capacitors

under 1 microfarad.

. 1 , 394

unsigned int L_CAPACITY_FACTOR EEMEM = 283


changing above number ,normally change high value reading of capacitors. Normally for capacitors

upper 10 microfarad.

. 10 , 283
. . , , ,
Increasing will increase and decreasing will decrease.
All factors act individually.

So, if you have same problem in reading capacitors and your device reads 1.5 times more than expected value,
You have to change those numbers in two commands that mentioned above.
But how to change?

You have two options.

First: by using some software such as "code vision AVR" or "AVR studio" .
Open main.c file. Find those commands shown above. Change numbers, compile file and use it.
If you want more accuracy in reading , you must do changes several times and reach to accuracy by changes and experiments.
This way takes much times.
Second: There is another way to do these changes.
do changes directly into HEX code.
But how?
:
main.c , AVR studio code vision AVR
.
.
.
As you know, ponyprog is a free AVR programmer software.
Open eep file and do changes here:
. ponyprog
. eep

Number 394 is decimal and when convert to HEX becomes 18A.

(01 8A)

Number 283 is decimal and when converts to Hex becomes 11B. (01 1B)
As you see these are exactly same as codes in eep file.
. hex 283 394
. eep

ponyprog .
394 265 . 283 190.
.
.
. :
You can change them directly in ponyprog or other software and no need to use compiler.
Let me give you some examples:
Here instead of 394 I want to change it to 265.
And instead of 283 I want to write 190.
First we must convert them to hex.
Many free converter available on the net even some websites which present it online for free.
Choose one and do the conversion.
Like this:

As you see above. 265 in decimal = 109 in hex or 0109


265 .

As you see again. 190 in decimal = BE in hex or 00BE.


Ok. Time to use it in eep file.
Open edit section and click on "edit buffer enabled".
. 190
. . eep
. edit buffer enabled edit

Now, right click on each hex code will shows edit screen and you can do change.
Write proper hex value in its box and click ok to see change in hex code.
. OK . edit . ,

You want to write 265 ( 01 09 ) instead of 394 ( 01 8A).


See below picture:
265 394 . :

In above procedure we wrote 265.


265 . .
) Now we writ 190. ( 00 BE

As you see in below picture, we did desired changes.


Now it is ready to program microcontroller.(atmega8)
Just click write to device ( program it).
. .

You can choose another number to set your device more accurate.
It is up to you to choose what number but procedure is like I said above.
If your tester reads 1.5 times more, then choose 265 and 190.
Because these numbers until know were better in making device more accurate.
.
. 190 265 , 1.5
.
Any suggestion or advise, is welcome.
Thanks for your time
My email address: smartb7@yahoo.com
Provided by: smaeel
20 November 2011
Iran , Tehran city
. ,
smartb7@yahoo.com :

:
1390 20

You might also like