Professional Documents
Culture Documents
Diffusion in Solid Metal
Diffusion in Solid Metal
2
Department of Electronic and Electrical Engineering, Obafemi Awolowo University, Ile-Ife, Nigeria
jopetinrin2@gmail.com|pleasantdaniel@yahoo.com|aaogunseye@oauife.edu.ng|samfolek@gmail.com
ORIGINAL RESEARCH
Abstract- Milliohm Meter is an instrument for measuring very small amount of resistance in a conductor, electric motor and transformer
windings and in many other current sensing applications that cannot be measured with standard digital ohmmeters. The cost of commercially
available milliohm meter is relatively high, making it unaffordable for hobbyists. In this work, a low-cost microcontroller based digital milliohm
meter having three measurement sub-ranges was designed, constructed, tested and calibrated. The instrument, based on the PIC16f877A
8-bit microcontroller, used the lock-in detection technique to improve the measurement signal-to-noise ratio without requiring high current for
measurement. The milliohm meter’s firmware was written with MicroC software by Mikroelektronika® and was simulated using Proteus®
software by Labcenter Electronics. After construction and calibration, it was found to have resolutions of 82.9320 counts/mΩ, 9.1394
counts/mΩ, and 0.9221 counts/mΩ for the measurement ranges of 0 – 10mΩ, 0- 100mΩ and 0 – 1000mΩ respectively. Thus, the instrument
is capable of measuring resistance value between 0Ω to 1Ω with good resolution values without requiring the computing power and display
capabilities of a digital computer.
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 341
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
This method is simple and is easily implemented using a The unknown resistance is proportional to the ratio of the
few electronic switches and operational amplifier circuit voltages developed across the known and unknown
but the measurement accuracy achievable is limited due resistances. Reversing the polarity of the applied current
to some errors that are introduced into the circuit. makes it possible to eliminate thermal voltage
Thermal voltages due to Seebeck effect can introduce measurement errors (Ali, 2018). However, to achieve a
measurement errors (Bengtsson 2012). The operational reasonable accuracy of measurement, a high-test current
amplifier used in the circuit has offset voltages and value is required which can result in undesired heating
currents that causes additional voltages in addition to the effect in the resistance being measured (Štambuk &
desired output voltage. These offset parameters are easily Malarić, R. 2015; Urekar, Novaković & Gazivoda 2019).
removed initially but they can change with time, thus
introducing errors that may change with time.
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 342
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
measurement waveform consists of frequencies that are A similar design was published by Maya et. al. (2019) in
centered around odd harmonics of 𝑓0 (Zhang et al. 2016). which a system that is able to measure resistance and
capacitance was discussed. In this work, the lock-in
This is shown in Figure 2. The produced measurement amplifier system was implemented in hardware using
signal is multiplied with the same modulating waveform 0.18µm CMOS technology. The CMOS design is quite
𝑚(𝑡) to produce a signal that has components whose remarkable because it achieved a very low power
frequencies consists of series of difference and sum signal consumption (less than 834 µW) and also permits the
frequencies. operating frequency and amplifier gain to be user
programmable. The measurement system is controlled
For a sinusoidal modulating frequency with an Arduino® board which also provides an interface
𝑚(𝑡) = 𝐴 cos 2𝜋𝑓0 𝑡 (1) to a computer where the result is displayed. The CMOS
design has quite respectable sensitivity figures for
In the frequency domain, resistance and capacitance measurements (16.3 µV/Ω and
𝐴
𝑀(𝑓) = {𝛿(𝑓 − 𝑓0 ) + 𝛿(𝑓 + 𝑓0 )} (2) 37 kV/F respectively).
2
When the experiment is done at 𝑓0 , the ‘carrier’ amplitude Most of these designs have a fixed range of resistance
is modified such that the measurement waveform measurement with a fixed resistance measurement
resolution. Better resolution can be obtained by breaking
𝑟(𝑡) = 𝑘𝐴 cos 2𝜋𝑓0 𝑡 (3)
the overall measurement range into smaller sub-ranges.
This work seeks to build a microcontroller-based
where k represents the waveform amplitude if the
milliohm meter system that have a maximum
measurement was carried out at 0 Hz. In the frequency measurement range of 0 - 1Ω, with sub ranges 0 -10mΩ
domain, and 0-100 mΩ.
𝐴
𝑅(𝑓) = 𝑘 {𝛿(𝑓 − 𝑓0 ) + 𝛿(𝑓 + 𝑓0 )} (4)
2
3 METHODOLOGY
The output signal is derived by multiplying the 3.1 HARDWARE DESIGN
measurement waveform with the modulating waveform The hardware system design is shown in Figure 3. The
hardware design generally follows the pattern of the
to produce an output signal 𝑝(𝑡) such that
design used by Bengtsson 2012. The circuit uses four-wire
𝑝(𝑡) = 𝑚(𝑡) ∗ 𝑟(𝑡) = 𝑘 (𝐴 cos 2𝜋𝑓0 𝑡)2 (5)
resistance measurement technique (Cigoy 2010 and
Janesch 2013) to minimise errors due to contact
In the frequency domain, resistances. The circuit is designed around a PIC16F877A
𝐴2 1
𝑃(𝑓) = 𝑘 { 1 + [𝛿(𝑓 − 2𝑓0 ) + 𝛿(𝑓 + 2𝑓0 )]} (6) 8-bit microcontroller unit. The instrumentation amplifier
2 2
(INA 128) amplifies the voltage drop across the unknown
The low frequency component is extracted from the resistance when the microcontroller toggles the output
composite signal 𝑝(𝑡)with a low pass filter. The low pass pins connected to resistors 𝑅1 and 𝑅31 . Operational
filter’s bandwidth determines the equivalent amplifiers 𝑈6 and 𝑈7 provides further voltage gain for
measurement bandwidth which can be chosen to be as measurement ranges 0 -10 mΩ and 0-100 mΩ respectively.
narrow as possible to reject effects such as dc offsets, 1/f The outputs terminals of the amplifiers are connected to
noise etc. Similar results can be obtained if the the analogue inputs of the microcontroller through a
modulating waveform is a square wave. In this case, the resistive network that adds dc bias to the respective
modulating signal consists of odd multiples of the amplifier voltages.
fundamental frequency. The additional frequency
components are suppressed by the low pass filter, so This is required because the internal Analogue-to-Digital
accurate results can be obtained with this method with Converter (ADC) of the microcontroller can only measure
simplified hardware design if careful attention is paid to unipolar voltages whereas the output voltages of the
the design of the low pass filter (Zhang et al., 2016). amplifiers can assume negative or positive values. The
microcontroller samples the analogue channels, runs the
This technique has been used for low resistance value lock-in detection algorithm, filters the processed samples
measurement. Bengtsson (2012) designed a and then converts the results to resistance values that are
microcontroller-based milliohm meter circuit that is able on the 4 * 16 Liquid crystal display (LCD) unit.
to measure resistance with a quoted resolution of 55.6
µΩ/count. This design is particularly remarkable because
the system was designed with a cheap 8-bit
microcontroller unit with a 10-bit analogue-to-digital
converter unit. In this design, the results of measurements
are sent to a digital computer for display purposes
through a serial RS232 data link. With a fixed resolution
and instrumentation amplifier gain, the measurement
range of this design is fixed.
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 343
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
5V
R23 R24
12V
12V
5V
10k 10k
100_milliohm
TL071 U7
R7 R25 R26
7
R31 U5 R9
7
INA128 10k 10k 3
5 6 10k 10k
220 R29 3
6
R5 2
-12V
2 1_ohm
PACKAGE=PRE-SQ3
RX 10k
4
1
5
1
R3 R6
-12V
4 8
R2 0.1
10k
56 R4 R22
R1 1k RV1
0.27 10K
220
R8
15k
5V
R19 R20
X1 22k 390
CRYSTAL C6
12V
3 22p 13
OSC1/CLKIN RB0/INT
33
D4
14 34
6 10k 10k OSC2/CLKOUT RB1
35 D5
2
1_ohm 2
RB2
36 D6
PACKAGE=PRE-SQ3 3
RA0/AN0 RB3/PGM
37 D7
-12V
100_milliohm 4
RA1/AN1 RB4
38 RS
4
1
5
RA2/AN2/VREF-/CVREF RB5 E
VDD
VSS
VEE
5 39
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
5V
10_milliohm RA3/AN3/VREF+ RB6/PGC
E
6 40
RA4/T0CKI/C1OUT RB7/PGD
7
RA5/AN4/SS/C2OUT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
RC0/T1OSO/T1CKI
8 16
RE0/AN5/RD RC1/T1OSI/CCP2
R27 RV2 9
10
RE1/AN6/WR RC2/CCP1
17
18
1k 10K RE2/AN7/CS RC3/SCK/SCL
D4
D6
D7
23
R21 RC4/SDI/SDA
RS
D5
1 24
MCLR/Vpp/THV RC5/SDO
5V RC6/TX/CK
25
RV3
R10 150k 1k RC7/RX/DT
26
RD0/PSP0
19 10K
20
RD1/PSP1
R11 R12 R13 RD2/PSP2
RD3/PSP3
21
22
27
RD4/PSP4
28
270k 18k 1.2k RD5/PSP5
RD6/PSP6
29
30
RD7/PSP7
VDD=5V
VSS=GND
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 344
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
equal to, or greater than the set maximum value, the count count value, it is selected as the final count value. If it is
of the 0-100 mΩ range is considered, and if the value is equal to, or greater than the set maximum value, the count
less than the set maximum value, it is selected as the final of the 0-100 mΩ range is considered, and if the value is
count value. If the count is equal to, or greater than the set less than the set maximum value, it is selected as the final
maximum value, the count corresponding to the 0-1000
count value. If the count is equal to, or greater than the set
mΩ range is considered. This selection procedure is
illustrated in the flow chart in Figure 4. In all the ranges maximum value, the count corresponding to the 0-1000
of measurement, the highest count obtainable is 1023 mΩ range is considered, and if its value is less than the set
(2^10 -1) because the internal ADC unit of the maximum count value, it is selected, otherwise an over
microcontroller has a resolution of 10 bits. The set range condition is specified.
maximum count value (the threshold value) is chosen as
950 which represented 92.9% of the available maximum In all the ranges of measurement, the highest count
count. obtainable is 1023 (2^10 -1) because the internal ADC unit
of the microcontroller has a resolution of 10 bits. The set
maximum count value (the threshold value) is chosen as
Set up Timer Interrupt
Declare Variables: SUM_1Ω = 0, SUM_10mΩ = 0;
950 which represented 92.9% of the available maximum
SUM_100mΩ = 0; count. The time interval between consecutive interrupt
Index = 0; count = 0; was chosen to be more than the settling time of the
Do instrumentation and operational amplifiers. With settling
times of 20µs for a 10V change and about 0.3µs for INA
If (interrupt event) 128 and TL071 amplifiers respectively, the time between
//Read the analogue channels successive interrupt was chosen as 500µs which is
S_1Ω[index] = ADC_READ(); sufficient for all the amplifiers to settle to the required
S_10mΩ[index] = ADC_READ(); values. This gives a measurement frequency of 1 kHz
S_100mΩ[index] = ADC_READ(); since two interrupt events are required for one
Increment index; measurement cycle. The pseudocode shown in Figure 4
was converted to a C program for PIC microcontrollers
End
using MicroC compiler by MikroElectronika®.
If (index==2)
Index = 0;
3.3 HARDWARE DESIGN DETAILS
//update the count
3.3.1 Measurement Current
SUM_1Ω = SUM_1Ω + (S_1Ω[0]- S_1Ω[1] ); It is good to make the value of the output current of the
SUM_10mΩ = SUM_10mΩ + (S_10mΩ[0] S_10mΩ[1] ); microcontroller reasonably high to obtain a significant
SUM_100mΩ = SUM_100mΩ + ( S_100mΩ[0]-S_100mΩ[1]); voltage drop across the unknown resistance. According
Increment count to Microchip PIC16F87X datasheet, the microcontroller’s
End output current is limited to about 25 mA. With 𝑅1 =
𝑅31 = 220Ω, and a supply voltage of 5V, the maximum
If (count = = 2^13 ) current sourced and sinked by the microcontroller pins
//Scale the accumulated counts (pins 4 and 7; see Figure 3) is 11.36 mA which is lower
RES_1Ω = SUM_1Ω /2^13; than the 25mA maximum allowable microcontroller
RES_10mΩ = SUM_10mΩ /2^13 ; output current.
RES_100mΩ = SUM_100mΩ /2^13 ;
End
3.3.2 Amplifier Gain Determination
Let VOH = Microcontroller high output voltage
While(1)
VOL = Microcontroller low output voltage
Select appropriate resistance range
Vx = voltage drop across unknown resistance
Convert results to resistance V1 = output voltage of the instrumentation amplifier
Display on LCD unit V2 = output voltage of U7 (100mΩ range)
End V3 = output voltage of U6 (10 mΩ range)
V1Ω = input voltage to analogue channel 0
Fig. 4: Pseudocode of the milliohm meter
While (true) K1 = voltage gain of the instrumentation amplifier
K 2 = Voltage gain of U7
The time interval between consecutive interrupt was K 3 = Voltage gain of U6
chosen to be higher than the settling time of the R OH = output resistance of the microcontroller with logic
instrumentation and operational amplifiers within range. high output voltage
Thus, it is necessary to select the best count value with the R OL = output resistance of the microcontroller with logic
highest resolution as the final count that will be converted low output voltage
to the measured resistance value. The count
When pin 4 is set to logic 1 and pin 7 of the
corresponding to the resistance range of 0-10 mΩ is first
microcontroller is set to logic zero, From Figure 3,
considered. If the count value is less than a set maximum
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 345
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
Rx ×(VOH− VOL )
Vx10 = (7) Similarly, if X100 represents the ADC count for the 0-100
ROH+ ROL + R31 + R1 +Rx
mΩ range, then
When the digital pins are toggled, i.e., pin 4 is set to logic
K2 K1 Rx ×(VOH− VOL )
0 and pin 7 is set to logic one, Vx becomes X100 ≈ round ( ×( ) × (210 − 1))
10 R31 + R1 +Rx
Vx01 =
Rx ×(VOL − VOH )
(8) (15)
ROH+ ROL + R31 + R1 +Rx
V1Ω
With X10 = 1023 and R x = 10 mΩ, K 3 K1 = 88002. Thus,
X = round ( × (2n − 1)) (11) 88002
Vref K3 =
882
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 346
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
(a)
(b)
Fig. 8 (a) Top view of the casing and (b) internal details of the
constructed milliohmmeter circuit.
Fig. 6: Resistance vs count of the milliohmeter for
0-100mΩ range of measurement
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 347
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 348
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/
FUOYE Journal of Engineering and Technology, Volume 7, Issue 3, September 2022 ISSN: 2579-0617 (Paper), 2579-0625 (Online)
© 2022 The Author(s). Published by Faculty of Engineering, Federal University Oye-Ekiti. 349
This is an open access article under the CC BY NC license. (https://creativecommons.org/licenses/by-nc/4.0/)
http://doi.org/10.46792/fuoyejet.v7i3.843 http://journal.engineering.fuoye.edu.ng/