Measure frequency on a power wires of frequency converter

Hi!
I need to measure frequency on a power wires.
What i have: Arduino UNO, frequency converter Hitachi L100 (with 3 light bulb`s connected on a delta) and PC817 + LM358.

After LM358 signal looks like that (frequency 10 Hz):
IMG_000

I`m using standard code to function pulseIn(). (i have tried to pullup input pin. Wait LOW and HIGH signal...)
But on the serial monitor i have total garage. Random numbers, from zero to five thousand.

Question: what i`m doing wrong?

You're not posting correctly. Please read:

  • Might be something in the software :thinking:.

  • Might be in the hardware :thinking:.

1 Like

Have you carefully followed ALL the warnings in the Hitachi L100 documentation?

This is the code:

int pin = 7;
unsigned long duration;

void setup() {
  Serial.begin(9600);
  pinMode(pin, INPUT);
}

void loop() {
  duration = pulseIn(pin, HIGH);
  Serial.println(duration);
}

This the circuit:

Have you tried adjusting RV1? Have you scoped the Hitachi power outputs?

Hi, @Shamanestr
Welcome to the forum.

The 393 output is open collector, so you will need a pullup resistor.
Try an external 10K, the internal pullup may not be low enough.

Tom.. :smiley: :+1: :coffee: :australia:

Not really. You seem to have modified an LDR sensor module. Please post all the details of the module and how you adapted it. I think we may be looking at this.
Light Sensing Module - LDR [4589] : Sunrom Electronics

Please post complete information about your project activities.

Please clear up the discrepancies. You mentioned an LM358 but the schematic you posted, and a subsequent reference to LM393.

If you are measuring frequency, wouldn't you want the time between pulses, instead of the duration of a pulse?

1 Like

Try without the comparator.

image

1 Like

As I don't know this oscilloscope, and I didn't understand your image.
Is the screen at 2V per division, or does the indication say that the pulse has an amplitude of 2V?

image

ruilviana: it says the scope triggering is falling edge at 2.0V. The cyan 2.0Vx1 is the vertical scale.
Yellow 50mS is the horizontal scan rate.

2 Likes

That's what I thought but then what is the signification of the ± symbol ? What if I want to trigger at -2V ?

2V rising or falling. With that signal, you can't trigger at -2V since the signal is 0-4V, not negative.

1 Like

Thank you all, for helping me to solve this issue.

  1. 2 aarg: Yes. I have tried to adjust RV1. And do it with oscilloscope.

  2. 2 TomGeorge: Hi. I`m from Ukraine. We all love British people. (especially Boris Johnson).
    I have external pullup 10K (I forgot to described on circuit diagram). And I have tried internal pullup.

  3. 2 aarg: Yes. You right. But not LDR sensor module. Its NTC sensor module. And I check it on the oscilloscope. The scheme I described is the same to yours. (circuit that I draw dont have 2 LEDs, and R2 in my case is 100K. Also 2 filter capacitance).
    But you are right.

  4. 2 david_2018: Frequency converter generates a sinusoidal signal, so it doesn't matter.

  5. 2 LarryD: I have tried like this, at the start. But signal is noisy. With Schmitt trigger signal is more clear.

  6. 2 ruilviana: DSO NANO V3. Its a trigger for "signal searching mode". In "AUTO mode" this trigger doesn't meaning anything.

  7. 2 madmark2150: Tnx. You right.

Is there a ground connection between your modified NTC module and the Arduino?
I don't see one anywhere.

Yes.
I draw it in Proteus 8. And he doesn't draw power and ground in IC.
In real life I connected ground and VCC with Arduino.

It seems like you have done everyhing right but yet it is not working.

My guess is that here are very narrow noise spikes in the signal that won't be captured by the DSO nano scope. It only has a 200kHz bandwidth so narrow spikes that will trigger the UNO pulseIn input may not be seen on that scope.

What do you mean "rising or falling" ? The down arrow is for falling edge only !

I don't understand the signification of the ± symbol and your explanation is wrong even though a -2V trigger level doesn't make sense with a 0-4V signal.

But what will the scope show if I want to trigger at -2V (with the appropriate signal of course) ?

@Shamanestr
Could be a narrow 0 to 4V pulse that your scope can't capture
scope

1 Like