How to Read Voltage Arduino Using Inductor
Overview
-
Name : LCR_meter
-
Title : Inductance, Capacitance and Resistance meter, Arduino NANO based.
-
Description :
- Inductance, Capacitance and Resistance meter.
- Arduino NANO version 3.0 based.
- four resistor exam ranges, Resistor range is from 0 ohms to 2 Mohms. Auto-range.
- Inductance test, range is 80uH to 30,000uH.
- Capacitance three tests , range 18pf to 4F.
- Push push input.
- Outputs data to serial monitor and a HD44780 LCD 16x02.
-
Platform: Arduino NANO version 3.0
-
Writer: Gavin Lyons
Table of contents
- Overview
- Table of contents
- Software and Libraries
- Parts List
- Project Schematic
- Command
- Example Output
- C Meter
- R Meter
- L Meter
- Copyright
Software and Libraries
Arduino 1.8.nine
Eagle ix.5.ii
- Simply library used for LCD = LiquidCrystal_I2C.h //5.ane.one.2 link
Parts List
The schematic and BOM is available in documents folder.
HD44780-based LCD 16x02 with I2C PCF8574 interface module
Arduino NANO micro-controller module Version 3.0
Resistors: 2kohms, 20kohms, 200kohms, 1Mohms, 150ohm, 330ohm, four.7Kohms Ten two , Cap Test2(10Kohm and 220ohm) , Cap Test3(10K, 3.1K, i.8K)
Capacitors: 2 uF not-polarized
Two push button buttons.
Diode: 1N4001 or IN4148
LM393 comparator IC datasheet
ZIF exam socket sixteen pin.
Projection Schematic
Pinout Connections Tables.
Arduino Nano | Desc | SW Name |
---|---|---|
D13 | capacitor test 1 accuse pivot | Cap1chargePin |
D12 | Button Mode | buttonMode |
D11 | Button button Test | buttonTest |
D10 | resistor apply Vin | ApplyResVoltage |
D9 | resistor range Upper | Res1M |
D8 | resistor range Upper MID | Res200K |
D7 | Cap test 3 volt ref | AIN1 |
D6 | Cap test 3 connector | AIN0 |
D5 | Inductor out | OutLtestPin |
D4 | inductor in | PulseInPinLtest |
D3 | resistor range lower MID | Res20K |
D2 | resistor range Lower | Res2K |
A0 | capacitor examination 1 discharge pin | Cap1dischargePin |
A1 | Cap test 3 pulse pin | Cap3pulsePin |
A2 | capacitor examination 2 negative ADC | Cap2InPin |
A3 | capacitor examination ii positive ADC | Cap2OutPin |
A4 | LCD SDA I2C | DATA SDA |
A5 | LCD CLK I2C | CLK SCLK |
A6 | capacitor test 1 ADC | Cap1analogPin |
A7 | Resistor Exam ADC | analogResPin |
Exam Socket PCB pivot | Name | NANO Pin |
---|---|---|
1 | resistor test Voltage apply | D10 |
2 | n/a | n/a |
3 | ground | ground |
four | ground | basis |
five | n/a | n/a |
6 | northward/a | northward/a |
7 | resistor test Analog in | A7 |
8 | """ | """ |
9 | Inductor Circuit | north/a |
x | C2 test Postive | A3 |
11 | n/a | n/a |
12 | C2 examination negative | A2 |
13 | basis | ground |
14 | ground | ground |
15 | C3 test | D6 |
16 | C1 test | A6 |
Control
Push Buttons
- Mode Button to change mode.
- Exam push button to get-go test for selected mode, when in gear up mode this push button brings up help screen.
Tests Modes:
- Inductance test.
- 0 to 2k range resistor test.
- 2K to 20k range resistor examination.
- 20k to 200k range resistor examination.
- 200k to 1M range resistor test.
- Capacitor Examination 1 Range 1 uF to 4F.
- Capacitor Examination 2 Range 18 pF to 470 uF.
- Capacitor Test 3 Range 4.seven nF to 180 uF.
The meter outputs to an LCD and serial monitor. (The LCD is optional as data is sent via serial monitor to PC) Every signal in code that requires User scale on Initial build is marked "USER CALIBRATE"
Example Output
Example output for Capacitor exam 2 on a 10uF capacitor to LCD and series monitor.
C Meter
Each Arduino capacitance examination relies on a holding of resistor capacitor (RC) circuits- the fourth dimension constant. The time abiding of an RC circuit is defined as the time it takes for the voltage across the capacitor to achieve 63.ii% of its voltage when fully charged:
Larger capacitors take longer to accuse, and therefore will create larger time constants. The capacitance in an RC circuit is related to the time constant by the equation:
The capacitance meter has an RC circuit with known resistor values and an unknown capacitor value. The Arduino will mensurate the voltage at the capacitor and tape the time it takes to accomplish 63.ii% of it's voltage when fully charged (the fourth dimension constant). Since the resistance value is already known, nosotros can employ the formula above in a programme that will calculate the unknown capacitance.
Test 1
Test one: Range 1 uF to 4F. Uses two digital pins, i analog pin, and two resistors. One for discharge, ane for charge. Insert a capacitor in range into final printing push button and view consequence on LCD or serial monitor. The Capacitor is charged, We can mensurate elapsed time until time constant fulfilled using analog pin and we know R value. Therefore we solve for C. The result gives two values: Capacitance value and time abiding to test in mS. The user can adjust the 10K resistor value in code variable(resistorValue) to match exact value, to better accuracy.
Test 2
Test 2 : Range 18 pF to 470 uF.
This capacitance test has the greatest range of 3. It also had the highest accurateness with smaller capacitors. No resistors are needed and it simply uses two analog pins(A2(neg) and A3(positive) from the Arduino. There is no extra resistor just the internal components of ATmega328 chip.
C1 calibration(optional):
The internal analog pin capacitor to gnd (C1) varies between xx and 30pF. unknown capacitor = Cu. The positive pin is set to 5V, the negative to 0V. VA2 = (VA3 * Cu)/(C1 + Cu). The value of C1 for any given Arduino board volition have to be calibrated using a known cap for Cu, for full accuracy I ready it at 24.48pF in code (CapOne) Constitute using equation. C1 = Cu * (VA3-VA2) / VA3, Where Va2 is ADC value reported by code and VA3 is 5v or 1023. So for a known capacitor of 103pF giving a ADC value of 801. So C1 = 103pf * (1023-801)/ 1023 = 28.48pF. The user should modify this for their arrangement to ameliorate accuracy. Test a known cap go ADC value and then pop these values into equation above and put the C1 value into (CapOne) variable in code.
Test equation:
Cu = VA2 * C1 / (VA3 - VA2)
The test displays three values
- Cu, Capacitance in Farads
- Fourth dimension constant for examination in mS
- Va2 , ADC measurement from 0 to 1023 where 1023 is 5V
Test 3
Test 3 Range 0.0047 uF to 180 uF.
A voltage divider is created to give a reference voltage,
Vout = Vin * (R5 / (R5 + R4)) , five * (3100 / (1800 + 3100)) = 3.163.
The objective hither is to find the time constant τ (tau) in the equation:
τ = R * C Solved for C: C = τ / R
So we desire to charge the capacitor under exam with a suitable voltage (eg. 5V from an Arduino output pin) and measure how long it takes to reach 63.2% of that voltage. So we demand a reference voltage of v * 0.632, namely iii.16V. The internal analogue comparator is used for this job.:
- pin half dozen PD6 AIN0
- pin seven PD7 AIN1
We connect the reference voltage to the AIN1 pin (negative reference) and connect our capacitor to the AIN0 pivot (positive reference) and and so configure an interrupt on the ascent edge. A value of 10K for the resistor to give a reasonably wearisome charge fourth dimension. The value of ~ 10K is specified in lawmaking variable (resistance). so adjust for your resistor value. Make sure to option accurate resistors for voltage divider.
The test returns the Capacitance result and time abiding.
R Meter
The resistors used in excursion should be measured on good quality meter and there exact values added to code for maximum accurateness. This Resistance test tin automobile-range in both directions.
0-2kohms : 2kohms resistor
2k-20k : 20k resistor
20k-200k : 200k resistor
200k - 1Mohm : 1 Mohm resistor
So we will use a basic voltage divider to summate the resistance.
A voltage divider is made of two Resistances (R1 and R2) in series. The output voltage in the middle point is [R2/(R1+R2)]Vin. Using this formula and knowing the value of R2 and measuring the Vout summate the resistance of R1. Vin will exist 5 volts from the Arduino, We tin mensurate Vout with one of the Arduino's analog inputs. We demand to use different ranges of R2 to measure out with meliorate precision.
L Meter
This tests range is from 80uH to xxx,000uH. Ideally the capacitors in circuit must exist in specification and measured on a good quality meter. The unknown exam inductor is placed in parallel with a capacitor thus creating an LC circuit.
As soon every bit the voltage on the LC circuit becomes positive, the LM393 will exist floating, which can be pulled high with a pull upwards resistor. When the voltage on the LC circuit becomes negative, the LM393 volition pull its output to footing.
A 5V pulse point from Arduino is practical to the LC circuit. We charge the circuit for some time. So we change the voltage from 5 volts directly to 0. That pulse will brand the circuit resonate creating a sinusoidal signal oscillating at the resonant frequency. The frequency is measured and subsequently using the formulas we can obtain the inductance value. We will use the Arduino to measure the frequency and calculate the value. The resonant frequency is measured with the next equation:
So nosotros could obtain the Fifty value considering we know the F frequency that nosotros've only measured and we likewise know the value of the capacitor because it's a component that we've selected. All we need is to obtain Fifty from this equation.
The comparator will plough the sine wave into a square wave with a duty of l%(see fig nine in datasheet), The microcontroller measures the signal , This measurement can then be doubled to get the catamenia and the changed of the menstruation is the frequency. Since the excursion is resonating, this frequency is the resonating frequency.
Nosotros tin can now solve the equation for inductance.
Copyright
Copyright (C) 2019 G Lyons. This programme is free software; you lot can redistribute it and/or modify information technology under the terms of the GNU General Public License equally published by the Free Software Foundation, encounter license.medico for more details
ethertonalianobson1961.blogspot.com
Source: https://github.com/gavinlyonsrepo/LCR_meter
Post a Comment for "How to Read Voltage Arduino Using Inductor"