|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 | Next > |
|
|
Analog signal conditioningAnalog signal conditioning is an overwhelming thing to Google!
Here is the problem: I need to measure a remote resistance of 0 to 500 ohms with the AD input on a Pic 16F877A. what ever I do, it has a lot of jitter on the reading. A super cheap Harbor Freight Ohmmeter works fine. Details: The Ohmmeter is using a 0.22 ma current for measurement. My circuit has tried to series the top of the pot with 4.3k down to 680 ohms. I have tried up to 0.22 UF capacitor in parallel with the port to no avail. The ohmmeter works all the way to the circuit board so I cannot see how I could have a wiring error. My development board is powered by the USB port and the program works with the Board's 5K pot across VCC. For the curious: The resistance I am trying to read with the PIC is at the end of about 80 feet of wire in my Ham Radio rotator. I took a lightning strike several years ago and have since dedicated a meter and toggle switch for a control box. I am just now looking for a better solution... I am not looking forward to exploring Ohm meters! John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioning<snip> For the curious: The resistance I am trying to read with the PIC
is at the end of about 80 feet of wire in my Ham Radio rotator. I took a lightning strike several years ago and have since dedicated a meter and toggle switch for a control box. I am just now looking for a better solution... John: You may well have a lot of 60 Hz signal riding on top of your DC that is contaminating the measurement. If so, you will need to better condition the signal, which may be done in a variety of ways, some more complex than others. I had worked up a circuit to read the position of a TailTwister rotor pot using a PIC and had to do major signal conditioning. Finally wound up with a 5 Hz low pass filter, but that's somewhat of a special case because the rotor manufacturer uses a common wire for one end of the pot and a motor/brake return circuit. Jack K8ZOA -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningOn 1 May 2008 at 12:01, John Ferrell wrote:
> Analog signal conditioning is an overwhelming thing to Google! > > Here is the problem: I need to measure a remote resistance of 0 to > 500 ohms with the AD input on a Pic 16F877A. what ever I do, it > has a lot of jitter on the reading. A super cheap Harbor Freight > Ohmmeter works fine. > > Details: The Ohmmeter is using a 0.22 ma current for measurement. > My circuit has tried to series the top of the pot with 4.3k down > to 680 ohms. I have tried up to 0.22 UF capacitor in parallel with > the port to no avail. The ohmmeter works all the way to the > circuit board so I cannot see how I could have a wiring error. My > development board is powered by the USB port and the program works > with the Board's 5K pot across VCC. > > For the curious: The resistance I am trying to read with the PIC > is at the end of about 80 feet of wire in my Ham Radio rotator. I > took a lightning strike several years ago and have since dedicated > a meter and toggle switch for a control box. I am just now looking > for a better solution... > > I am not looking forward to exploring Ohm meters! > > John Ferrell W8CCW Below is an old PIClist post explaining how to do the filter. Mark Jordan - PY3SS -------------------------------------- Pang wrote: > How to perform low pass filtering in software? FILT <-- FILT + FF*(NEW - FILT) Is a single pole low pass filter if executed each new sample. NEW is the new incoming sample this iteration, FILT is the filter output, and FF is the "filter fraction". This adjusts how much the filter passes the raw input versus how heavy the filter is. The 3dB point of the filter in number of samples is a function of only FF. FF=0 is an infinitely heavy filter in that the output never changes, FF=1 is no filter at all since the input is just passed to the output. Useful values are obviously in between. This has been discussed many times before, and there must be tons of literature on this and other digital filters out there. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: Analog signal conditioning> -----Original Message----- > From: piclist-bounces@... [mailto:piclist-bounces@...] On Behalf > Of John Ferrell > Sent: 01 May 2008 17:01 > To: Microcontroller discussion list - Public. > Subject: [PIC]Analog signal conditioning > > Analog signal conditioning is an overwhelming thing to Google! > > Here is the problem: I need to measure a remote resistance of 0 to 500 > ohms with the AD input on a Pic 16F877A. what ever I do, it has a lot of > jitter on the reading. A super cheap Harbor Freight Ohmmeter works fine. > > Details: The Ohmmeter is using a 0.22 ma current for measurement. My > circuit has tried to series the top of the pot with 4.3k down to 680 ohms. > I have tried up to 0.22 UF capacitor in parallel with the port to no avail. > The ohmmeter works all the way to the circuit board so I cannot see how I > could have a wiring error. My development board is powered by the USB port > and the program works with the Board's 5K pot across VCC. > > For the curious: The resistance I am trying to read with the PIC is at the > end of about 80 feet of wire in my Ham Radio rotator. I took a lightning > strike several years ago and have since dedicated a meter and toggle > switch for a control box. I am just now looking for a better solution... > You are probably getting a lot of common mode voltage. If you use a differential amp to measure the voltage you should be able to remove a lot of this. Both sides of the sensor need to be terminated to the same impedance, e.g. Vdd----680R---+---SENSOR---+----680R----0v The diff amp would be connected at the '+' points. You'd need to make sure your diff amp can handle the common mode voltage, but this shouldn't be too difficult. The output of the diff amp may need some filtering to remove any residual, non-common mode noise. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningHave you tried feeding a constant current into the resistance, and
then measuring the developed voltage across it? Low-pass filtering will help, obviously you can't slew your rotor very fast, so you shouldn't allow the analog to change much faster than the rotor can actually move. Running a higher sensing current may help too. Sampling at an interval that's either locked to 60 Hz, or randomized somewhat, may help. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioning> Here is the problem: I need to measure a remote resistance
> of 0 to 500 ohms with the AD input on a Pic 16F877A. what > ever I do, it has a lot of jitter on the reading. A super > cheap Harbor Freight Ohmmeter works fine. Look at the signal at the measurement point with an oscilloscope. It may have mains hum on it and the cheap DMM will be a dual slope (long integral) with mains frequency rejection (slope length timed for mains cycle rejection or multiple cycles). If mains hum is an issue then heavy filtering may assist. Russell -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningI am not the expert with things analog, but for automotive apps (lots of noise
sources), I find good layout (separating analog/digital sections) and good bypass caps very close to the PIC make a significant difference. Then, depending on signal being measured, I generally average ~20-50 samples, then IIR filter that. And I get pretty good results. Some of these are also ground-referenced variable resistances with a fixed resistor to Vdd to create a voltage divider. I generally use a 50% voltage divider to Vref+, in order to use more of the PIC's A/D range, but in one specific application where the varying-resistance sender is far from the PIC, I moved the 50% Vref voltage divider near the sender. The theory here is that the Vref will have the Vdd and Vss line, and hence should have the same noise as the input signal, and it's ratiometric. But I can't say that I've actually compared this with a similar version where the 50% Vref resistors are near the PIC. Cheers, -Neil. On Thursday 01 May 2008 11:01, John Ferrell wrote: > Analog signal conditioning is an overwhelming thing to Google! > > Here is the problem: I need to measure a remote resistance of 0 to 500 ohms > with the AD input on a Pic 16F877A. what ever I do, it has a lot of jitter > on the reading. A super cheap Harbor Freight Ohmmeter works fine. > > Details: The Ohmmeter is using a 0.22 ma current for measurement. My > circuit has tried to series the top of the pot with 4.3k down to 680 ohms. > I have tried up to 0.22 UF capacitor in parallel with the port to no avail. > The ohmmeter works all the way to the circuit board so I cannot see how I > could have a wiring error. My development board is powered by the USB port > and the program works with the Board's 5K pot across VCC. > > For the curious: The resistance I am trying to read with the PIC is at the > end of about 80 feet of wire in my Ham Radio rotator. I took a lightning > strike several years ago and have since dedicated a meter and toggle switch > for a control box. I am just now looking for a better solution... > > I am not looking forward to exploring Ohm meters! > > > > John Ferrell W8CCW > > "All that is necessary for the triumph of evil is for good men to do > nothing." -- Edmund Burke http://DixieNC.US http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioning>Below is an old PIClist post explaining how to do the filter.
Yeah, but as someone else pointed out, there is probably a heap of mains hum in the signal, and I suspect the best (and possibly easiest) way of filtering is to sample at twice the mains frequency, probably using Olins filter that you quoted, to average the samples. Many meters do exactly this sampling rate for exactly the effect noted by the OP - the readings end up stable. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningAveraging 45 consecutive reads seems to do a lot for stability but does not
qualify as a cure. There is no discernable hum on the signal in the scope. capacitors (22 uf ) on the vcc and input pins also help. It looks like I need to put this project back on the shelf a little longer. John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US ----- Original Message ----- From: "Apptech" <apptech@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Thursday, May 01, 2008 4:18 PM Subject: Re: [PIC]Analog signal conditioning >> Here is the problem: I need to measure a remote resistance >> of 0 to 500 ohms with the AD input on a Pic 16F877A. what >> ever I do, it has a lot of jitter on the reading. A super >> cheap Harbor Freight Ohmmeter works fine. > > > > Look at the signal at the measurement point with an > oscilloscope. > It may have mains hum on it and the cheap DMM will be a dual > slope (long integral) with mains frequency rejection (slope > length timed for mains cycle rejection or multiple cycles). > If mains hum is an issue then heavy filtering may assist. > > > Russell > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningOn Fri, May 2, 2008 at 1:45 PM, John Ferrell <johnferrell@...> wrote:
> Averaging 45 consecutive reads seems to do a lot for stability but does not > qualify as a cure. There is no discernable hum on the signal in the scope. > capacitors (22 uf ) on the vcc and input pins also help. Are you changing something when you clip the scope's ground into the circuit? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningNo, the scope ground is always in place. That is insurance against me
mis-plugging it with power up. The development board itself probably has poor immunity. RA3 (AD pin) runs all over the board to the various sockets and devices. However, the onboard pot does not exhibit the jitter. I must have a poor connection somewhere, this is just not making sense...I will report back. John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US ----- Original Message ----- From: "David VanHorn" <microbrix@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Friday, May 02, 2008 2:33 PM Subject: Re: [PIC]Analog signal conditioning > On Fri, May 2, 2008 at 1:45 PM, John Ferrell <johnferrell@...> > wrote: >> Averaging 45 consecutive reads seems to do a lot for stability but does >> not >> qualify as a cure. There is no discernable hum on the signal in the >> scope. >> capacitors (22 uf ) on the vcc and input pins also help. > > Are you changing something when you clip the scope's ground into the > circuit? > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningIt appears the noise is originating on the board. The AD specs call for 1K
max input impedance. A unity gain op amp will probably fix the problem for my needs but I am out of time for a while. John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US ----- Original Message ----- From: "John Ferrell" <johnferrell@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Friday, May 02, 2008 5:25 PM Subject: Re: [PIC]Analog signal conditioning > No, the scope ground is always in place. That is insurance against me > mis-plugging it with power up. > > The development board itself probably has poor immunity. RA3 (AD pin) runs > all over the board to the various sockets and devices. However, the > onboard > pot does not exhibit the jitter. > > I must have a poor connection somewhere, this is just not making sense...I > will report back. > John Ferrell W8CCW > > "All that is necessary for the triumph of evil is for good men to do > nothing." -- Edmund Burke > http://DixieNC.US -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: Analog signal conditioning> -----Original Message----- > From: piclist-bounces@... [mailto:piclist-bounces@...] On Behalf > Of John Ferrell > Sent: 03 May 2008 00:53 > To: Microcontroller discussion list - Public. > Subject: Re: [PIC]Analog signal conditioning > > It appears the noise is originating on the board. The AD specs call for 1K > max input impedance. A unity gain op amp will probably fix the problem for > my needs but I am out of time for a while. With a 500 ohm sensor you should be easily meeting this spec anyway? Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningUntil I fell into the trap I would have agreed with you. The AP Notes
regarding ADC are serious reading. If you keep the pot onboard with the PIC you can get away with a lot. Reading the wiper of a 5K pot across Vcc and ground is not a problem. My Pot is at the end of about 75 feet of cable. The cable contributes some unknown reactance in the configuration. The troublesome noise is a byproduct of the conversion within the PIC. The current requirements are likely to be damaging to the Pot (500 ohms) if I simply put Vcc across it... I have a 4.3K resistor in series with it. The conclusion that I draw at this time is that remote sensing is not a simple matter even if it is just a resistor. John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US ----- Original Message ----- From: "Michael Rigby-Jones" <Michael.Rigby-Jones@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Tuesday, May 06, 2008 7:16 AM Subject: RE: [PIC]Analog signal conditioning > > >> -----Original Message----- >> From: piclist-bounces@... [mailto:piclist-bounces@...] On > Behalf >> Of John Ferrell >> Sent: 03 May 2008 00:53 >> To: Microcontroller discussion list - Public. >> Subject: Re: [PIC]Analog signal conditioning >> >> It appears the noise is originating on the board. The AD specs call > for 1K >> max input impedance. A unity gain op amp will probably fix the problem > for >> my needs but I am out of time for a while. > > With a 500 ohm sensor you should be easily meeting this spec anyway? > > Regards > > Mike > > ======================================================================= > This e-mail is intended for the person it is addressed to only. The > information contained in it may be confidential and/or protected by > law. If you are not the intended recipient of this message, you must > not make any use of this information, or copy or show it to any > person. Please contact us immediately to tell us that you have > received this e-mail, and return the original to us. Any use, > forwarding, printing or copying of this message is strictly prohibited. > No part of this message can be considered a request for goods or > services. > ======================================================================= > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningSounds like you need a wee opamp at the sensor end to convert the 5k pot to 0-
5V. That shouldn't be too hard, and you can probbaly even send diferential signal back to avoid noise = 4 lines: 0, +5, two signal lines. Alternately, put a A/D converter tat the sensor end and send I2C or something. David David Quoting John Ferrell <johnferrell@...>: > Until I fell into the trap I would have agreed with you. The AP Notes > regarding ADC are serious reading. > If you keep the pot onboard with the PIC you can get away with a lot. > Reading the wiper of a 5K pot across Vcc and ground is not a problem. > > My Pot is at the end of about 75 feet of cable. The cable contributes some > unknown reactance in the configuration. The troublesome noise is a byproduct > > of the conversion within the PIC. The current requirements are likely to be > > damaging to the Pot (500 ohms) if I simply put Vcc across it... I have a > 4.3K resistor in series with it. > > The conclusion that I draw at this time is that remote sensing is not a > simple matter even if it is just a resistor. > > John Ferrell W8CCW > > "All that is necessary for the triumph of evil is for good men to do > nothing." -- Edmund Burke > http://DixieNC.US > > ----- Original Message ----- > From: "Michael Rigby-Jones" <Michael.Rigby-Jones@...> > To: "Microcontroller discussion list - Public." <piclist@...> > Sent: Tuesday, May 06, 2008 7:16 AM > Subject: RE: [PIC]Analog signal conditioning > > > > > > > >> -----Original Message----- > >> From: piclist-bounces@... [mailto:piclist-bounces@...] On > > Behalf > >> Of John Ferrell > >> Sent: 03 May 2008 00:53 > >> To: Microcontroller discussion list - Public. > >> Subject: Re: [PIC]Analog signal conditioning > >> > >> It appears the noise is originating on the board. The AD specs call > > for 1K > >> max input impedance. A unity gain op amp will probably fix the problem > > for > >> my needs but I am out of time for a while. > > > > With a 500 ohm sensor you should be easily meeting this spec anyway? > > > > Regards > > > > Mike > > > > ======================================================================= > > This e-mail is intended for the person it is addressed to only. The > > information contained in it may be confidential and/or protected by > > law. If you are not the intended recipient of this message, you must > > not make any use of this information, or copy or show it to any > > person. Please contact us immediately to tell us that you have > > received this e-mail, and return the original to us. Any use, > > forwarding, printing or copying of this message is strictly prohibited. > > No part of this message can be considered a request for goods or > > services. > > ======================================================================= > > > > -- > > http://www.piclist.com PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > > > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningOn Tue, 2008-05-06 at 15:31 -0400, John Ferrell wrote:
> Until I fell into the trap I would have agreed with you. The AP Notes > regarding ADC are serious reading. > If you keep the pot onboard with the PIC you can get away with a lot. > Reading the wiper of a 5K pot across Vcc and ground is not a problem. > > My Pot is at the end of about 75 feet of cable. The cable contributes some > unknown reactance in the configuration. The troublesome noise is a byproduct > of the conversion within the PIC. The current requirements are likely to be > damaging to the Pot (500 ohms) if I simply put Vcc across it... I have a > 4.3K resistor in series with it. > > The conclusion that I draw at this time is that remote sensing is not a > simple matter even if it is just a resistor. The trick often used for longer sensor runs is actually very simple: instead of measuring voltage, measure current. By using a current loop you automatically lower the effects of coupling noise. You also pretty much remove the wire resistance from the equation. TTYL -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Analog signal conditioningThe sensor (500 ohm pot) is in the rotator housing about 50 feet up the
tower. ot easy to get to! John Ferrell W8CCW "All that is necessary for the triumph of evil is for good men to do nothing." -- Edmund Burke http://DixieNC.US ----- Original Message ----- From: <dpharris@...> To: "Microcontroller discussion list - Public." <piclist@...> Sent: Tuesday, May 06, 2008 3:44 PM Subject: Re: [PIC]Analog signal conditioning > Sounds like you need a wee opamp at the sensor end to convert the 5k pot > to 0- > 5V. That shouldn't be too hard, and you can probbaly even send > diferential > signal back to avoid noise = 4 lines: 0, +5, two signal lines. > > Alternately, put a A/D converter tat the sensor end and send I2C or > something. > > David > > > > David > > Quoting John Ferrell <johnferrell@...>: > >> Until I fell into the trap I would have agreed with you. The AP Notes >> regarding ADC are serious reading. >> If you keep the pot onboard with the PIC you can get away with a lot. >> Reading the wiper of a 5K pot across Vcc and ground is not a problem. >> >> My Pot is at the end of about 75 feet of cable. The cable contributes >> some >> unknown reactance in the configuration. The troublesome noise is a >> byproduct >> >> of the conversion within the PIC. The current requirements are likely to >> be >> >> damaging to the Pot (500 ohms) if I simply put Vcc across it... I have a >> 4.3K resistor in series with it. >> >> The conclusion that I draw at this time is that remote sensing is not a >> simple matter even if it is just a resistor. >> >&g |