Tuesday 24 July 2018

arduino - 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.



Answer



To get the proper output for both positive and negative inputs, you need a full wave precision rectifier. Here is a workable schematic:


enter image description here


You don't need R4 and the resistor values can be increased for relatively low frequency. This particular circuit uses an OPA2211 but other op-amp types can be substituted.


The dual op-amp requires a dual supply (+/-) for this to work properly. Something like +/-10V should work well. You can divide down the output to stay within range of your ADC.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...