I am trying to read a current waveform from a shunt resistor series with the power line.

Using a full bridge rectifier, I got the following waveform:

enter image description here

The waveform was sampled every 2 millisecond using an Arduino. Upon fourier analysis, I found that it contained a 100 Hz signal.

Since the supply frequency is 50hz in my region and being rectified the waveform is 100 Hz.

But I want to use opamps as a precision rectifier to get smaller voltages than the diode drop. I am using the below configuration. I tested the configuration by setting the input as positive and negative DV voltage from a battery and the negative DC was given as positive DC by the opamp.


simulate this circuit – Schematic created using CircuitLab

This is the current waveform obtained I got from the opamp:

enter image description here

The zero point of the waveform keeps changing periodically.

Is this a problem with the opamp configuration, or is there a better way to do full wave rectification using a single supply opamp?

EDIT: I meant to use 10 kiloohm resistors, not 10 ohm. 240-24 volt step down transformer signal divided between 10kiloohms and 1 ohms resistor UPDATE: The opamp configuration was working perfectly fine. The original signal contained the zero point oscillation.The full bridge rectifier's output was not showing this output because it was not strong enough to overcome the diode voltage drop. After increasing the voltage i was able to see the same signal from the full bridge rectifier as well. Phew!!!! Finding out ground truth is very important.

  • \$\begingroup\$ Considering how the recorded waveform looks like (low sampling rate) this might be an artifact caused by aliasing. How do you make sure that the signal is sampled with exactly 2ms? If the sampling period exceeds 2.5ms you will get into trouble with the nyquist theorem. \$\endgroup\$ – Sim Son May 25 '19 at 12:47
  • \$\begingroup\$ I wouldn't bet on the sampling time of the Arduino being all that steady, especially if you are transmitting the values live to the PC. \$\endgroup\$ – JRE May 25 '19 at 12:59
  • \$\begingroup\$ If you have access to a real oscilloscope, I'd check the output of your rectifier circuit. Failing that, Circuit Lab has a simulator. Run it and see what comes out. \$\endgroup\$ – JRE May 25 '19 at 13:01
  • \$\begingroup\$ I hope your actual resistors are more like 10,000 than 10 ohms... \$\endgroup\$ – Spehro Pefhany May 25 '19 at 13:27
  • \$\begingroup\$ Your sample rate seems much too low. Try sampling faster? Or at least use a smarter interpolation scheme. \$\endgroup\$ – Hearth May 25 '19 at 13:42

Your circuit (with proper resistor values) should work just fine. Try the below simulation.


simulate this circuit – Schematic created using CircuitLab

The way it works, for those who are questioning it, is that the lower amplifier OA2 maintains the non-inverting input of OA1 at 0V when the input goes negative, which means that you're getting Vout = -Vin (it's an inverting amplifier and R1/R2 are in play).

When the input is positive the positive input is at the input potential and the output drives then inverting input to the same potential, so the gain is +1.

Here's a simulation of the output with a 300mV peak input at 50Hz. It won't work very well at higher frequencies because the amplifier OA2 is driven into saturation and will have sluggish recovery, but for mains frequency it's more than okay (and it operates from a single supply with a dirt-cheap op-amp).

enter image description here

As an extra bonus, since it's powered from a single supply there is no need to protect the ADC input from possible negative transients.

| improve this answer | |
  • \$\begingroup\$ sorry i meant to put 10 kilohms. the original waveform is obtained from 10 kiloohms resistors. could the distortion be due to higher frequencies present in the signal. \$\endgroup\$ – Farvez Farook May 25 '19 at 13:49
  • \$\begingroup\$ Can you get access to an oscilloscope? This is one of those occasions where it will pay off big-time. \$\endgroup\$ – Spehro Pefhany May 25 '19 at 13:51
  • \$\begingroup\$ i really wish i could get one. could the distortion be due higher frequencies in the signal driving the opamp into saturation. if so should i low pass filter the signal befor sending it into the opamp. also why shouldnt i use 10 ohms resistor out of curiousity \$\endgroup\$ – Farvez Farook May 25 '19 at 13:52
  • 1
    \$\begingroup\$ Cool circuit. When the input is positive, OA2 does nothing and the output follows. When the input is negative, OA2 won't let OA1+ go negative and the you get an inverter. \$\endgroup\$ – Mattman944 May 25 '19 at 14:00
  • \$\begingroup\$ You can try that, you can try to tease a bit more information out by looking at the average voltage from the output and try feeding it a very clean signal from a voltage divider. You should not use 10 ohms because the LM358 is only happy driving a few mA and you'd be demanding more. At a few K to maybe 30 or 50K you minimize that without adding much error due to bias and offset currents. \$\endgroup\$ – Spehro Pefhany May 25 '19 at 14:02

I don't know what your circuit is doing. It doesn't look like a full wave precision rectifier, though.

Texas Instruments has a document describing precision full wave rectifiers.

An example from TI:

enter image description here

The idea is that D1 and D2 switch the signal paths so the the signal either goes through the inverting or non-inverting path through U1b.

The TI document goes into some detail about designing the thing. It isn't as simple as it looks.

At 50 (or 60) Hz, it ought to be pretty straight forward. TI shows examples, though, of what happens at somewhat higher (1 kHz) frequencies.

I missed the requirement for a single power supply. This circuit requires dual rails.

It isn't the right answer for the question, but I'll leave it here in case someone else finds it useful.

| improve this answer | |
  • \$\begingroup\$ The OP wants to do it with a single supply. Probably possible, but much easier to just add a negative supply and use this design. \$\endgroup\$ – Mattman944 May 25 '19 at 13:33
  • \$\begingroup\$ is this schematic applicable for single supply opamps \$\endgroup\$ – Farvez Farook May 25 '19 at 13:55
  • \$\begingroup\$ Nope. I missed that requirement. \$\endgroup\$ – JRE May 25 '19 at 13:55
  • \$\begingroup\$ hello i generated negative dc voltage using a centre tapped transformer and i am trying the circuit u have posted. where should i connect the ground terminal \$\endgroup\$ – Farvez Farook May 25 '19 at 16:08
  • \$\begingroup\$ Ground on a center tapped transformer is usually the center tap. \$\endgroup\$ – JRE May 25 '19 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.