# Using an OP-AMP to obtain absolute value

I want to constantly log the voltage of waveform that is coming off a electromagnetic harvester into a SD card. I wish to use the ADC of an Arduino in conjunction with an SD card to do so.

My problem is that as MCU ADCs cannot measure voltages when in negative form, and because the harvester produces voltages from +6V to -6V, I must create a circuit that can reflect negative voltages as positive. I believe I can do this if i can take the absolute value of a voltage using op-amp. I do not mind externally powering the operational amplifier. I only want to record the values of voltages coming off the harvester into an SD card.

Please note that I do not mind logging the negative voltages as positives. I only want to calculate the energy across the load of the electromagnetic harvester. Additionally, as the Arduino ADC cannot take in voltages beyond 5V, I can use the simple resistor divider to reduce the the max voltage of 6V to 5V.

I would appreciate if I can be shown how to configure an op-amp to operate as modulus operator to take in the harvester voltage waveform and make a (rectified) waveform. I would also appreciate a recommended op-amp device.

I would like to also mention that by absolute value, i mean the absolute size of a number. That is, we disregard any sign it might have. Example The modulus of −8 is simply 8.

• I think you need a rectifier. Apr 25, 2016 at 19:52
• A precision rectifier is what you are looking for, this will give you the absolute of the voltage input. Apr 25, 2016 at 19:55
• @uint128_t Please post this comment as answer and may be (please) with a potential op amp that might work. I will accept as answer. Apr 25, 2016 at 19:59
• The 'modulus' is the remainder after a division. What you're looking for is the 'absolute value' which, as uint128_t has already noted, is what a precision rectifier will give you. Apr 25, 2016 at 20:04
• @brhans Thank you. I have corrected my post accordingly. Apr 25, 2016 at 20:06