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.

Smaeel. (smartb7@yahoo.com). Who is provided this article. I built AVR components tester , it works very

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
1.5

times more reading in measuring CAPs.

For example it read 1.5NF for 1NF or 150µF for 100µF.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 ATmega8

A
A

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 ار راﺪﻘﻣ , نزﺎﺧ ﺖﻴﻓﺮﻇ یﺮﻴﮔ ﻩزاﺪﻥا رد ﺎﻣا

.ﻩﺮﻴﻏ و دارﺎﻓﻮﻥﺎﻥ 1.5 ﺖﺷﻮﻥ ﯽﻣ دارﺎﻓﻮﻥﺎﻥ 1 یاﺮﺑ و 150 ﺖﺷﻮﻥ ﯽﻣ دارﺎﻓوﺮﮑﻴﻣ 100 یاﺮﺑ ﻼﺜﻣ

ﯽﻠﺻا راﺪﻣ ﻪﮐ ﺖﺱا ﻦﻳا زا لﺎﮑﺷا مﺪﺷ ﻪﺟﻮﺘﻣ و مدﺮﮐ ﻪﻌﻟﺎﻄﻣ راﺪﻣ ﻦﻳا ﻪﺑ طﻮﺑﺮﻣ ﺖﻥﺮﺘﻨﻳا رد ار یدﺎﻳز تﺎﺤﻔﺻ

.ما ﻩدﺮﮐ ﻩدﺎﻔﺘﺱا راﺪﻣ ﻦﻳا رد ATmega8

A
A

وﺮﮑﻴﻣ زا ﻦﻣ ﺎﻣا ﺪﻨﮐ ﯽﻣ ﻩدﺎﻔﺘﺱا ﺪﻥﻮﺴﭘ نوﺪﺑ ATmega8 وﺮﮑﻴﻣ زا

.ﺪﻥراد فﻼﺘﺧا ﻢه ﺎﺑ یراﺪﻘﻣ وﺮﮑﻴﻣ عﻮﻥ ود نﻮﭼ دﻮﺑ ﻩﺪﺷ نزﺎﺧ ﺖﻴﻓﺮﻇ یﺮﻴﮔ ﻩزاﺪﻥا رد ﺎﻄﺧ ﺚﻋﺎﺑ ﻦﻳا

.ﺮﺼﺘﺨﻣ رﺎﻴﺴﺑ ﺎﻣا دﻮﺑ ﻩﺪﺷ ﻪﺋارا ﻞﮑﺸﻣ ﻦﻳا ﻞﺡ یاﺮﺑ یرﺎﮑهار ﯽﻠﺻا ﺖﻳﺎﺱ رد

.ﺪﺷ ﻊﻓر ﻞﮑﺸﻣ و بﻮﺧ رﺎﻴﺴﺑ ﻪﺠﻴﺘﻥ .مداد مﺎﺠﻥا و مدﺮﮐ ﻪﻌﻟﺎﻄﻣ

.دﻮﺷ حﻼﺻا یﺮﻴﮔ ﻩزاﺪﻥا ناﺰﻴﻣ ﺎﺕ داد ﺮﻴﻴﻐﺕ سرﻮﺱ ﻞﻳﺎﻓ رد ار نزﺎﺧ ﺐﻳﺮﺿ دﺪﻋ ود ﺪﻳﺎﺑ ﻞﮑﺸﻣ ﻦﻳا ﻊﻓر یاﺮﺑ

.ﺪﺷﺎﺑ ﺮﺘﻠﻣﺎﮐ ﺐﻠﻄﻣ ﺢﻴﺿﻮﺕ ﺎﺕ مدﺮﮐ ﻪﻴﻬﺕ ﺮﻳﻮﺼﺕ ﺎﺑ ار ﻪﻟﺎﻘﻣ ﻦﻳا ﺪﻴهد مﺎﺠﻥا یرﺎﮐ ﺪﻴﻥاﻮﺘﺑ ﺪﻳﺪﻴﺱر ﻞﮑﺸﻣ ﻦﻳا ﻪﺑ ﺮﮔا ﻢه ﺎﻤﺷ ﻪﮑﻨﻳا یاﺮﺑ

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

***********************************************************************************

Notice to commands:

unsigned int H_CAPACITY_FACTOR EEMEM =

394
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
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
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
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 ﻞﻳﺎﻓ

تاﺮﻴﻴﻐﺕ و ﺪﻴﻨﮐ زﺎﺑ نﺁ رد ار ﺮﺘﺴﺕ ﻪﺑ طﻮﺑﺮﻣ eep ﻞﻳﺎﻓ
Number 394 is decimal and when conver t to HEX becomes 18A. (01 8A) Number

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 ﻞﻳﺎﻓ ﺰﮕه یﺎهﺪﮐ ﺎﺑ ﺎﻘﻴﻗد ﺪﻴﻨﻴﺑ ﯽﻣ ﻪﮐ رﻮﻄﻥﺎﻤه

eep ﻞﻳﺎﻓ ﺰﮕه یﺎهﺪﮐ ﺎﺑ ﺎﻘﻴﻗد ﺪﻴﻨﻴﺑ ﯽﻣ ﻪﮐ رﻮﻄﻥﺎﻤه

.ﺖﺴﻴﻥ ﺮﻠﻳﺎﭙﻣﺎﮐ ﻪﺑ یزﺎﻴﻥ و ﺪﻴهد ﺮﻴﻴﻐﺕ ﻪﺑﺎﺸﻣ ﺎﻳ ponyprog ﻪﻣﺎﻥﺮﺑ رد ﺎﻤﻴﻘﺘﺴﻣ ار ﺎﻬﻥﺁ ﺪﻳﺎﺑ ﺎﻤﺷ

.ﺪﻳراﺬﮕﺑ 190 دﺪﻋ 283 یﺎﺟ ﻪﺑ رﻮﻄﻨﻴﻤه .ﺪﻴهد ﺮﻴﻴﻐﺕ و ﺪﻳراﺬﮕﺑ 265 دﺪﻋ 394 ﺐﻳﺮﺿ یﺎﺟ ﻪﺑ ﺪﻴهاﻮﺧ ﯽﻣ ﺎﻤﺷ لﺎﺜﻣ یاﺮﺑ

.ﺪﻴﻨﮐ ﻞﻳﺪﺒﺕ ﺰﮕه ﻪﺑ ﺪﻨﺘﺴه لﺎﻤﻴﺱد ﻪﮐ ار داﺪﻋا ﻦﻳا ﺪﻳﺎﺑ لوا

.ﺪﻨهد ﯽﻣ ﻩدﺎﻔﺘﺱا ﻩزﺎﺟا و ﺪﻥراد ﺎﻬﻟﺪﺒﻣ ﻦﻳا زا ﻦﻳﻼﻥﺁ ﻞﮑﺷ ﻪﺑ ﺎﻬﺘﻳﺎﺱ زا ﯽﻀﻌﺑ ﯽﺘﺡ ﺖﺴه رﺎﮐ ﻦﻳا یاﺮﺑ ناواﺮﻓ نﺎﮕﻳار یﺎه ﻪﻣﺎﻥﺮﺑ ﺖﻥﺮﺘﻨﻳا رد

:ﺪﻴﻨﮐ ﻞﻤﻋ ﻦﻴﺋﺎﭘ ﺮﻳوﺎﺼﺕ رد ﻞﺡاﺮﻣ ﻞﺜﻣ .ﺪﻴﻨﮐ ﻞﻳﺪﺒﺕ و ﺪﻴﻨﮐ بﺎﺨﺘﻥا ار ﯽﮑﻳ

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:

for free. Choose one and do the conversion. Like this: As you see above. 265 in

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

.ﺪﻴﻨﻴﺑ ﯽﻣ ﺰﮕه نﺎﻤه ﺎﻳ لﺎﻤﻴﺱداﺰﮕه ﻪﺑ لﺎﻤﻴﺱد زا ار 265 دﺪﻋ ﻞﻳﺪﺒﺕ ﻻﺎﺑ رد

ﺎﻳ لﺎﻤﻴﺱداﺰﮕه ﻪﺑ لﺎﻤﻴﺱد زا ار 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 ﺖﻤﺴﻗ ﻪﺑ

enabled و ﺪﻳوﺮﺑ edit ﺖﻤﺴﻗ ﻪﺑ Now, right click on each hex code will shows 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 ﻩﺮﺠﻨﭘ .ﺪﻴﻨﮐ ﮏﻴﻠﮐ ﺖﺱار ﯽﻠﺒﻗ یﺎهﺪﮐ یور ,ﻻﺎﺡ

edit ﻩﺮﺠﻨﭘ . ﺪﻴﻨﮐ ﮏﻴﻠﮐ ﺖﺱار ﯽﻠﺒﻗ یﺎهﺪﮐ یور , ﻻﺎﺡ

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

See below picture:

:ﻦﻴﺋﺎﭘ ﺮﻳﻮﺼﺕ .ﺪﻳراﺬﮕﺑ 394 دﺪﻋ یﺎﺟ ﻪﺑ ار 265 دﺪﻋ ﺪﻴهاﻮﺧ ﯽﻣ لﺎﺜﻣ یاﺮﺑ

دﺪﻋ ﺪﻴهاﻮﺧ ﯽﻣ لﺎﺜﻣ یاﺮﺑ In above procedure we wrote 265. . ﺪﺷ لﺎﻤﻋا
دﺪﻋ ﺪﻴهاﻮﺧ ﯽﻣ لﺎﺜﻣ یاﺮﺑ In above procedure we wrote 265. . ﺪﺷ لﺎﻤﻋا

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
As you see in below picture, we did desired changes. Now it is ready to

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 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 ﻪﻌﻤﺟ