Hi!
This project, which should be kind of easy, has stumped me. Hoping for some suggestions as what I could have missed.
I am trying to build a Arduino based inductance meter. I have followed the tutorial at electronoobs.
My problem is that the "pulseIn" function returns 0.000. I have checked the breadboard against the schematics several times. I have verified the components and switched the LM339 for a new one. I have simply run out of possibilities to check.
Link to the tutorial:
Electronoobs Inductance Meter
I have simplified the code (omitted the LCD-panel):
#include <Wire.h>
double pulse, frequency, capacitance, inductance;
void setup(){
Serial.begin(9600);
pinMode(11, INPUT);
pinMode(13, OUTPUT);
delay(200);
}
void loop(){
digitalWrite(13, HIGH);
delay(5);
digitalWrite(13,LOW);
delayMicroseconds(500);
pulse = pulseIn(11,HIGH,10000);
Serial.println( pulse );
if(pulse > 0.01){
capacitance = 1.E-6;
frequency = 1.E6/(2*pulse);
inductance = 1./(capacitance*frequency*frequency*4.*3.14159*3.14159);
inductance *= 1E6;
Serial.print("High for uS:");
Serial.print( pulse );
Serial.print("\tfrequency Hz:");
Serial.print( frequency );
Serial.print("\tinductance uH:");
Serial.println( inductance );
delay(10);
}
}
The code loads and runs OK.
Forum software prohibits me from attaching a photo of my breadboard (only one media allowed?), but I connected a scope to the resonator input (from D13) and the LM339 Output (to D11). The waveforms from this measurement is shown here:
This tells me that something is wrong. If I have read the specs LM339 Specs correctly then the output should remain high for the duration of the positive part of the measured wave. What am I missing?
Thanks in advance for any guidance or suggestions as to what to try next.
Thanks, Marie