< warning> For education purpose only , if you want a cheap and practical meter you can buy one for less than an arduino so think twice before deciding what to do :) </ warning>
A digital electronics component_meter based on arduino, that mesure inductance and capacitance with an lcd menu display ( more options will be added later :)
Here’s a really useful and easy project you can do with an Arduino. If you have a hard time reading the color bands on Induction like me and can't find out the real value of the capacitor, this project is perfect for you.
Step 1: Components Neded :
To make the LC meter Arduino you will need the following components:
- Arduino x 1
- Usb cable x 1
- Resister: (10k, 220ohm ,150 ohm , 330 ohm ) x 1
- Capacitor: 1uF non-polar Capacitor !! x 1
- Diode: 1N4007 diode x 1
- LM339 Comparator x 1
- Push Button x 3
- Lcd (16 x 2) x 1
- Lcd I2C module x 1
- Jumper wires & Headers
For the inductance Circuit :
An inductor in parallel with a capacitor is called an LC to measure the inductance we use the LM393 comparator The circuit works by feeding a signal in from the Arduino. This waveform is affected by the LC circuit, filtered by the comparator chip, then read back out the other side by the Arduino. That resulting signal is a square wave, which is an easy target for the Arduino to measure. And by calculating the frequency or time change, we can calculate the inductance .
As we know that the frequency of LC is: f = 1/2*pi*(LC)^0.5
So to find unknown inductance from the circuit : L = 1/4*pi^2*f^2*C
For the capacitance Circuit :
TC = R * CTC = time constant in seconds
R = resistance in ohms
C = capacitance in farads (1 microfarad [ufd] = .0000001 farad = 10^-6 farads )
The voltage at 1 Time Constant equals 63.2% of the charging voltage.
Example: 1 meg-ohm * 1 microfarad = 1 second
Example: 10 k ohms * 100 microfarad = 1 second
We are going to use Two resistance and two analog input out pin and two digital input output
Algorithm for capacitance meter sketch :
// for low capacitance value :
charge the capacitor put pin output HIGH
read the analog value
discharge the capacitor put output low
check if the value is bigger 1000 ? if yes then calculate the capacitance series with the internal capacitance
// for high capacitance value :
Set discharge pin to INPUT (so it can't discharge the capacitor)Record the start time with millis()
Set charge pin to OUTPUT and make it HIGH
Check the voltage repeatedly in a loop until it gets to 63.2% of total voltage
.After the cap is charged, subtract the current time from the start time to find out how long the capacitor took to charge.
Divide the Time in seconds by the charging Resistance in ohms to find the Capacitance.
Report the value with serial.printDischarge the capacitor. To do this:Set the charge pin to InputSet the discharge pin to OUTPUT and make it LOWRead the voltage to make sure the capacitor is fully dischargedLoop and do it again .
Step 4: Build the Hardware :
lcd i2c :
Tutorielle for installing lcd library :https://www.youtube.com/watch?v=xVC0X_PE_XE
Run the code below on the arduino to know the i2c adresse .
Step 5: CODING :
You can find the code here :
Step 6: Soldering on Pcb :
No Soldring lol
I want to add a lot more options when the final project is finish (soon i hope ) .