Real time analysis of mains frequency

AI Thread Summary
To measure mains frequency in real-time using Python, users can consider DIY solutions with microcontrollers like Arduino or Raspberry Pi, which allow for measuring zero crossings to determine frequency. For those lacking hardware experience, commercially available multimeters with USB or Bluetooth capabilities may suffice, providing necessary accuracy for non-professional installations. High accuracy is essential for developing signal processing algorithms, and options like voltage-to-frequency converter ICs can facilitate this. Users are encouraged to research and reach out to manufacturers for suitable devices that meet their requirements. Exploring both DIY and commercial solutions can lead to effective outcomes in frequency measurement projects.
Michael Campbell
All,
I could use some help. I would like to measure mains frequency in real-time and pass the data through a high-level programming language (preference of Python).

I am not sure where to start with this project, I assume commercial mains frequency analyzer exist, however, my google searches have only found highly engineered units like this:
http://www.arbiter.com/catalog/product/model-1133a-power-sentinel.php .

Which I'm sure is a great piece of kit, but when you have to ask for the price you probably can't afford it.

Has anyone solved this problem before, on a tight budget?

Thanks in advance.
 
Engineering news on Phys.org
:welcome:

If you have a small computer, say Arundino or Rasberry PI, and if you are able to make your own circuits, it is easy. All you need to do is to measure the time between zero crossings.

Or do you have a PC or Mac and are looking for a turnkey USB device?
 
Thanks.
I have considered a DIY solution, but I don't have any experience in building hardware solutions (only software). And with limited time available I would prefer to buy a unit built by experts, which I could interface to a PC, Mac etc.
 
In that case, a modern multimeter might be best. A quick search on Amazon found this one which claims USB and bluetooth connections to your phone or computer, and it has a Hertz scale. I've never used such a device, but you could research it.https://www.amazon.com/dp/B00SGKR9FA/?tag=pfamazon01-20
 
Is this a professional / commercial installation. What accuracy is needed? Mains frequency typically varies by only small amounts so a specially built meter is needed.
 
jim hardy said:
Why not contact these folks and see how they do it ?
Their real time displays of frequency and phase are fascinating.

http://fnetpublic.utk.edu/anglecontour.html

Tennesseans are naturally friendly .
Thanks, ill send them an email.
 
Windadct said:
Is this a professional / commercial installation. What accuracy is needed? Mains frequency typically varies by only small amounts so a specially built meter is needed.

NEW
Yes, this would be a non-professional installation, but the requirement is for high accuracy/sampling. The end goal is the development of signal processing algorithms.
 
anorlunda said:
In that case, a modern multimeter might be best. A quick search on Amazon found this one which claims USB and bluetooth connections to your phone or computer, and it has a Hertz scale. I've never used such a device, but you could research it.https://www.amazon.com/dp/B00SGKR9FA/?tag=pfamazon01-20
That could be a quick win. I'll certainly investigate the multimeters.
 
  • #10
Before you start, you have to decide what accuracy of f measurement you need. There are many cheap counters with good crystal oscillator references in them. It could simply involve hooking one of those up with a data link to your PC.
 
  • #11
Michael Campbell said:
NEW
Yes, this would be a non-professional installation, but the requirement is for high accuracy/sampling. The end goal is the development of signal processing algorithms.
As anorlunda said, you can build some circuits and use them with a microcontroller like arduino.

You can measure the time delay between successive zero crossings and get the frequency directly.

Or you can use a voltage to frequency converter IC (look up LM331) and feed its output to the microcontroller.

You can also use FFT, but I don't know much about that.
 
  • #12
Would something like this work?
freqmeter.jpg
 
  • #14
cnh1995 said:
As anorlunda said, you can build some circuits and use them with a microcontroller like arduino.

You can measure the time delay between successive zero crossings and get the frequency directly.

Or you can use a voltage to frequency converter IC (look up LM331) and feed its output to the microcontroller.

You can also use FFT, but I don't know much about that.
Yes, I wish I had the time/skills to build a frequency monitor.
 
Back
Top