View previous topic :: View next topic |
Author |
Message |
irmanao
Joined: 08 Apr 2015 Posts: 77
|
ADC for a AC signal question |
Posted: Wed Apr 08, 2015 10:39 am |
|
|
I have a ac signal from 0,1V to 3,1V that i want to process with a dspic. I would then like to do zero crossing (at 1,6V), my question is : are the 3,1V replaced by the value of 1023 (10bit) and the 0,1V by 0?
thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Wed Apr 08, 2015 10:56 am |
|
|
Depends on where you set the voltage references....
If you set Vref- to 0.1v, and Vref+ to 3.1v, then the ADC will read from 0.1v to 3.1v. That's what the reference inputs are for.... |
|
|
irmanao
Joined: 08 Apr 2015 Posts: 77
|
|
Posted: Wed Apr 08, 2015 11:00 am |
|
|
I wasn't aware of that, thank you very much, i am new to programming. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Apr 08, 2015 11:03 am |
|
|
Depends on your ADC, ac signal and what you want to do with the data.
Assuming your ac signal is swinging from 0V1 to 3V1, the ADC lower ref is 0V1 and upper ref is 3V1, then you are probably correct.
Depending on the nature of your ac signal you may not need to use zero crossing.
Mike
EDIT I see Mr T. got in as I typed. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Wed Apr 08, 2015 11:10 am |
|
|
It's NOT an 'ac ' signal if it transitions from +0V1 to +3V1, rather just a DC signal...
perhaps a 'moot' point but PIC ADC subsystems will NOT tolerate a real AC signal !!
jay |
|
|
irmanao
Joined: 08 Apr 2015 Posts: 77
|
|
Posted: Wed Apr 08, 2015 11:22 am |
|
|
Yes i know the average is not 0 so it's not a ac signal
thanks
the signal is a sine wave (50 Ηz) and i need to trigger a pulse for two SCR's at the 1.6V point after a delay |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Wed Apr 08, 2015 12:36 pm |
|
|
Also, seriously, 'step back'. The poster needs to start by doing some basic C programming before trying to work with AC.
1) Do a basic 'hello world' output.
2) Read an ADC, and then experiment with how the numbers relate to the voltages etc..
3) Learn how to loop, test, one stage at a time.
Trying to jump in the deep end, rather than starting with basics, is a sure way of wasting a lot of time. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Wed Apr 08, 2015 2:41 pm |
|
|
hmm....
the signal is a sine wave (50 Ηz)
NOW you're telling us it really IS an AC waveform, so you CANNOT feed that signal into the PICs ADC. well you can but risk destroying it !
The PICs ADC section is NOT designed for -ve voltages, ONLY +ve ones.
jay |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Apr 08, 2015 6:01 pm |
|
|
temtronic wrote: | hmm....
the signal is a sine wave (50 Ηz)
NOW you're telling us it really IS an AC waveform, so you CANNOT feed that signal into the PICs ADC. well you can but risk destroying it !
The PICs ADC section is NOT designed for -ve voltages, ONLY +ve ones.
jay |
I interpreted this differently as an AC signal superimposed on a DC offset. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9220 Location: Greensville,Ontario
|
|
Posted: Wed Apr 08, 2015 6:47 pm |
|
|
hmmmmmmmm... perhaps the original poster can show us an example of his input waveform.
A 50Hz sine wave usually tells me it's 'mains voltage' from across the pond.
Having a 'zero cross' at 1.6V when the signal goes from .1 to 3.1 does sound like superimposed AC on a DC level.
now I'm more confused....
a picture would be worth 1000 words ( or bytes !)
Jay |
|
|
irmanao
Joined: 08 Apr 2015 Posts: 77
|
|
Posted: Thu Apr 09, 2015 4:38 am |
|
|
It is superimposed on a DC offset |
|
|
|