Problem With Dual Polarity Signal

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
Hi There,,

Well for my project i need to convert non-pure sine wave from analog to digital i'm quite okay with converting single polarity signals e.g from sensors, but i'm confused how do i convert dual polarity signal.

PS: i'm using AVR atmega16A, i have to use it's internal ADC.


please help,
thanks in advance
 

John P

Joined Oct 14, 2008
2,026
The quick and dirty method is to set up a voltage divider with two resistors, one driven by your sine wave and the other connected to the processor's power supply, and the A/D input taken from the junction point between the resistors. You have to choose the ratio of the resistors so that the A/D always sees a positive level, and you have to allow for the fact that the average level of the signal will be based on the resistors and the actual voltage level of the power supply.

The more elegant way to do it is use an op amp circuit, which would let you place the incoming signal so it's centered at half the A/D converter's range, and the amplitude could be set to give you best accuracy.
 

ErnieM

Joined Apr 24, 2011
8,377
Should work ..
I doubt that. (With vin = vout why would you expect anything else?)

If you have your A2D voltage source handy, make a voltage divider of equal values to ground. Connect the signal thru a cap to the junction and that becomes the offset signal point.

Resistor value should be at leat ten times the source resistance, and the cap value large enough to pass the lowest frequency.
 

Shagas

Joined May 13, 2013
804
Well what are you even planning of doing with your sin wave conversion?
What is the range of the sin wave? You might want to amplify it so it has a range of 0 to 5 volts (NOT more than that! and assuming that you are using 5v for your micro)
Otherwise you can give the adc a diffrent Vref. There is a special pin for that.

I haven't tried the circuit that I drew on the breadboard but I think it should work fine and you should get a 0 to x voltage which you can feed to your adc . But again .. you should note the range that your sin wave is at
 

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
Well what are you even planning of doing with your sin wave conversion?
What is the range of the sin wave? You might want to amplify it so it has a range of 0 to 5 volts (NOT more than that! and assuming that you are using 5v for your micro)
Otherwise you can give the adc a diffrent Vref. There is a special pin for that.

I haven't tried the circuit that I drew on the breadboard but I think it should work fine and you should get a 0 to x voltage which you can feed to your adc . But again .. you should note the range that your sin wave is at
i need to plot the current drawn by an induction motor on my pc for this i used current transformer now problem is that sinewave is dual polarity.
 

ErnieM

Joined Apr 24, 2011
8,377
i need to plot the current drawn by an induction motor on my pc for this i used current transformer now problem is that sinewave is dual polarity.
Ah ha... isn't the polarity of the negative half the same as the positive half?

Just clip the signal and measure the positive peak. Or peak detect it.

Easy Peazy.
 
Top