Это видео недоступно.
Сожалеем об этом.
Inductance meter with Arduino
HTML-код
- Опубликовано: 17 авг 2024
- Inductance meter using the Arduino and a small comparator. All the the breadboard tests are made using the Arduino UNO. The theory is based on the resonating frequency of an LC circuit. Feel free to visit my Patreon page!
Help my projects on Patreon : / electronoobs
my Q&A page: electronoobs.co...
Canal en Español: / electronoobs en español
-----------------VIDEOS-----------------
Current meter: • Arduino based current ...
Capacitance meter: • Arduino capacitane met...
Resistance meter: • Arduino resistance met...
-----------------LINKS-------------------
Inductance meter: electronoobs.co...
-See also-
Current meter: www.electronoob...
Capacitance meter: electronoobs.co...
Resistance meter: electronoobs.co...
Current meter: electronoobs.co...
---------------MATERIAL---------------
LM339 comparator: www.ebay.com/it...
Non polar 1uF cap: www.ebay.com/it...
i2c LCD screen: www.ebay.com/it...
diode: www.ebay.com/it...
Arduino: use any
---------------SCHEMATICS-----------
LM339 circuit: electronoobs.co...
On breadboard: electronoobs.co...
--------------------CODE------------------
Inductance meter code: electronoobs.co...
Lyquid library: electronoobs.co...
Like share and subscribe to motivate me. Thank you
Bro this full theory and math was amazing... Really was looking for such a inductor meter.. And you did it
ruclips.net/video/6mQ-LN3PGwY/видео.html
Would be great if the code actually worked. It's either incomplete or bad.. the only thing it does is print "Why hello" in the serial monitor (115200 baud rate).
I've also noticed some differences between the supplied code on the blog and the one being used in the video, but neither actually seem to work lol
@Electronoobs Thanks for this tutorial video. I know that it is a bit old, but I am hoping that you are still monitoring and responding to questions about this project. I have a few questions:
1. Why not use the Atmega328p internal comparator (available on the analogue input pins) instead of an external comparator chip? It may need a more accurate method of measuring the frequency period, but this could, perhaps, be done with an assembler code loop.
2. If an external comparator is absolutely needed, why not use a LM393 dual comparator (smaller IC package) instead of the LM339 quad comparator? Is there a difference in characteristics between the LM393 and LM339?
3. Also, if an external comparator is needed, why not use the internal digital input pin pullup (i.e. INPUT_PULLUP mode) instead of the external 330R resistor?
Thanks.
This is good questions, i also need the answers. I am building a lc meter with lm339
As a noob I thought "Dang son, this LM339 is gonna be hard to find!" Looked in my junkbox anyway. Litteraly the first place I looked I found two LM339N chips, on an old partly scrapped PCB from a computers ATX powersupply. This is cool!
Awesome work! I am a hobbyist and this is going to make a great project! Thanks for spending the time!
ruclips.net/video/6mQ-LN3PGwY/видео.html
... after a week or so of swearing and frustration caused mainly by bad breadboards, with bad contacts, i made this thing working.
yes, 1 uF, but changing the value in the code, it will work, too, but with another set of coils.
next, if your inductor/coil/solenoid is shorted (very rarely, but sometimes happen, check with an ohmmeter, to see if reads a short!), the signal will be grounded, and measuring will never happen.
same for a too high or too low inductance: no measuring, nothing will be displayed.
without anything unless the cap, nothing will be measured, too.
i use just one 1 uF cap, and finally started this thing.
results from serial monitor:
91 us
5494.51 Hz
0.82 uH
with another coil:
312 us
1602.56 Hz
9.66 uH
without any change in code, i put another 1 uF cap in parallel (so, a total of 2 uF, or around...), and i get, for the same coil from the first results:
130 us
3875.97
1.65 uH
tried an axial inductor marked DLA 10 mH, not working at all. but with some inductors randomly harvested from ATX power supplies and "economical fluorescent bulbs", it worked nice. too low or too high coil resistance will cause that thing, again, to not work...
so, first time, try it without any coil, and check if you get a signal on comparator's input pin. be sure your capacitor is not shorted, too!
looks like i can measure, with a 1 uF cap a 0.10 uH coil... hmmm... this was the lowest one:
31 us
16129.03 Hz
0.10 uH
i tried to measure a mains trafo, primary and secondary side... nothing, maybe too high inductance in primary side, and on secondary, too low resistance of winding...
now... is time to put this thing on a small perfboard, and doing stuff...
code is working, but the oscillator is not working with ANY coil. so, try to find a similar coil like that one from video.
be sure about your soldering, too... a wiggly or poor soldered wire will drive you crazy! :D
ah, i used an SSD1306 display.
just a question of using the correct library, and invoking the correct statements.
easy.
because i have no I2C LCD here... just a lot of 16 pin LCD's, and a lot of SSD1306, 128x64 or 128x32.
good luck.
Where do you get the 1602 with straight pins? All the ones I see have the pins bent. Even you link shows 90 degree pins. Do you straighten them?
Bro, i made this today to check the inductors, and it works perfectly!!! I had to reduce the delay time after the power in to the circuit is off ( i used a 0.1uf cap though).. keep up the good work!!! Thanks!
Hi how did you make this? Would you share your shematic and code? Thank you
Is the measurement accurate for inductors below 80uH?. Thank you inadvance for your response.
can you conbine all these meter series in one arduino that would be awsome.
I will in the future!
Electronoobs its already 6 months. How more time, would it take..??
yes !! I also want this ( LC with frequency meter ) , plz write code for both serial monitor and 16x2 parallel ports in one :)
should be pretty easy to put them together but of you are gonna use an I2C display you may need something other than an arduino uno since it only has 6 analog inputs and 2 of them are used my I2C. the hardest part would be the menu code but there are a lot of examples of menu code out there.
@@Nithuigim1 lel, he just do it
Why not use the comparator built in to the ATmega338p? I know I’m a bit late to the video, but I think the built-in comparator has a response rate of something like 125-250 ns (4-8MHz)
It seems silly to use a dedicated comparator when an arduino uno already has one
Edit: in fact, I think the ATmega328p’s comparator has roughly the same response time as the as the LM339 you used
Try and you understand why he did not used internal comparator.
bit of an old video but @electronoobs after looking at your webpage and video really closely I cannot get this project to work using both a 220uF nonpolar electrolytic cap as well as a 1uF ceramic cap. With both circuits it does not output anything, I have changed the value in the program. I have tried different ICs as well as different Arduinos. I don't have a scope so I can't check anything else really.
Freakin youtube. It took way to long for your channel to show up on my frontpage. Subbed.
Micky S. thank you very much!
Can I use an Oamp instead?
this no longer seems to work for some reason. also there are several errors in the code available from your website. and the library provided does not seem to want to cooperate. I would appreciate some help, as I would like to have one of these handy for quick and dirty approximations of inductors.
I also cannot get it to function. Have you had any luck?
LM339 is Quad Comparator but you only use one. You can also use LM393 Dual Comparator or LM397 single general-purpose comparator
ruclips.net/video/6mQ-LN3PGwY/видео.html
can i use 1n4007 diode istead of 1n4001 diode
Can i use an optocoupler zero crossing point circuit instead?
With changed programming of course
I think that would give you just a small peak each time you have 0 crossing. using the pulse in function you need a 50% duty signal in order to double the time and get the period. But i guess you could manage to count the time between each peak
it doesnt really matter what length is the pulse because i want to use interrupts instead of pulsein() because it locks up the whole mcu while its waiting for the end of the pulse
Then ok. Using interrupts you increase a timer ant count how often dose that pulse oscillate. Sounds perfect!
@@ELECTRONOOBS I think such a circuit should be made on a PCB as the breadboard construction adds parasitic capacitance to the circuit.
6:54 You'd probably do better to use a rectangle wave with a duty cycle of 10% , You'll get a better ring off the inductor and depending on the inductor value you could drop that to 5%, Although this doesn't work for every inductor.
10% is the way to go in my opinion
did you have any inductane meter more precise between 1uH and 80uH ? it's also very usefull
You are so cool and very simple to teach people. Thank you.
Excellent job in explaining how it works , You are a Guru
Thanks for caring and shearing
Can I use 1uf electolitic capacitor or 10x 0.1uf ?
Woow You are too exceptional, your teaching is top notch, i will be following your page
If I only want to measure a "large" inductance, say mH, would it be possible to measure the inductance accurately using the same method as for measuring the capacitance?
From what I understand, the reason we can't use the same method to measure inductance is because as we increase the resistance we are lowering our "charge time" in the LR circuit, thus our arduino at 9 kHz sampling frequency (76 kHz if you play around with if for a while) isn't fast enough. But if I use 76 kHz I get a "resolution" of 0.01 mH, so that should be enough to measure mH accurately, right?
Also, we should be able to least square fit the exponential curve to get a good accuracy despite noise in the measurements, right?
why are we using non polar capacitor? is it possible if use polarized ones?
Yes, of course.
Works perfectly. Good job sir
How can one use the digital display on this inductance meter without the i2c interface. if possible ,what going to bet the code adjustment. thanks
One will face trouble while attempting to measure an unknown inductor with a very low series resistance(inductors made with thick copper wires or fewer turns or both)! The charge will get grounded first(because of the low resistance) before it can charge the capacitor!!
As an upgrade- Either disconnect the inductor from ground while the capacitor is being charged or eliminate the diode & resistor arrangement and instead simply charge the capacitor through the unknown inductor. At the end of charging cycle connect the inductor to ground !
Plz Help I have this message error when compiling code:
#error insert your used capacitance value here. Currently using 2uF. Delete this line after that
Do you gave any designs on a loudspeaker impedance tester?
After a long search, I found all the errors, both in the code and in the wiring.
Unfortunately, the published code is NOT the working code as shown.
- Definition of the variables: inductance__mH (with 2 instead of 1 underlines)
- look at the pinMode (11 and 12), INPUT and OUTPUT changed
- pin 13 in code comment and breadboard schematics is not in use. Only pin 11 and 12 needed! Video, Schematics and Code do not match.
Inductance meters now working fine and amazingly accurate for a DIY. Thank You!
can u share the working code please?
Can you tell me if the LM311 comparator is suitable?
Hi, Great video, just came across it. Is it possible to read inductors as low as 1nH, or is uH its limit?
This is very good, the first of yours that I have seen. I'll check out your other videos. I've subscribed!
ruclips.net/video/6mQ-LN3PGwY/видео.html
Hello, we made very nice Inductance meter according your schematic and program. Thanks
However, when we try to measure the inductance value from your said uH to mH. It is out of range, how can we modify the circuit?
A really well explained project!
ruclips.net/video/6mQ-LN3PGwY/видео.html
Thanks for making this so detailed 🙏
hi , made it and it works fine , but if you use 2.5uF capacitor and DON`T change the code , it works even better :)
Just charging inductor and rapidly checking current is good design?
Excellent tutorial. Kudos. Thanks for educating viewers like me.😀😀
ruclips.net/video/6mQ-LN3PGwY/видео.html
Hello
the whole time built up loud instructions only get it not at run somewhat does not fit there shows nothing at display is however okay.
Sir which software r u using for video editing
Is it possible to mearsure inductance of DC motor using this circuit? Also should i lock the shaft (so that it can't rotate) for the test?
you could. Depends of the motor. If it is very big it might be out of range.
Mili theMUFFIN I would lock it up if I were you so that it doesn't change inductance when and if it turns
Hi Electronicnoob, this is a great video for LC meters. My question is that is this project work WITHOUT a i2c connector? The arduino itseft can function directly connect to 1602 lcd.
During negative peak won't the diode be forward biased🤔 ... I think you have assumed the Arduino power supply to have a diode too?
What software is used for editing ?
Your code not work.... the library i2c can installed but after install not happened
Can i use ordinary lm324 or lm358 instead??
Thank You
Radio shake in my country dont have non-polarize 1uf
what happen if i use polarize 1uf.????
By increasing the capacitance you can achieve a bigger precision?
can i use ceramic or polar capacitor.because i cannot find non polar capacitor in my country
polar capacitor can not be used because it can only be charged in one direction but for oscillations to happen it should be able to charge both sides.
Its been a long time since then,but the non polarized capacitors have better capacitor accuracy and stability over the time compared to the electrolytic capacitors.
How to get this to work without ic2 disply? Just a normal none ic2??
Hey man can I use any other operation amplifier like lm358
What changes in program for make it without I2C
Super instructive video! Very good project. Thanks much.
ruclips.net/video/6mQ-LN3PGwY/видео.html
a little bit too late maybe but i have a question, it's possible to make it for smallers inductors like 33 uH inductors or speakers inductance?
Speaker inductance i dont think that is small value.
How accurate is this meter. Is it within say 10% . How does it compare with the basic meters on sale in shops. Please advise ANYONE ??
Hi, can i use lm358 instead lm339??
Awesome job, just make sure you smash that like button an odd number of times :)
LOL, thanks!
can I use a op amp as a comparator like lm348 op amp????
sorry i can not understand full concept of the circuit. The pulse is stop and the compartor read the residual resonance or the arduino sweep a lot of frecuncy ??
Is not residual. The resonance begin when you cut the pulse. When you go from 5V to 0, the LC tank will resonante and we read the frequency of that resonance. Good day!
@@ELECTRONOOBS thanks dude, saludos from Argentina, sorry for my english
Sera muy complicado hacer un medidor de resistencia equivalente "ESR". Estaria bueno hacer uno con Arduino o FPGA. !!!!!
What ranges does it measure inductance?
In the schematic you presented it looks as though nothing is preventing the voltage on the charging pin from being swung into the negative, something I'm sure the arduino doesn't appreciate much. I would suggest using that arduino pin to drive a small, robust mosfet which rings the circuit.
Atlas WalkedAway
A clamping diode to ground on the input pins should eliminate risk of negative voltage damage.
You’re absolutely right sir.
hi! very nice tuto Why the code doesn't works whith my arduino IDE The message is " liquidCrytal_I2C" not found.
I change 0x3f by 0x27 but no change. Library has "liquidCrytal" and I2C separate may be that the probleme.May be you can help thanks
Make sure you install the liquid crystal library that I give in the video description!
sorry for this noob question sir but can i use lm358 op-amp as a commparator??? beacause its the only component available for me at this time...your answer is very appreciated
ruclips.net/video/6mQ-LN3PGwY/видео.html
After a secong view of your video i can finally undertand the concept. The 5 volts desapear , the rosanance began but just live for a short time, you count this pulses. This is correct ??
Hey!!what is the mainimum value of inductance it can measure Very accurately ????
Hi, can i replace lm339 op amp with other op amp
Sir display not work properly. Display show to blank
Great I will make this.
Hi Thanks for this Inductance meter. I have build one . It is working but I don't get the correct values. I have played with different Capacitor values but is still not giving the correct value. I have put different values in spreadsheet to see if I am same factor out but it is not. Any idea what can I do to check for a problem.
How big is the error? You should change the resistance values in the code and fine tune de measurement...
Thanks for reply .The value on a 1000microH inductor reads about 800microH with 0.88microF cap. When I change cap to 2.37microF then value is only 650microH. In your reply you mention resistance value change in code . Is this a mistake because I did not see in code that, only change the capacitance value?
Nico de Klerk, it really seems to be a mistake. I think he meant "chage the CAPACITANCE value". See the code:
#error insert your used capacitance value here. Currently using 2uF. Delete this line after that
capacitance = 2.E-6; // - insert value here
Thanks for providing such a great video,
I had implement the capacitance as well as resistance meter and it worked.
Now, I am building this inductance meter and here, problem arises with lm741 as comparator, and now circuit is not working
Pls provide schematic diagram for lm741 as well.
LM741 is OP AMP not comparator so you need other circuit and code.
great video as always
hey man thanks for this great tutorial. But in my circiut it outputs about 10 time right value then it decreases for one time then again and again. Can you help me for that
ruclips.net/video/6mQ-LN3PGwY/видео.html
can i buy a ready to use inductance meter from you sir?
Hi Sir! Do you have emf meter?
How accurate is this ?
bro you are a LEGEND
bro I want to make a crossover frequency for my DIY speaker Project that's why I needed an Inductance meter
please help me
it's going to be center Chanel on my home theater system
I got 8-ohm tweeter and dual 8-ohm woofer in parallel that becomes 4 ohms in total
my tweeter is Dayton Audio DC28F-8
and woofer is Dayton-Audio-DA135-8
I know u have a lot to do but it's my first DIY project and I am really excited about it
thank you
hey, there nice work but your the result is coming gibberish. I have done all the procedure in proteus but the virtual terminal is showing some alphabet.can you solve, please?
Sorry, Dude your code for Arduino doesnt match on what we see on your video. I dont see in the loop anything like "Unknown inductance" serial print message. You even dont show how to use your device. When I connect inductance nothing is happening
Sergei Kurek yup! this is not the full code. if you noticed, the schematic was used in video was fully different from the schematic that uploaded in the blog. #Electronoob just manipulate us.
can you help me to make Arduino uno Auto range DMM multi meter minimum i required capacitance 10pf to 1000uf/ resistance 0.1 ohms to 4 mega ohms volts meter 0 to 1000 volts 3in one with one button mode change Like mode 1 resistance mode 2 capacitance mode 3 volts ? I hv Arduino Uno with keypad shield
LCD turns on but nothing is showing.... What now ?
hi electronoob, I made this circuit but get INDUCTANCE_MH not declared ... time to throw this away and buy a real LCR meter ???
Bro what is the refresh rate of display?
Great job man! Congratulation! Can i use a oled display in it?
hi bro can it meter industance from ferrite core inductor??
thanks for your excellent job, it is so useful
Can we measure the inductance which is less than 1uH, (for example 0.47uH).
ruclips.net/video/6mQ-LN3PGwY/видео.html
Can LM319 be used instead of LM339? Thanks!
Yes!
Electronoobs thanks! I have a 319 home and i will use it. To be honest, as far as i've seen from your schematic, you are using just one comparator out of 4
Yes, single OPAMP is more than enough. I've used that because is what I had, Keep up!
can lm393 be used , i had buy 393 mistakenly instead 339 or 319 ??
@@hacksci4fun439 Yes!
Can we measure about 0.5uH with this circuit
can it work with TL072 op-amp
What frequency it is measuring the capacitance at?
ruclips.net/video/6mQ-LN3PGwY/видео.html
Sorry but not work with i2c based on PCF 8574....the library non work...
Mr. Electrnoobs, sr... I have a question. Can I use LCD I2C adaptor and analog sensor? I'm asking that because I understand you couldn't use Analog Port to read two types of data (Analog and Digital) same time when SCL and SDA are digital I guess and For example LM35 or DHT11 output signal are analog, right? Best regards.
I don't entirely understand your question. Could you repeat it? Español tambien si quieres!
Keep up!
Electronoobs ok! lo siento. tengo entendido que al usar el puerto analógico para leer valores digitales (en tu caso, los dos terminales para el adaptador I2C) no se pDoria conectar un sensor analógico. que tan cierto es?
Si quieres usar el A4 y A5 como entrada analógica puetes. Pero no puedes usarloas a la misma vez que los usas para i2C.
ok, igual me referia a otra cosa. Por ej. Si uso A4 y A5 para el adaptador, ok? Puedo usar desde A0 a A3 para conectar sensores analogicos? Saludos
Claro que puedes. I si usas el arduino NANO tienes el A6 y A7 tambien como funcion de ADC
Can i use 741 op amp for this?
Somebody plz respond
Great tutorial. Thanks
Скетч не такой как на сайте. Есть новый?
What is the range of measurement?
Amazing videos Bro