Measuring inductance with arduino

Hello everyone,

So I'm doing a project and want to measure inductance with arduino.

I have as reference this page Easily measuring inductance with Arduino | ReiBot.org

My wiring: its attached

Code I'm using:

/*Thanks. Remember to visit my Youtube channel
If you don't whant to Serial print the valeus just delete the serial. print lines
and leave just the LCD print ones.
I've used a i2c LCD screen module.
*/
//LCD config
#include <Wire.h>

//13 is the input to the circuit (connects to 150ohm resistor), 11 is the comparator/op-amp output.
double pulse, frequency, capacitance, inductance;
void setup(){
Serial.begin(115200);
pinMode(11, INPUT);
pinMode(13, OUTPUT);
Serial.println("Why hello!");
delay(200);
}
void loop(){
digitalWrite(13, HIGH);
delay(5);//give some time to charge inductor.
digitalWrite(13,LOW);
delayMicroseconds(100); //make sure resination is measured
pulse = pulseIn(11,HIGH,5000);//returns 0 if timeout
if(pulse > 0.1){ //if a timeout did not occur and it took a reading:

capacitance = 1.85E-4; // - insert value here

frequency = 1.E6/(2pulse);
inductance = 1./(capacitance
frequencyfrequency4.3.141593.14159);//one of my profs told me just do squares like this
inductance = 1E6; //note that this is the same as saying inductance = inductance1E6

//Serial print
Serial.print("High for uS:");
Serial.print( pulse );
Serial.print("\tfrequency Hz:");
Serial.print( frequency );
Serial.print("\tinductance uH:");
Serial.println( inductance );
delay(100);
}
}

My result: Attached

So my result I think are pretty good but my question is, I'm trying to blow on a fan that contains a magnet (attached picture) to produce magnetic field and then measure the fan speed from the inductance but the reading isn't reliable.

I have a small wind meter like this one:https://www.amazon.com/dp/B01NATTEWW/ref=asc_df_B01NATTEWW5268830/?tag=hyprod-20&creative=395033&creativeASIN=B01NATTEWW&linkCode=df0&hvadid=179324813409&hvpos=1o2&hvnetw=g&hvrand=513705598981329663&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9031118&hvtargid=pla-306210649405

And it works with inductace, and want to make the same.

Can somebody help me?

A magnet induces a voltage in a coil - the inductance as such is not the important point for that sort of sensor,
the flux-linkage between magnet and coil is.

I see, so do you know if I can calculate that using arduino?

I am trying to make this:

Do you know how this exactly works and if I can make it with arduino?

I have a photo of the inside of the wind meter and you can see the inductor on the top.

The usual way to detect the magnet is to time the pulses coming from a Hall Effect sensor that is positioned to detect the coming and going of the magnet as the rotor turns. A magnet can also induce a voltage in an inductor, but either way, you are just measuring pulse frequency.

Do you know how this exactly works and if I can make it with arduino?

There are many possible ways that could work. You would need to buy one and take it apart to see which.

Google "arduino diy wind speed" for lots of build-it-yourself project examples.

aarg:
A magnet can also induce a voltage in an inductor, but either way, you are just measuring pulse frequency.

Yes I know that, but how can I read that using an arduino? Isn't the voltage AC ?

Mikelagoud:
Yes I know that, but how can I read that using an arduino? Isn't the voltage AC ?

So is inductance. :slight_smile: I seriously suggest you google some anemometer projects before you go on...

aarg:
So is inductance. :slight_smile: I seriously suggest you google some anemometer projects before you go on...

aarg:
So is inductance. :slight_smile: I seriously suggest you google some anemometer projects before you go on...

I know, I've been measuring the the inductor with a volmeter in AC when magnetic field appears and changes from the fan I have and has a magnet inside. My question is how do I measure that with arduino.

I've searched on internet and I have only found wind meters with IR sensors (not what I want) or with inductors.

Tell us how you plan to build a wind speed meter (an anemometer) using an inductor, and we can help with the rest.

PS: here is one made using a magnet and a reed switch.

Just use a hall switch, reed switches eventually wear out, and the magnetic drag from the reed may
slightly influence the rotation. Very good low-drag bearings are essential, which suggests RC helicopter
miniature ball-bearings as a possibility if building the mechanics. Small flanged bearing would make sense,
as would stainless (non magnetic).

You can also count rpm using an optical sensor.

Mikelagoud:
I've searched on internet and I have only found wind meters with IR sensors (not what I want) or with inductors.

https://www.google.ca/search?q=hall+effect+sensor+anemometer

jremington:
Tell us how you plan to build a wind speed meter (an anemometer) using an inductor, and we can help with the rest.

PS: here is one made using a magnet and a reed switch.

Hi there, so I bought this wind meter from amazon (link in the end) and I opened it and found out that it works by sensing magnetic field from a fan that has a magnet, the circuit board has an iductor placed right bellow the fan, it has also a frequency crystal. So my question is if its possible to make a circuit like that to take the reading to the arduino and not with hall effect sensor or IRs. Do you know?

if its possible to make a circuit like that

Yes, that is what we have all been telling you.

jremington:
Yes, that is what we have all been telling you.

Can you please explain me then because I don't seem to get it.