Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Frequency measurement with red frequency meter module

electronium

Member
Hello guys, I hope you are doing well
Is it possible to measure city electricity frequency and pwm peak of power transistor with this module? How is it possible?
HF3wOk_83Xvz5hb3.jpg
 

Attachments

  • HF3wOk_83Xvz5hb3.jpg
    HF3wOk_83Xvz5hb3.jpg
    92.9 KB · Views: 270
Do you have a datasheet for the module ?

Based on test pins and no user interface per se no to your question
on power. Maybe frequency....

Module is marked to test crystals, so not on line voltage testing.....


Regards, Dana.
 
Not likely to measure low f, as this needs a TI counter with inversion
 
Last edited:
Not likely to measure low f, as this needs a TI counter with inversion
Why would you imagine that? - the original frequency counter used an antique OTP PIC in the original app. note, later it was moved to the 16C84, 16F628, and countless PIC devices.

However, as it's a crystal tester, it may well not be programmed to read low frequencies?.
 
It's a clone of DL4YHF's frequency counter with a frequency range of 1Hz-50MHz.

However, the input on the module is unbuffered straight to the PIC pin so even looking at it funny can damage it.

Putting mains voltage across it will result in a molten mess of components and pcb.
 
o you have a datasheet for the module ?

Based on test pins and no user interface per se no to your question
on power. Maybe frequency....

Module is marked to test crystals, so not on line voltage testing.....


Regards, Dana.
I have prepared the picture you requested in the form of a schematic and block diagram for you to help me, is it possible to measure the frequency of city electricity and the power transistor of switching power supplies with this module and what points should be observed so that the module is not damaged؟

chrome_GWRUFJbokY.png

chrome_wDqoDDrjIn.png


chrome_ebhRzcGqdJ.png

chrome_Xl5yV7BOJO.png
 
Last edited:
The "pulse input" does appear to connect directly to the PIC, as augustinetez thought it may.

That needs over voltage protection and a very high impedance feed to avoid damaging the PIC.

I'd add two schottky diodes from the input pin to 5V and 0V, so they conduct if the voltage goes beyond the PIC supply rails.

Then a series resistor and capacitor directly at the module input, eg. 100K and 0.1uF, to limit the current to the input pin. That should work fine for low voltages, 5V peak to peak up to a few tens of volts.

For measuring 240V power, use an additional resistor divider, eg. 1M from live and 47K to AC ground, directly at the point you want to measure.

Connect the above protected input from the junction of the two, so the added meter input circuit only sees around 12V RMS.

(Hypothetically, with the voltage divider plus the 100K series input resistor, the PIC input protection diodes would only have a fraction of a milliamp through them, so the schottky diodes should not be needed - but I'd rather not risk damaging it for the sake of a couple of extra diodes).
 
The "pulse input" does appear to connect directly to the PIC, as augustinetez thought it may.

That needs over voltage protection and a very high impedance feed to avoid damaging the PIC.

I'd add two schottky diodes from the input pin to 5V and 0V, so they conduct if the voltage goes beyond the PIC supply rails.

Then a series resistor and capacitor directly at the module input, eg. 100K and 0.1uF, to limit the current to the input pin. That should work fine for low voltages, 5V peak to peak up to a few tens of volts.

For measuring 240V power, use an additional resistor divider, eg. 1M from live and 47K to AC ground, directly at the point you want to measure.

Connect the above protected input from the junction of the two, so the added meter input circuit only sees around 12V RMS.

(Hypothetically, with the voltage divider plus the 100K series input resistor, the PIC input protection diodes would only have a fraction of a milliamp through them, so the schottky diodes should not be needed - but I'd rather not risk damaging it for the sake of a couple of extra diodes).
Did you mean to measure the city's electricity frequency?
13.png

and to measure a low voltage signal of 12 V AC
88.png
 
Those are the two sections I meant, or near enough - but the second one would be permanently connected to the meter, and the output of the high voltage one (about 12V out) would connect to the input of the low voltage one.

(Also, another schottky diode from IN to the meter +5V to protect it from anything higher than the PIC supply voltage, in addition to D1 protecting it from anything below 0V).

The meter PCB photos show two different versions, with different input pads as well as extra components; if you have one with the crystal tester components fitted, you may need to remove whatever of that connects to the PIC input to prevent it interfering with the external input.
 
Those are the two sections I meant, or near enough - but the second one would be permanently connected to the meter, and the output of the high voltage one (about 12V out) would connect to the input of the low voltage one.

(Also, another schottky diode from IN to the meter +5V to protect it from anything higher than the PIC supply voltage, in addition to D1 protecting it from anything below 0V).

The meter PCB photos show two different versions, with different input pads as well as extra components; if you have one with the crystal tester components fitted, you may need to remove whatever of that connects to the PIC input to prevent it interfering with the external input.
I did not understand what you mean, if possible, draw the circuit for me
 
Last edited:
draw the circuit for me
OK:

This part converts the PIC logic level input so it's safe for general use at low voltages, so should be permanently connected to the module; fit it in whatever casing you use for that:

f_meter_input.png



And this attenuator part, to fit at the 240V source being measured, reduces the voltage so it can connect to the above circuit:

f_meter_Adapter.png


If you are going to probe different AC sources, build the attenuator in to something like an old ball pen casing to use as a handheld probe and use screened cable to connect to the meter part.
 
OK:

This part converts the PIC logic level input so it's safe for general use at low voltages, so should be permanently connected to the module; fit it in whatever casing you use for that:

View attachment 143752


And this attenuator part, to fit at the 240V source being measured, reduces the voltage so it can connect to the above circuit:

View attachment 143753

If you are going to probe different AC sources, build the attenuator in to something like an old ball pen casing to use as a handheld probe and use screened cable to connect to the meter part.
Thank you very much, dear engineer.... I hope to be active in the forum in a purposeful and meaningful way as far as I can. I have many things to say.
 
Why would you imagine that? - the original frequency counter used an antique OTP PIC in the original app. note, later it was moved to the 16C84, 16F628, and countless PIC devices.

However, as it's a crystal tester, it may well not be programmed to read low frequencies?.
There's a good reason for it.

How you implement it is not what I meant. It is how it functions that matters.

In order to compute high resolution accuracy, high f uses fixed time intervals stepped for duration.
For low frequency you use stepped number of cycles with a high frequency time interval counter to measure each cycle, accumulate N- stepped cycles then invert and decimate. this way you can get the fastest result and most accurate with an OCXO 10MHz ref scaled to desired f.

HP invented a dual fractional n synth for their < 50 MHz counters. and dual PLL fractional N synth for the microwave counters. That was decades before PIC was even thought of in the early 70's.

If it is just a crystal tester, mixing with known Rs and Cp to compare with a known accurate reference is ideal using a doppler sawtooth method in H/W, S/W for analog or digital for ppb or ppm error. Then standard CMOS inverter is all you need with a known input pF load. Each choice depends on the design specs for accuracy.

In this question to measure line frequency , one simply needs a low freq amplitude into an ac coupled CD4001 inverter With R feedback for self bias and ESD protection if desired, or similar at PIC logic levels, power supplied by PIC to drive the input port. It measures down to 1 Hz, so you won't get high resolution, maybe +/1 Hz.

To get high resolution to use a a 10^N divier and PLL chip to FLL ( freq locked loop) to scale down to 50/60 Hz from say 500/600 kHz and divide down to get 4 extra digits.
 
Last edited:
To get high resolution to use a a 10^N divier and PLL chip to FLL
...
Or just count microseconds between eg. positive zero crossings? One microsecond away from the nominal 20,000 count is around 0.0025Hz, so not too shabby!

It would need slight rework of the circuit, swapping a couple of pins to use an input capture CCP1 & TMR1 rather than TMR0 in, but very possible, without extra components or complications.

Edit - I was thinking the MCU ran at 4MHz; it's 20MHz so 5 MHz count, and accuracy to the full three decimal places, +/- 0.0005 Hz at 50Hz.
 
verify below before doing above . 5.1V Zener and Vf reverse may be too much
1703374356267.png


1703374862266.png

1703374971415.png


5.1 V @ 47mA using this model with 12V rms you actually get 10% more typ. with no load on transformers so assume exact input V output is 13.2rms no-load.

Then with this Zener model due to 100k Vp,Ip are; +5.01 V and -10 mV at -155 uA pk sine so Good.
1703375414639.png


I like using simple Falstad's browser simulator OR any tool you know how to specify exactly.

Once you have verified and understood diode VI response, you can do this approx in your head.
 
Last edited:
What if you had no 5.1 Zener diodes? Could you use Schottky diodes? yes, Silicon Diodes ? yes, No diodes? yes but only if very low current xx uA as the internal ESD protection shown below in all CMOS devices (within wide R tolerances) say even when you see almost +/1V on the input ,the two stage std CMOS ESD protection will PREVENT SHOOTTHRU FAILURES . The ABS.MAX assumes low impedance on 300 mV overshoot.


1703378075536.png

Also Note in datasheet above the RESET low drive suggests adding 100 Ohms is series necessary to dampen high Q LC resonant undershoot due to trace L = 1nH/mm and Cin 3 ~6 pF typ. This is because CMOSdrivers in 74HCxx 5V drivers are ~ 50 Ohms +/33% typ which still cause over/undershoot, while adding 100 Ohms guarantees most traces to not be underdamped.

This shows that the dual Zener method works best yet, no diodes also works safely when you understand the current limit and ESD internal protection.

What am I assuming here?
 

Latest threads

New Articles From Microcontroller Tips

Back
Top