# Analog to Digital converter channel Classic List Threaded 5 messages Reply | Threaded
Open this post in threaded view
|

## Analog to Digital converter channel

 Is the input to the Analog to Digital converter channel of the MC68HC12 analog ac or analog dc? Thanks
Reply | Threaded
Open this post in threaded view
|

## Re: Analog to Digital converter channel

 Al, The ADC converter expects the instantaneous voltage (i.e. the voltage during the sampling time) to be between 0 and Vref (typically 5v).  If by AC you mean a voltage that varies equally between a plus and minus voltage, then the answer would be no.  To measure an AC voltage, the zero of the ac voltage needs to be offset to 1/2 Vref, or 2.5v.  One way to do this would simply be a series capacitor and resistor divider on the ADC side.  Zero volts would then be an adc reading of about 512, and max positive peak would be 1023 and max negative would be 0. Don On Tue, 2011-09-13 at 18:41 +0000, AlD wrote: >   > Is the input to the Analog to Digital converter channel of the > MC68HC12 analog ac or analog dc? Thanks > > > > >
Reply | Threaded
Open this post in threaded view
|

## Re: Analog to Digital converter channel

 I have a 80.205Vpp sine wave signal that I would like to condition so it converts to 0-5v input for the ADT of the MC68HC12. I'm still not clear if the input to the MC68HC12 should be 5Vdc or can be a divided down sine wave, ac. I tried a simple breadboard dividing down 10Vpp (max output of my generator) to 2Vpp, when I place a capacitor in series with the source to the divider it dropped the sine wave down by 100mv (below the zero axis), should it have dropped. When you you say 'Zero volts would then be an adc reading of about 512...' are you referring to the original zero of the sine wave now equaling 512. This is as low frequency signal, less than 100Hz, what would be an appropriate capacitor value. --- In [hidden email], Donald E Haselwood wrote: > > Al, > > The ADC converter expects the instantaneous voltage (i.e. the voltage > during the sampling time) to be between 0 and Vref (typically 5v).  If > by AC you mean a voltage that varies equally between a plus and minus > voltage, then the answer would be no.  To measure an AC voltage, the > zero of the ac voltage needs to be offset to 1/2 Vref, or 2.5v.  One way > to do this would simply be a series capacitor and resistor divider on > the ADC side.  Zero volts would then be an adc reading of about 512, and > max positive peak would be 1023 and max negative would be 0. > > Don > > > On Tue, 2011-09-13 at 18:41 +0000, AlD wrote: > >   > > Is the input to the Analog to Digital converter channel of the > > MC68HC12 analog ac or analog dc? Thanks > > > > > > > > > > >
Reply | Threaded
Open this post in threaded view
|

## Re: Re: Analog to Digital converter channel

 Al, There are many ways to do it.  Here are a couple-- One simple way to do it if you are not interested in the phase shift and the frequency is constant, would be a resistor divider with two equal resistors, e.g. 1.8K.  One to ground, the other to the 5v Vref, and the junction to the ADC pin.  The input impedance would be 0.9K.  A 0.1 uf capacitor would have a reactance of about 16K at 100 Hz.  The 16K and 0.9K would approximately divide the 80v pp to 4.5v.  This isn't a good scheme if there are "spikes" on the 80v signal since those couple directly through the capacitor into the ADC. Better is to divide the 80 signal down with a resistor divider (e.g. 18K and 2K); have a second resistor divider of equal resistances (e.g. 3.9K) to give the ADC a 2.5v offset, then couple the two dividers with a capacitor.  With this scheme spikes on the 80 signal go through the 18K resistor so there is more protection for the ADC input. Since the ADC only measures 0 - 5 volts, an AC signal that goes plus and minus has to have the zero point shifted to 2.5 volts, and the amplitude limited to +/- 2.5 volts, or 5v p-p.  The ADC then outputs about 1/2 the max value for zero volts input.  If the software needs a +/- value, then it must subtract that zero offset from the readings.   Since the input dividers, or whatever circuitry is used, is not exact, you might need to calibrate the zero signal reading.  Or, if the input signal the software could note the max and min values and compute the zero point as being half way between. Don On Wed, 2011-09-14 at 01:07 +0000, AlD wrote: >   > > > I have a 80.205Vpp sine wave signal that I would like to condition so > it converts to 0-5v input for the ADT of the MC68HC12. I'm still not > clear if the input to the MC68HC12 should be 5Vdc or can be a divided > down sine wave, ac. I tried a simple breadboard dividing down 10Vpp > (max output of my generator) to 2Vpp, when I place a capacitor in > series with the source to the divider it dropped the sine wave down by > 100mv (below the zero axis), should it have dropped. When you you say > 'Zero volts would then be an adc reading of about 512...' are you > referring to the original zero of the sine wave now equaling 512. This > is as low frequency signal, less than 100Hz, what would be an > appropriate capacitor value. > > --- In [hidden email], Donald E Haselwood > wrote: > > > > Al, > > > > The ADC converter expects the instantaneous voltage (i.e. the > voltage > > during the sampling time) to be between 0 and Vref (typically 5v). > If > > by AC you mean a voltage that varies equally between a plus and > minus > > voltage, then the answer would be no. To measure an AC voltage, the > > zero of the ac voltage needs to be offset to 1/2 Vref, or 2.5v. One > way > > to do this would simply be a series capacitor and resistor divider > on > > the ADC side. Zero volts would then be an adc reading of about 512, > and > > max positive peak would be 1023 and max negative would be 0. > > > > Don > > > > > > On Tue, 2011-09-13 at 18:41 +0000, AlD wrote: > > > > > > Is the input to the Analog to Digital converter channel of the > > > MC68HC12 analog ac or analog dc? Thanks > > > > > > > > > > > > > > > > > > > > > >
Reply | Threaded
Open this post in threaded view
|

## Re: Analog to Digital converter channel

 Thanks for your help Don, it was great. I ended up using a voltage divider, then that output into a diff amp to provide the 2.5v offset for the ADC, thanks again. --- In [hidden email], Donald E Haselwood wrote: > > Al, > > There are many ways to do it.  Here are a couple-- > > One simple way to do it if you are not interested in the phase shift and > the frequency is constant, would be a resistor divider with two equal > resistors, e.g. 1.8K.  One to ground, the other to the 5v Vref, and the > junction to the ADC pin.  The input impedance would be 0.9K.  A 0.1 uf > capacitor would have a reactance of about 16K at 100 Hz.  The 16K and > 0.9K would approximately divide the 80v pp to 4.5v.  This isn't a good > scheme if there are "spikes" on the 80v signal since those couple > directly through the capacitor into the ADC. > > Better is to divide the 80 signal down with a resistor divider (e.g. 18K > and 2K); have a second resistor divider of equal resistances (e.g. 3.9K) > to give the ADC a 2.5v offset, then couple the two dividers with a > capacitor.  With this scheme spikes on the 80 signal go through the 18K > resistor so there is more protection for the ADC input. > > Since the ADC only measures 0 - 5 volts, an AC signal that goes plus and > minus has to have the zero point shifted to 2.5 volts, and the amplitude > limited to +/- 2.5 volts, or 5v p-p.  The ADC then outputs about 1/2 the > max value for zero volts input.  If the software needs a +/- value, then > it must subtract that zero offset from the readings.   > > Since the input dividers, or whatever circuitry is used, is not exact, > you might need to calibrate the zero signal reading.  Or, if the input > signal the software could note the max and min values and compute the > zero point as being half way between. > > > Don > > > > > On Wed, 2011-09-14 at 01:07 +0000, AlD wrote: > >   > > > > > > I have a 80.205Vpp sine wave signal that I would like to condition so > > it converts to 0-5v input for the ADT of the MC68HC12. I'm still not > > clear if the input to the MC68HC12 should be 5Vdc or can be a divided > > down sine wave, ac. I tried a simple breadboard dividing down 10Vpp > > (max output of my generator) to 2Vpp, when I place a capacitor in > > series with the source to the divider it dropped the sine wave down by > > 100mv (below the zero axis), should it have dropped. When you you say > > 'Zero volts would then be an adc reading of about 512...' are you > > referring to the original zero of the sine wave now equaling 512. This > > is as low frequency signal, less than 100Hz, what would be an > > appropriate capacitor value. > > > > --- In [hidden email], Donald E Haselwood > > wrote: > > > > > > Al, > > > > > > The ADC converter expects the instantaneous voltage (i.e. the > > voltage > > > during the sampling time) to be between 0 and Vref (typically 5v). > > If > > > by AC you mean a voltage that varies equally between a plus and > > minus > > > voltage, then the answer would be no. To measure an AC voltage, the > > > zero of the ac voltage needs to be offset to 1/2 Vref, or 2.5v. One > > way > > > to do this would simply be a series capacitor and resistor divider > > on > > > the ADC side. Zero volts would then be an adc reading of about 512, > > and > > > max positive peak would be 1023 and max negative would be 0. > > > > > > Don > > > > > > > > > On Tue, 2011-09-13 at 18:41 +0000, AlD wrote: > > > > > > > > Is the input to the Analog to Digital converter channel of the > > > > MC68HC12 analog ac or analog dc? Thanks > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >