Building an Inductor Meter without External Comparator | Arduino Nano

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 73

  • @5VLogic
    @5VLogic  9 หลายเดือนก่อน +3

    I'm curious to get feedback about the code explanation:
    Was it too long and should have been avoided?
    OK but shorter would be better?
    Good the way it is?
    Or even more in depth?
    Let me know, thanks!

    • @ivolol
      @ivolol 9 หลายเดือนก่อน +6

      I think going over the code that's already written, in functional steps, which can sometimes involve skipping around where necessary, is better than going down through it in a very linear fashion "as you write it". But still educational as it is.

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน

      I appreciate the feedback

    • @sovahc
      @sovahc 9 หลายเดือนก่อน +3

      You need split your code to modules/functions. Then give each module and each function the most understandable unambiguous name. Then do it with each variable. Instead of comments, try to give variables and functions the most understandable names. Add comment to the code only if there is no other way to make the program more understandable. The quality of the code needs to be measured by WTF-meter. 1. Give your code yo another human. 2. Check WTF count. Lower WTFs is better.

    • @theovannieuwenhuizen5756
      @theovannieuwenhuizen5756 9 หลายเดือนก่อน

      It wasn't too long, but (for me) a tad quick. Manipulation of the registers could be more in depth in a separate video maybe?

    • @Poult100
      @Poult100 8 หลายเดือนก่อน

      I think a thorough explanation is good and, as you did, allow viewers to skip if they want.
      I've been teaching adults for nearly 4 decades. Everyone wants different things with this; the math, the code, the schematic, etc. The only way you can get close to pleasing everyone is to do the lot but provide skip points.
      Excellent description of your project, thanks!

  • @levieux1137
    @levieux1137 9 หลายเดือนก่อน

    Great to see an arduino project coming with a makefile and that only requires a cross-compiler and not an insanely heavy environment! It's getting so rare these days!

  • @Jim_One-wl4ke
    @Jim_One-wl4ke 3 หลายเดือนก่อน

    What a synchronicity to what I hv been looking for. My multimeter don’t have inductance , this serve the learning and built a meter for use. Thanks for sharing ❤

  • @Cristi4n_Ariel
    @Cristi4n_Ariel 9 หลายเดือนก่อน +1

    Thanks for walking us through the code, it was very interesting!

  • @ghanrajsingh7347
    @ghanrajsingh7347 9 หลายเดือนก่อน

    I FOUND YOUR CHANNEL RECENTLY AND LEARNED SO MUCH ELECTRONIC

  • @theovannieuwenhuizen5756
    @theovannieuwenhuizen5756 9 หลายเดือนก่อน +1

    Thanks fot your in-depth video. Learned a few new things and if i find some spare time test it myself.
    Really enjoyed the explanation of your code. Would have liked to see the corrections incorporated in the video
    Best regards from the Netherlands.

  • @mcbirk4999
    @mcbirk4999 9 หลายเดือนก่อน +2

    great video, thanks!
    but with your shown code you won't ever get a reading of 'mH' unit because in line 131 you forgot to change the copied 'nH' string (with power of 3) to 'mH'...
    never the your code gave me a lot new inspiration - thanks again!

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน

      True, quite the eye for details!

    • @benhetland576
      @benhetland576 9 หลายเดือนก่อน

      More related details: With the right rounding error the value of _power_ can even become 255, in which case you could probably just display "H" as the unit which you don't show in any case. More theoretical perhaps, but generally a wrong unit will be displayed when (power >= 12), but you will have other numeric problems as well at this point... (perhaps even with ns-level calculations) The _divisor_ can also become 0 which you might want to just treat as an erroneous measurement.

  • @SusanAmberBruce
    @SusanAmberBruce 9 หลายเดือนก่อน

    I liked the code explanation, although for me, I will need to listen to it a few more times as it's quite advanced from my point of view, having said that it's an opportunity to learn new coding methods.

  • @styrishrodrigues
    @styrishrodrigues 4 หลายเดือนก่อน +1

    Great information, thanks buddy! ❤

  • @Johadart
    @Johadart 9 หลายเดือนก่อน +2

    Hi Mr 5VLogic, could you possibly put the code you used in the description, so people can learn it in their own time, apart from that, good job.. on a side note, not all people will pick up on this video, so share the link in the description pal.. 🤙🏼

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน +2

      Thanks, I'll try to get that done, maybe with a GitHub account

    • @Johadart
      @Johadart 9 หลายเดือนก่อน

      @@5VLogic Thankyou

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน +2

      The code is now available on GitHub!
      Link in the description

  • @erfanblaze4524
    @erfanblaze4524 5 หลายเดือนก่อน

    Thank you With the tips you gave, the program works well
    There is only one problem that it reads all the inductors, but it has a problem with small smd inductors like size 1206 and it doesn't show a number! I mean, where does the problem come from?

    • @5VLogic
      @5VLogic  5 หลายเดือนก่อน

      Hi, I'm glad you were successful in building the project!
      Although I don't have any SMD inductors to test, I'm relatively sure it's because they have high series resistance. Being so small they have to pack a high number of turns in there, and the wire has to be very thin. This means that the energy is lost quickly before it has time to oscillate enought to give a reading. I think the program discards measurements with less than 4 oscillations maybe(?), it's been a while...
      Also I don't know the value of your inductors, but low values are also not read, for similar reason, not enough energy is stored in them to oscillate enough and the Q factor is also lower, creating the same result.
      You could measure series resistance with an ohm-meter to verify the hypothesis if you'd like.

  • @mohaamoha9272
    @mohaamoha9272 9 หลายเดือนก่อน +1

    amazing explanation

  • @anithasshenoy6662
    @anithasshenoy6662 9 หลายเดือนก่อน

    Nice explanation of the logic (and code). Your explanation helps a lot. Was it too long ? NO. One question though. You copied the LCD.H to your folder and uses it. Is it different from the standard library ?

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน +1

      Hi, thanks.
      Hopefully I understand your question correctly; the standard libraries like are installed along with the compiler in a path that the compiler knows. The lcd.h is a custom one that must be added manually, therefore it is included with " ". It's path should be where the compiler is called, otherwise specified explicitly.
      I'm not an expert on this subject so hope this helps.

  • @incxxxx
    @incxxxx 8 หลายเดือนก่อน

    In general in that method you have to select different C for different L. It is serious obstacle.

  • @incxxxx
    @incxxxx 9 หลายเดือนก่อน

    It interesting, if you use about 20mH inductance coil, the result would be satisfactory? I measured L of secondary transformer output by UNI-T - it gave 17 mH but by some other tester it was 36 mH. But when I measured experimentally using formula J= U/sqrt(R^2 + XL^2) I obtained 111 mH.

  • @user-mr3mf8lo7y
    @user-mr3mf8lo7y 9 หลายเดือนก่อน

    Much appreciated the effort.

  • @BeetleJuice1980
    @BeetleJuice1980 9 หลายเดือนก่อน

    Great job!
    It would be nice to make a pcb like a shield for arduino nano.
    You can make the lcd smaller or maybe an oled that uses less power and space.
    Whats the max inductance it can measure? Can it be used for big coils like transformers?

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน

      Thanks! I thought of the PCB idea and but will wait until I add the capacitance and resistance measurement.
      For the max inductance, I've tested the low mH range and it works, but haven't pushed the limit.

    • @BeetleJuice1980
      @BeetleJuice1980 9 หลายเดือนก่อน

      @@5VLogic maybe the 5v are OK as voltage, as long as the mosfet and the psu can allow some amps to flow. Why not try with some transformers laying around?
      The pcb can be done even diy, you can provide an idea of the layout.

  • @Smit7ua
    @Smit7ua 9 หลายเดือนก่อน +1

    Thanks you a lot 👍 Great job! Wait for a new video 😉 Hi from Ukraine 🇺🇦

  • @carlo_geiss
    @carlo_geiss 9 หลายเดือนก่อน

    great ... so good info and practical action ... love it thank you ....greetings from North-Sweden .... Carlo SA2KHG

  • @someshmutha6805
    @someshmutha6805 8 หลายเดือนก่อน

    i am geeting constant value 26215nH of inductance for any value of inductance

  • @TPOCWGF
    @TPOCWGF 14 วันที่ผ่านมา

    Can i use a bd135 instead of bd137?
    And can i use arduino ide to upload/write the code?

    • @5VLogic
      @5VLogic  13 วันที่ผ่านมา +1

      The two transistors appear to be both NPN and have same pinot, so almost certainly yes.
      You can use Arduino IDE, just remove the main() and put the rest in setup() and loop()

    • @TPOCWGF
      @TPOCWGF 13 วันที่ผ่านมา

      @5VLogic thanks

  • @fase144
    @fase144 9 หลายเดือนก่อน

    Hi, today I found your channel and this video I really like it. New follower 👏

  • @nanolabhamlinux
    @nanolabhamlinux 9 หลายเดือนก่อน

    Hello.. I guess there is an error in line 131, around 13:08... should be mH, not nH, right?

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน

      That's correct

  • @erfanblaze4524
    @erfanblaze4524 6 หลายเดือนก่อน

    Hello I do the circuit according to the circuit I closed the video and checked it several times, I also used the hex file that you put in the new one It only says "open" on the LCD But the problem is that when connecting the inductor in the circuit, the board makes a connection and draws 1 ampere! Please guide 😢

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      When connecting the inductor to the circuit, it draws up to 1 amp and heats up the bd137 transistor and writes >open< on the LCD.

    • @5VLogic
      @5VLogic  6 หลายเดือนก่อน

      @@erfanblaze4524
      Hi, it's very difficult helping people through the internet debug circuits, but what I can do is give a few pointers and recommendations:
      1) Check your transistor, if it's truly a BD137 and not a PNP.
      2) Check the overall wiring. If you have and oscilloscope, probe all voltages around the transistor (the base in particular).
      3) See if compiling your code and using my .ihex file gives the same result, if not there could be a problem in the code (potentially mine as well, although I don't think so).
      4) Check the integrity of the arduino and it's pins, try an other GPIO to be sure, or test the one you're using with an LED to confirm it's working properly. Ideally check that it's capable of both sourcing and draining current.
      5) Try swapping the transistor, in case it was bad or it got damaged. A MOSFET should work fine, but use a series resistor to limit the drain-source current. Place it on the drain side, not the source because it won't turn on properly.
      Unfortunately if the problem is hard for someone working on it in person, it's REALLY hard for someone over the internet.
      The general approach I recommend is to progressively excluding all possible faults and faulty components, one at a time by testing or swapping them.
      I really hope that helps, good debugging!

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      My circuit worked correctly and the problem was using the software >avrdudess< to put the hex code on the arduino nano, when I connected it directly to the atmega328 with the stk500 programmer and programmed the hex code, the problem was solved and the circuit worked correctly. he does Anyway, thank you very much for your advice 🥰🙏

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      ​@@5VLogicMy circuit worked correctly and the problem was using the software >avrdudess< to put the hex code on the arduino nano, when I connected it directly to the atmega328 with the stk500 programmer and programmed the hex code, the problem was solved and the circuit worked correctly. he does Anyway, thank you very much for your advice

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      There is only one problem that it reads all the inductors, but it has a problem with small smd inductors like size 1206 and it doesn't show a number! I mean, where does the problem come from?

  • @erfanblaze4524
    @erfanblaze4524 6 หลายเดือนก่อน

    Hello
    What compiler did you use?
    And the hex code was generated?

    • @5VLogic
      @5VLogic  6 หลายเดือนก่อน +1

      Hi,
      I use avr-gcc as a compiler and avr-objcopy for the hex file.
      My makefile (and the whole project) is on GitHub and you can check it out and/or download everything there (link in description).
      In my case I run everything on Linux, but I think it should work on all OSs if the necessary utilities are installed.

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      ​@@5VLogic
      thank you I compiled with avr -stdio and put the hex into the arduino nuno And I closed the circuit and it says open on the LCD, and when I connect the inductor to the circuit, the board makes a connection! Maybe the problem is with my compiler, please upload hex file 🙏

    • @5VLogic
      @5VLogic  6 หลายเดือนก่อน +1

      Finally got it done, hopefully it's correct because I stopped working on this project since I turned it into the LC meter in my following video, but it should work. I'll upload the hex file for that one too in case you'd like to try it.

    • @erfanblaze4524
      @erfanblaze4524 6 หลายเดือนก่อน

      @@5VLogic tank you
      🥰

  • @caeli5532
    @caeli5532 9 หลายเดือนก่อน

    If you know, show us how to make generator on quartz resonator.

  • @incxxxx
    @incxxxx 8 หลายเดือนก่อน

    Without EXTERNAL comparator no way, it can be only waste of time. But your code is valuable and can learn much how to write properly.

  • @trongbangnguyen6706
    @trongbangnguyen6706 6 หลายเดือนก่อน +1

    You can provide file.hex
    I use windows so I can't use avr gcc. thank you.

    • @5VLogic
      @5VLogic  6 หลายเดือนก่อน +1

      Hi, it's already available on GitHub, link in the description.

    • @trongbangnguyen6706
      @trongbangnguyen6706 6 หลายเดือนก่อน +1

      @@5VLogic The description link does not have a .hex file but only an exe.ihex file.
      I don't flash it your way, so I need the file .hex

    • @5VLogic
      @5VLogic  6 หลายเดือนก่อน +1

      Ok, I updated the repo, try it now and let me know if there are any problems.

    • @trongbangnguyen6706
      @trongbangnguyen6706 6 หลายเดือนก่อน

      I don't want you to change the name, I want a .hex file that can be loaded directly with the NEO programmer tool without avdure or similar, I don't use linux, I have ch341 avr and nep SPI programmer.

    • @trongbangnguyen6706
      @trongbangnguyen6706 6 หลายเดือนก่อน

      I don't want you to change the name, I want a .hex file that can be loaded directly with the NEO programmer tool without avdure or similar, I don't use linux, I have ch341 avr and nep SPI programmer.

  • @__MINT_
    @__MINT_ 9 หลายเดือนก่อน +9

    Arduino libraries are mostly garbage based on other libraries written by noobs. I also prefer writing my own functions, just like it was done 20 years ago. Back then, code was a lot more efficient, nowadays people think that if we have fast microcontollers, we can waste some clock cycles and create shitty code

    • @5VLogic
      @5VLogic  9 หลายเดือนก่อน +3

      Totally agree

    • @__MINT_
      @__MINT_ 9 หลายเดือนก่อน +5

      Seems like you are even lower level programmer than me, I still use Arduino IDE despite writing in almost pure C, while you use vim on linux. Good to see that there are still some channels showing the proper way of doing things, instead of using pre-prepared solutions for everything. Yeah, it takes more time, but you also learn a lot more. I would say that it's the best way to master troubleshooting, logical thinking and pushing yourself to the limits not to give up. Not that long time ago I was crazy enough to write my own audio codec that beats MP3 when it comes to some aspects. Was it easy? Nope. But was it worth it? Definitely yes. Anyways, best wishes for you and your channel!

    • @tcarney57
      @tcarney57 9 หลายเดือนก่อน

      @_MINT: I suppose it depends on your definition of "garbage" and "shitty." Nothing that actually does what it's suppose to do can rightly be labelled as either. If it takes another half second for a program to run, who cares? If it uses code that theoretically can be optimized but it works anyway, why waste even more valuable time (the programmer's) to fuss with it? Since we _do_ have very-fast micro-controllers, why try to make the code faster than a person will even notice, at least for a test instrument such as this?
      If I insert an inductor in an instrument and it gives me a reading in 1.5 seconds instead of 15ms, I (the programmer/user) will never experience the delay in any meaningful way. This very long-standing concern with speed of execution--and with memory usage--if from an era when those things were either unavailable or costly. Now they're ubiquitous and _very_ cheap.
      The only other reason to make the fuss in all but the most critical applications (in which you wouldn't be using an Arduino anyway) is to assume a posture of superiority over "noobs" and to assert that twenty years of experience isn't just one year repeated twenty times.

    • @__MINT_
      @__MINT_ 9 หลายเดือนก่อน +2

      @@tcarney57 well, I'm a perfectionist, so something totally okay for others might be garbage for me. I'm not gonna define what shitty and garbage means, let's not elaborate too much. I demand from my code to be clear, fast, memory efficient and totally idiotproof. No bugs allowed, even minor. Creating such a code takes time, but I am satisfied with myself afterwards. Only exeption from above rules is writing temporary code for test purposes.

    • @__MINT_
      @__MINT_ 9 หลายเดือนก่อน +1

      @@tcarney57 I don't know why your reply is gone, but in my case it isn't "I am perfect". I am not perfect and I will never be. What pushes me to create "perfect" code is the need of an absolute control over what is happening and the need of having a feeling that the code is bug-free and stable. That implies using no libraries, unless I trust one, which isn't the case for most of Arduino ones, and also creating the code like it's some kind of fine art. I am something of an artist myself, very competitive one. Maybe my approach will change one day, I'm not even 20.

  • @samj1012
    @samj1012 9 วันที่ผ่านมา

    Arduino generally has so many bugs, often clashes with windows upgrades. U keep running in loops of solutions when u are on last minutes of submission.. It's time for serious developers to abandon this dinosaur..please guys 🙏 advise of any better alternatives .