Hello,
I'm currently working a energy measurement/calculator type system. Basically, I need to measure and display voltage, current, power factor, and frequency to an LCD screen.
I am able to measure and display voltage and current readings, simply by using voltage dividers and current sensing resistors.
My next task is to obtain a frequency. My input voltage would be around 110-130V. I am having trouble grasping on how to program this in with C.
Here's what I know (from research): 1. Need to use a comparator. 2. Need to set up a timer and ISR 3. Need to to find zero crossing (how?)
I was looking into a A-F, like the LM331 to convert my voltage to a frequency, so I can have single logic level pulse stream. I've never used one of these badboys or even how to code this in.
Any direction would be greatly appreciated.
Thanks, Leon