Maker Pro
Maker Pro

Problem reading frequency using arduino on pin f5

Bishnu Bhatta

May 28, 2016
6
Joined
May 28, 2016
Messages
6
I tried measuring the frequency using the output generated by LM 311 ic but arduino couldn't do so. Can any one please help me figuring out flaws at my circuits. The circuit looks kinda like this :)
 

Attachments

  • LC meter new.zip
    62.3 KB · Views: 120

MrEE

Apr 13, 2012
84
Joined
Apr 13, 2012
Messages
84
I tried measuring the frequency using the output generated by LM 311 ic but arduino couldn't do so. Can any one please help me figuring out flaws at my circuits. The circuit looks kinda like this :)
I couldn't open your files because I don't have the appropriate sw for them. Try posting a pdf or jpg image
 

Bluejets

Oct 5, 2014
6,901
Joined
Oct 5, 2014
Messages
6,901
There would be 2 parts to this design, the program being just as important I would imagine.
 

MrEE

Apr 13, 2012
84
Joined
Apr 13, 2012
Messages
84
are you using the coil to magnetically pickup a signal? Are you able to verify there is a valid output at the comparator? If so, then the problem is in the firmware. Did you write it yourself or did you load an example code?
Your comparator circuit is overly complicated, but first let's at least see if you have any useful output
 

Bishnu Bhatta

May 28, 2016
6
Joined
May 28, 2016
Messages
6
are you using the coil to magnetically pickup a signal? Are you able to verify there is a valid output at the comparator? If so, then the problem is in the firmware. Did you write it yourself or did you load an example code?
Your comparator circuit is overly complicated, but first let's at least see if you have any useful output

I checked the output in Oscilloscope and the time period turn out to be fine :)
I guess there's some problem with the Arduino program...
can you help me writing the code :)
 

MrEE

Apr 13, 2012
84
Joined
Apr 13, 2012
Messages
84
Maybe. What frequency range do you expect to measure? Can you post the code you have so far
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
This is a popular inductor and capacitor measuring circuit. It is based on measuring the frequency change that occurs in an LC oscillator when the unknown inductor or the unknown capacitor is placed in parallel (capacitor) or in series (inductor) with the built-in L and C oscillator components. There are many variations on the microprocessor used to measure frequency, but the oscillator circuit stays pretty much the same. Look at the schematic images here for some idea of the variations. Compare with the PIC implementation in the image below:

lc_meter_pic16f84a.jpg


Or this one, based on the popular ATMega:

LCF%20meter.GIF


The problem with the novice trying to duplicate any of these is usually the microprocessor code. The easiest solution is probably to measure the period of the LM311 oscillator output and use floating-point math functions to calculate the inductance or capacitance that caused the change in frequency. Or you could just buy one that works without any additional coding required, but where is the fun in that?.
 

Bishnu Bhatta

May 28, 2016
6
Joined
May 28, 2016
Messages
6
This is a popular inductor and capacitor measuring circuit. It is based on measuring the frequency change that occurs in an LC oscillator when the unknown inductor or the unknown capacitor is placed in parallel (capacitor) or in series (inductor) with the built-in L and C oscillator components. There are many variations on the microprocessor used to measure frequency, but the oscillator circuit stays pretty much the same. Look at the schematic images here for some idea of the variations. Compare with the PIC implementation in the image below:

lc_meter_pic16f84a.jpg


Or this one, based on the popular ATMega:

LCF%20meter.GIF


The problem with the novice trying to duplicate any of these is usually the microprocessor code. The easiest solution is probably to measure the period of the LM311 oscillator output and use floating-point math functions to calculate the inductance or capacitance that caused the change in frequency. Or you could just buy one that works without any additional coding required, but where is the fun in that?.

Let me try this one!
When worked I can tell ya! :)
 
Top