All About Circuits Forum

All About Circuits Forum (http://forum.allaboutcircuits.com/index.php)
-   Embedded Systems and Microcontrollers (http://forum.allaboutcircuits.com/forumdisplay.php?f=17)
-   -   Problem With Dual Polarity Signal (http://forum.allaboutcircuits.com/showthread.php?t=87510)

Shear_Intelligence 07-22-2013 05:38 AM

Problem With Dual Polarity Signal
 
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 07-22-2013 12:06 PM

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.

Shagas 07-22-2013 12:57 PM

1 Attachment(s)
Quote:

Originally Posted by Shear_Intelligence (Post 629881)

i have to use it's internal ADC.


please help,
thanks in advance

ITS*


----------------------



Attachment 57667

Should work ..

ErnieM 07-22-2013 01:31 PM

Quote:

Originally Posted by Shagas (Post 629951)
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 07-22-2013 02:20 PM

1 Attachment(s)
Yes , forgot to add a voltage divider
Attachment 57668

what about now?

Shear_Intelligence 07-22-2013 04:36 PM

Quote:

Originally Posted by Shagas (Post 629970)
Yes , forgot to add a voltage divider
Attachment 57668

what about now?

okay i will simulate it and practise for it, but how do i program it? because A2D of avr will always find +ve voltages so how would i program it?

Shagas 07-22-2013 09:25 PM

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

Shear_Intelligence 08-01-2013 04:47 PM

Quote:

Originally Posted by Shagas (Post 630136)
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 08-01-2013 11:57 PM

Quote:

Originally Posted by Shear_Intelligence (Post 633166)
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.

Shear_Intelligence 08-02-2013 05:49 AM

Quote:

Originally Posted by ErnieM (Post 633294)
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.

no actually negative and positive cycles are different when motor is running under load, i believe!


All times are GMT. The time now is 12:44 PM.

Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright 2003-2014, All About Circuits. All Rights Reserved.