Measuring low voltage AC input

Good afternoon all,

I'm thinking about a project that will involve monitoring an AC signal between 0 and 1.2V RMS, frequency between 2kHz and 6kHz, using an Arduino (probably a Nano at this stage because I have a spare). I wish to monitor the input voltage and frequency. I intend to use two inputs to monitor the voltage and frequency on separate pins, using ideas that I've shamelessly pilfered from this forum. I want to output and/or log the voltage and frequency data, but I'll tackle that later. Right now I'm thinking about the hardware........

Voltage monitor - I plan to bridge rectify the AC signal and input it onto an analogue pin. I can then run a calculation within the Arduino to account for the volt drop over the rectifier, and convert to RMS.

Problem 1 - Ideally I'd like to opto-isolate the input signal as close to the source as possible (in component terms). Is that realistic on an AC signal, or would it be better placed after the rectifier?

Problem 2 - the bridge rectifier is naturally going to have a volt drop. On such a low input signal, will there be enough voltage left to give any meaningful data? I can afford to lose the data when the AC signal is below around 0.7v, but above that threshold I'd ideally like to capture the data.

Frequency monitor - I plan to half-wave rectify the AC signal, use the signal to activate (some kind of) transistor, and use the transistor to input onto a digital pin. I'll then count the number of pulses received within 1 second and I'll have my frequency.

Problem 3 - as above, my signal voltage is rather low. Is there a recommended transistor out there with a suitably low base-emitter voltage for this to work?

........or am I wasting my time with this project???

Thanks in advance

A bridge rectifier will drop 1-1.5V depending on the diodes used, so that won't work for your signal. Using schottky diodes here would help, as those drop 0.3-0.5V typically so your bridge would drop 0.6-1V. Overall not a good idea.

Different approach: connect it to an OpAmp, add a 2-2.5V bias, and you're nicely in a 0-5V range. For a 1.2V RMS (about 1.7V peak/peak) signal you can now connect it to a digital pin to measure the frequency. Just let the built-in Schmitt trigger do its job. That's the frequency taken care of.

Trickier is the voltage. Diodes are not linear in their voltage drop, so you want to avoid those. Best is probably to connect your biased signal to an analog input and start sampling, looking for highest and lowest values. Don't use analogRead(), it is too slow. Put the ADC In free running mode (about 9,600 sps) triggering interrupts the moment a conversion is done, in the ISR read the value and store it if it's a new top/bottom. Let it run for a second or two and you will have your high/low values.

The two inputs can actually be the same - to measure the frequency you read the analog pin as digital input, to measure the voltage use the same for measuring voltage.

an AC signal between 0 and 1.2V RMS

1.2V RMS is about 3.3V peak-to-peak so that's just about right for the Arduino's 0-5V ADC. "Zero" is also no problem. :wink: Near zero, the ADC is 10-bits so the smallest non-zero voltage you can measure is about 5mV. I assume that's OK?

For audio or other AC signals standard practice is to [u]bias[/u] the input at 2.5V (2 equal-value resistors and a capacitor). 2.5V will read about 512 on the ADC, and you can simply subtract-out the bias.

Alternatively, you can use a [u]protection circuit[/u] to kill the negative half of the wave. (I'd use a larger current-limiting resistor than the example but that depends on the impedance/current capability of your voltage source. You'll also need a higher value resistor across the analog input to keep it from floating.)

Of course, you are sampling a wave with an average of zero that crosses-through zero twice per cycle. So, you'll need to find/measure the peaks, average (of the postitive or absolure values) or RMS. If you know it's a sine wave the easiest thing to do is find the peak voltage and multiply by 0.707 to get RMS.


Frequency will likely be an issue. The ATmega datasheet says you loose accuracy above a sample rate of 15kHz so that means your signal can't be greater than 7.5kHz ([u]Nyquist[/u]). That would be OK with one 6kHz signal, but there is only one (shared/multiplexed) ADC so with two signals that limits you to 3750Hz (if you need to read them simultaneously).

Of course, that also means your voltage readings won't be accurate at the higher frequendies.

You'll also have to find the zero-crossings and calculate the frequency and your processor may be doing "other stuff" so you may run out of processing power and it might get even slower.

Thanks for the comments guys, food for thought.....

I like the idea of the DC bias. I do however need to ensure isolation from the source, so I'm thinking of using a 1:1 transformer before the coupling cap. As you say, it's easy enough to subtract the bias in the logic. The input will be a reliable sine wave, except when it's below around 0.5V; I can disregard anything below that level anyway. You've got me thinking now :slight_smile:

As for the frequency, I only need to monitor one input. The input signal will be one of several carrier waves (hence the 2-6kHz range), with an FSK signal applied. The FSK has an equal mark/space ratio so the carrier will average out anyway.

Thanks again!

If you have a true FSK signal, then amplify and clip it into a digital signal, which can be transmitted through an opto coupler. This gives maximum isolation and minimum time for reading the signal.

DrDiettrich:
If you have a true FSK signal, then amplify and clip it into a digital signal, which can be transmitted through an opto coupler. This gives maximum isolation and minimum time for reading the signal.

I'm not sure how you define a "true" FSK signal, but I doubt my application qualifies. In any case, it is the carrier that I'm interested in, not the FSK element. It is important that I capture the amplitude. I apologise for not making that clear earlier, I typed that post in a bit of a hurry :slight_smile:

If all you care about is the amplitude, but not at all the frequency, build a peak detector. This can be as simple as an OpAmp, one diode, a capacitor, and some resistors.

As stated in the first post, I need the amplitude, and the carrier frequency. I shouldn't have mentioned the FSK part, it's really a non-issue.

So... take your signal, apply the offset, then feed it to two separate circuits: one peak detection, one with an OpAmp with 5-10x gain to guarantee you hitting the limits, that doesn't give you a real block wave but it'll be close enough to easily count the frequency.

As long as you make the input impedance of your first stage high enough you won't significantly affect the signal you're trying to measure. You can get almost complete isolation by using two capacitors to lead the signal through: one for signal, one for ground. Just remember to double the size as they're effectively in series so half the capacitance.

If you used a precision rectifier followed by a r-c integrator you would obtain a reasonable measure of the average amplitude up to quite a high frequency depending on the opamp used.

If you squared your signal then fed it into a divider - eg with a 4040 and fed an arduino input with this, you could measure frequencies up to several MHz.

If you need accurate or RMS measurements things become more complex, and the arduino's reference voltage may be inadequate ( +/-2%)

If you need better than 2% accuracy of the frequency an arduino resonator reference is not good enough.

Allan