Searching \ for '[PIC]: Potentiometer on ADC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=adc
Search entire site for: 'Potentiometer on ADC'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Potentiometer on ADC'
2001\11\09@014205 by Josh Koffman

flavicon
face
Thanks for the reply Dale. That is basically what I want to do. Would I
achieve any advantages to using a fixed resistor on one side? Obviously
your method wins in the parts number contest. Also, shouldn't that be
ends to ground and Voltage Reference? In this design it won't make a
difference, but just to be clear for the future. Also, can anyone
reccomend any analog multiplexer chips? Basically I want to read more
than 8 potentiometers. At the moment, it'll probably end up around
12-24, but could be higher in the future. I'd like to stick with the ADC
build into the chip, but multiplex the inputs. Any ideas?

Thanks,

Josh Koffman

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Dale Botkin wrote:
>
> I use a 10K Ohm, ends to Vcc and ground, wiper to the ADC input pin.  The
> ADC will read the position of the pot, since you've just made a variable
> voltage divider.  Is that what you're looking for?
>
> Dale
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@014214 by Josh Koffman

flavicon
face
Sheepish grins abound here, as sent this message I realized I had the
wrong subject. Here the subject is changed, and the message copied for
your reading pleasure.

Sorry :)

Josh Koffman

Josh Koffman wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@075214 by Dale Botkin

flavicon
face
On Thu, 8 Nov 2001, Josh Koffman wrote:

> Thanks for the reply Dale. That is basically what I want to do. Would I
> achieve any advantages to using a fixed resistor on one side?

None that I can think of.  The current through the pot will be the same
regardless of where the wiper is positioned, so using fixed resistors on
one or either end would only server to limit the input range (which you
may or may not want).

> Obviously your method wins in the parts number contest. Also,
> shouldn't that be ends to ground and Voltage Reference? In this design
> it won't make a difference, but just to be clear for the future.

Yes, you're correct.  When using the ADC for nothing more than a position
input like this, I always use Vdd for Vref - again, saves parts.

> Also, can anyone reccomend any analog multiplexer chips? Basically I
> want to read more than 8 potentiometers. At the moment, it'll probably
> end up around 12-24, but could be higher in the future. I'd like to
> stick with the ADC build into the chip, but multiplex the inputs. Any
> ideas?

Maxim makes a bunch, looks like up to 16:1:

http://para.maxim-ic.com/compare.asp?Fam=sw_mux&Tree=SwitchMux&HP=SwitchMux.cfm

Dale

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@075650 by Vasile Surducan

flavicon
face
Datasheet say 10K. But reality show you need to minimize the ac noise
impedance by adding a capacitor near AD input and analogic ground.
Value must be set accordingly input signal variation and maximum delay
( Rpot x C ) you must have it.
Vasile

On Thu, 8 Nov 2001, Josh Koffman wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@101836 by Micro Eng

picon face
speaking of that...I was going to play around with a pot to a ADC pin.
Anyone have some code snippets they might want to share? Basically just read
the value of the pot from min to max


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@120744 by Byron A Jeff

face picon face
On Fri, Nov 09, 2001 at 07:52:40AM -0700, Micro Eng wrote:
> speaking of that...I was going to play around with a pot to a ADC pin.
> Anyone have some code snippets they might want to share? Basically just read
> the value of the pot from min to max

Take a look at the software for my sunrise/sunset timer. It uses a pot/switch
interface to set the time. The ADC is initialized in init, read and mapped
in moveadc. The mapping routine will take the 0-255 value of the top part
of the ADC and map it into a smaller range (0-23 for hours, 0-30 for month).

You can find it here:

http://www.finitesite.com/d3jsys/clock.asm

Hope it helps,

BAJ

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@122000 by Josh Koffman

flavicon
face
So the circuit would look like this?

- Vref
|
\
/ 10Kohm
\
/
|
|
\ 10Kohm Pot
/
\<-----+------- ADC Input
/      |
|     ---  Capacitor
|     ---
|      |
|      |
- Analog Gnd

What should I use as the capacitor value? What type of cap should I use?
(ie. electrolytic, ceramic, etc). Thanks for all the help!

Josh Koffman

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams


Vasile Surducan wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@124914 by Dale Botkin

flavicon
face
On Fri, 9 Nov 2001, Josh Koffman wrote:

> So the circuit would look like this?
>
> - Vref
> |
> \
> / 10Kohm
> \
> /
> |
> |
> \ 10Kohm Pot
> /
> \<-----+------- ADC Input
> /      |
> |     ---  Capacitor
> |     ---
> |      |
> |      |
> - Analog Gnd

I wouldn't do it that way.  That will give you only half your range, for
one thing, with the pot at maximum you'll see Vref/2.  If you're worried
about the PIC pin having a low-impedance path to Vss or Vdd, maybe a 200
Ohm series resistor between the pot and the cap, if you use a cap.

+ Vref
|
|
|
\ 10Kohm Pot
/
\<--/\/\/---+------- ADC Input
/   200     |
|          ---  Capacitor
|          ---
|           |
|           |
- Analog Gnd


> What should I use as the capacitor value? What type of cap should I use?
> (ie. electrolytic, ceramic, etc). Thanks for all the help!

Microchip's manual says a .01uF is sufficient, if the input is high
impedance (>1K Ohm).  I'd be tempted to go maybe a little higher, but I
don't know -- in this particular type of application my experience has
shown that just the pot alone is sufficient.  Maybe if you need extra high
precision or extra high stability...

Of course, I could be completely, totally wrong on all counts.  I don't
think so, though.

Dale

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@134816 by Harold M Hallikainen

picon face
On Fri, 9 Nov 2001 14:35:14 +0200 Vasile Surducan <spam_OUTvasileTakeThisOuTspamL30.ITIM-CJ.RO>
writes:
> Datasheet say 10K. But reality show you need to minimize the ac noise
> impedance by adding a capacitor near AD input and analogic ground.
> Value must be set accordingly input signal variation and maximum
> delay
> ( Rpot x C ) you must have it.
> Vasile
>

       Why? I've got lots of stuff with a 10K pot driving the A/D input
directly with no capacitor and get no jitter in the A/D output. If you
have a reasonable PCB layout (good ground plane), it seems this capacitor
is just wasted money. And, if you do external multiplexing, slows
everything down.


Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\09@135013 by Harold M Hallikainen

picon face
On Thu, 8 Nov 2001 23:59:23 -0500 Josh Koffman <.....listsjoshKILLspamspam@spam@3MTMP.COM>
writes:
> Thanks for the reply Dale. That is basically what I want to do. Would
> I
> achieve any advantages to using a fixed resistor on one side?
> Obviously
> your method wins in the parts number contest. Also, shouldn't that
> be
> ends to ground and Voltage Reference? In this design it won't make a
> difference, but just to be clear for the future. Also, can anyone
> reccomend any analog multiplexer chips? Basically I want to read
> more
> than 8 potentiometers. At the moment, it'll probably end up around
> 12-24, but could be higher in the future. I'd like to stick with the
> ADC
> build into the chip, but multiplex the inputs. Any ideas?
>

       Yes, it should be reference, but just use the 5V supply for reference.
Gives you another pin available on the PIC! In our DMX controllers, we do
this a lot. If we need more than 8 inputs, we use a CD4051 as the mux.
You can either tie the outputs together to one analog in on the PIC and
enable them one at a time or have each output drive a separate analog
input on the PIC. I've generally had each 4051 drive another PIC analog
input.
       I see no advantage to making a voltage divider using the pot as a
rheostat with an external resistor. The parts count is higher and the
output voltage will not be linearly related to pot position. Just put the
pots between +5V and ground and drive the analog inputs directly (or
through a mux).

Harold


FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\11@173451 by Tony Nixon

flavicon
picon face
Micro Eng wrote:
>
> speaking of that...I was going to play around with a pot to a ADC pin.
> Anyone have some code snippets they might want to share? Basically just read
> the value of the pot from min to max
>

Try this for 16F877. It will send, about once per second in ASCII, the
A2D HEX data from RA0 to the serial port at 19200 baud if the crystal =
4MHz.

;
       Title "ANALOG DEMO."
;
       list P = 16F877
;
       include "P16f877.inc"

;       CRYSTAL = 4MHz
;
; ---------------
; RAM DEFINITIONS
; ---------------
;
       CBLOCK 0x20
DelayL
DelayM
DelayH
       ENDC

;
; -------------------------------
; CODE START AND INITIALISE PORTS
; -------------------------------
;

       org 0000h               ; start address = 0000h
;
; CODE START
;
Start   clrf PORTA
       clrf PORTB
       movlw b'01000000'       ; TX = high
       movwf PORTC
       clrf PORTD
       clrf PORTE
       bsf STATUS,RP0  ; RAM Page 1
       movlw 0x01      ; RA0 = analog in
       movwf TRISA
       clrf TRISB
       movlw b'10000000'       ; RX = in
       movwf TRISC
       clrf TRISD
       clrf TRISE
;
; --------------------------------------
; ENABLE THE ANALOG TO DIGITAL CONVERTER
; --------------------------------------
; Using RA0 pin for the analog input
; Analog data is right justified
;
       movlw b'10001110'
       movwf ADCON1
;
; ------------------------------------
; SET BAUD RATE TO COMMUNICATE WITH PC
; ------------------------------------
; Boot Baud Rate = 19200, No Parity, 1 Stop Bit
;
       movlw 0x0C      ; 19200 baud
       movwf SPBRG
       movlw b'00100100'       ; brgh = high (2)
       movwf TXSTA     ; enable Async Transmission, set brgh
       clrf STATUS     ; RAM Page 0
       movlw b'10010000'       ; enable Async Reception
       movwf RCSTA
;
; --------------------
; ENABLE ANALOG MODULE
; --------------------
; RC Mode - CH0 - ON
;
       movlw b'11000001'
       movwf ADCON0
;
; -----------------------
; TAKE A READING FROM A2D
; -----------------------
;
A2Dloop call Delay
       bsf ADCON0,GO_DONE      ; enable analog reading
;
; ----------------------------
; WAIT FOR READING TO COMPLETE
; ----------------------------
;
A2Dwait btfsc ADCON0,GO_DONE
       goto A2Dwait
;
; DISPLAY IN HEX UPPER 2 BITS FROM ADRESH
;
       movf ADRESH,W
       andlw b'00000011'       ; mask unwanted data
       call ToASCII
       movwf TXREG
;
; DISPLAY IN HEX, ADRESL
;
       bsf STATUS,RP0  ; RAM Page 1
       swapf ADRESL,W  ; get upper nibble
       bcf STATUS,RP0  ; RAM Page 0
       andlw 0Fh               ; mask off lower nibble
       call ToASCII
       movwf TXREG
       call TransWt

       bsf STATUS,RP0  ; RAM Page 1
       movf ADRESL,W   ; get lower nibble
       bcf STATUS,RP0  ; RAM Page 0
       andlw 0Fh               ; mask off upper nibble
       call ToASCII
       movwf TXREG

       movlw 0x0D      ; carriage return
       movwf TXREG
       call TransWt
       goto A2Dloop
;
; ------------------------------------
; WAIT UNTIL RS232 IS FINISHED SENDING
; ------------------------------------
;
TransWt bsf STATUS,RP0
WtHere  btfss TXSTA,TRMT        ; (1) transmission is complete if hi
       goto WtHere

       bcf STATUS,RP0  ; RAM Page 0
       return
;
; -----
; DELAY
; -----
;
Delay   movlw 3h
       movwf DelayH
       clrf DelayM
       clrf DelayL
Dloop   decfsz DelayL,F
       goto Dloop
       decfsz DelayM,F
       goto Dloop
       decfsz DelayH,F
       goto Dloop
       return
;
; -------------------------------------
; CONVERT HEX NIBBLE TO ASCII CHARACTER
; -------------------------------------
;
ToASCII addwf PCL,F
       retlw '0'
       retlw '1'
       retlw '2'
       retlw '3'
       retlw '4'
       retlw '5'
       retlw '6'
       retlw '7'
       retlw '8'
       retlw '9'
       retlw 'A'
       retlw 'B'
       retlw 'C'
       retlw 'D'
       retlw 'E'
       retlw 'F'


       end
--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamKILLspambubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\11\12@030535 by Vasile Surducan

flavicon
face
www.geocities.com/vsurducan/electro/PIC/f877.html
regards, Vasile

On Fri, 9 Nov 2001, Micro Eng wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2001\11\12@032158 by Vasile Surducan

flavicon
face
And which kind of signals have you measured ?
Are your devices working in harsh industrial environement like this one:

http://www.geocities.com/vsurducan/micro/micro.htm

Harold, your devices look great, I've saw your site. Prity bad you don't
say nothing about how it works ( schematics, sample codes etc...)
Best regards,
Vasile

On Fri, 9 Nov 2001, Harold M Hallikainen wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2001\11\12@130027 by Harold M Hallikainen

picon face
       Yahoo returns a page not found error on that link. These are not in
harsh industrial environments. Even in such environments, if you are
measuring pots on the board, I  think noise pickup would be minimal. It's
wires leaving the board that do a great job picking up noise. I DO filter
everything leaving a board.
       On schematics and stuff...  They pay me real money to design this stuff,
so I don't think I should give away the designs. I'm certainly happy to
discuss the designs, though. I do plan on adding an "Engineering
Department" page to the website. I'll get into some discussion of phase
control dimming, DMX, etc. My wife just gave me an Etch A Sketch for my
birthday. She's really good at using it. I hope to have her draw some
waveforms for inclusion on the page (complete with the Etch A Sketch red
background, the knobs, etc.) Should be fun!  Meanwhile, I DID add stuff
on a presentation on neutral currents with phase control and GFCI's I did
at LDI. Look under Application Notes at http://www.dovesystems.com .

Harold

On Mon, 12 Nov 2001 10:15:17 +0200 Vasile Surducan
<KILLspamvasileKILLspamspamL30.ITIM-CJ.RO> writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2001\11\13@003427 by Josh Koffman

flavicon
face
Hi Harold. May I send you a question off list? Also, when you talk about
neutral currents, do you mean current between neutral and ground?

Josh

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

Harold M Hallikainen wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\13@023943 by Vasile Surducan

flavicon
face
of course, I gave you by mistake a wrong address. The correct one is:

http://www.geocities.com/vsurducan/electro/micro/micro.htm

Thank's for good thoughts. I will take a look at your AN.
Vasile

On Mon, 12 Nov 2001, Harold M Hallikainen wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\13@135140 by Harold M Hallikainen

picon face
Nice page!

Harold

On Tue, 13 Nov 2001 09:33:11 +0200 Vasile Surducan
<EraseMEvasilespamspamspamBeGoneL30.ITIM-CJ.RO> writes:
> of course, I gave you by mistake a wrong address. The correct one is:
>
> http://www.geocities.com/vsurducan/electro/micro/micro.htm
>
> Thank's for good thoughts. I will take a look at your AN.
> Vasile

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\13@135350 by Harold M Hallikainen

picon face
Send away! Send to RemoveMEharoldKILLspamspamdovesystems.com . Neutral currents are the
current in the neutral conductor. In single phase, they are the same as
the line current. In three phase, all bets are off!

Harold


On Tue, 13 Nov 2001 00:47:51 -0500 Josh Koffman <listsjoshSTOPspamspamspam_OUT3MTMP.COM>
writes:
{Quote hidden}

FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\24@143150 by Josh Koffman

flavicon
face
What would happen if I used a 100K pot?

>  + Vref
>  |
>  |
>  |
>  \ 10Kohm Pot
>  /
>  \<--/\/\/---+------- ADC Input
>  /   200     |
>  |          ---  Capacitor
>  |          ---
>  |           |
>  |           |
>  - Analog Gnd

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\24@145742 by Josh Koffman

flavicon
face
Or how about a 250K pot? Would it really make a difference seeing as I'm
measuring the relationship between vref and the the analog input?

Josh

Josh Koffman wrote:
{Quote hidden}

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\24@150556 by David VanHorn

flavicon
face
At 03:13 PM 11/24/01 -0500, Josh Koffman wrote:
>Or how about a 250K pot? Would it really make a difference seeing as I'm
>measuring the relationship between vref and the the analog input?

There's no difference, provided that the chip's input impedance is
infinite, and there's no interfering EMI.
Otherwise, you can calculate the effect of non-infinite input impedance.
EMI is harder to predict, but generally, keeping your source impedance low
keeps this from becoming much of a problem.

--
Dave's Engineering Page: http://www.dvanhorn.org

Got a need to read Bar codes?  http://www.barcodechip.com
Bi-directional read of UPC-A, UPC-E, EAN-8, EAN-13, JAN, and Bookland, with
two or five digit supplemental codes, in an 8 pin chip, with NO external parts.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\24@162755 by Josh Koffman

flavicon
face
Well, the databook for the f877 says that "The maximum recommended
impedance for analog sources is 10K". Does this mean that my pots are
too high? Also, if I only want to use 8 bits of resolution, do I set the
ADFM register to 0, and then just read the result of ADRESH, and forget
about ADRESL?

Thanks,

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

David VanHorn wrote:
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\24@172729 by Thomas C. Sefranek

face picon face
If you have a large enough capacitor at the input
ITS impedance is low enough to satisfy the current demand of the A-D
(In most cases)
But be aware that the process of measuring the analog value drains the
capacitor
and you have to allow enough time for the high resitance path to recharge it
before you  re-read it.

Josh Koffman wrote:

{Quote hidden}

--
 *
 |  __O    Thomas C. Sefranek  EraseMEtcsspamEraseMEcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\24@184134 by Josh Koffman

flavicon
face
How do you figure out the value of the capacitor, and how long it takes
to charge? I'm not an EE, so sometimes these things are hard for me. If
I wanted to go for simplicity, would it be best to just go for a 10K
pot?

Thanks,

Josh

"Thomas C. Sefranek" wrote:
{Quote hidden}

--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\26@025530 by Robert A. LaBudde

flavicon
face
At 06:56 PM 11/24/01 -0500, Josh wrote:
>How do you figure out the value of the capacitor, and how long it takes
>to charge? I'm not an EE, so sometimes these things are hard for me. If
>I wanted to go for simplicity, would it be best to just go for a 10K
>pot?

The size of the capacitor and the resistor are determined by how frequently
you are making measurements with the ADC, if you are going to rely on the
capacitor to do a "sample hold".

For your simple setup, it's a lot easier to simply use a lower R pot so
that the issue doesn't arise. The minimum size of the pot depends only on
the amount of current you are willing to consume from the power supply.

For a 5V supply, a 5000 ohm pot will pull 1 mA (I = V/R). A 1 kohm pot will
pull 5 mA.

If you are not making a low-power device (e.g., running off a 9 V battery),
then a 1 kohm pot would be fine.

Now the capacitor is present primarily to remove unwanted AC noise from the
ADC input. The pot and the capacitor make an input low-pass filter to the
ADC input. The roll-off frequency of the filter is at fc = 1/(2 pi R C).

The problem with using too low an R for the pot is that you would need a
very large C for the capacitor to protect against noise at relatively low
frequencies (e.g., 60 Hz). For R = 1 kohm and fc = 30 Hz, you would need C
= 5.3 uF. For fc = 3 Hz, this would increase to C = 53 uF.

If you were doing a lot of high-frequency port R/Ws (which I doubt you
intend in your application), you might want to bypass the filter capacitor
with a 0.22 uF tantalum to protect against very high frequency noise.

For your application (a simple low accuracy pot-controlled test jig for an
ADC), a simple 1 kohm pot alone would probably present no problems. If you
still want to remove noise, add a 100 uF capacitor from the ADC input to
ground. Make sure the capacitor is not so large that fc is less than twice
the sampling frequency. I.e., if you are going to read at 10 sps, make fc =
20 Hz or more (e.g., 4.7 uF capacitor).

Also be aware that use of a large value capacitor means that you will not
get an accurate ADC reading until 6 RC time constants have elapsed at start
up. If R = 1 kohm and C = 100 uF, this will be 0.6 sec at start up, which
you will have to wait out.

You can tell whether or not you need the capacitor by looking at the input
signal to the ADC with an oscilloscope while it is in its most frequent
repetitive read loop. If the input is flat to the accuracy you need, you're
home free. If not bypass with your capacitor and check that it works well
enough.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: spamBeGoneralspamKILLspamlcfltd.com
Least Cost Formulations, Ltd.            URL: http://lcfltd.com/
824 Timberlake Drive                     Tel: 757-467-0954
Virginia Beach, VA 23464-3239            Fax: 757-467-2947

"Vere scire est per causas scire"
================================================================

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspam_OUTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\11\26@062435 by MATTHEWS, DEAN (D.)

picon face
I have recently been experimenting with the f877 a/d converter.  I did not use a capacitor or the 200ohm resistor that you are using.  I simply connected a 10k pot directly to the PIC and hey presto it worked!

Dean Matthews
` Please consider your environmental responsibility before printing this e-mail


{Original Message removed}

2001\11\26@064029 by Vasile Surducan

flavicon
face
Josh, the "grosso modo" way is to forget about the ADC input impedance and
to calculate the capacitor from the time integration equation:
T = R x C where R is the serial resistor to ADC input ( could be a
fraction from your 10K potentiometer , wiper to left ) and T is the
requested time between two sample, or better T = 1/f where f is the
parasitic signal frequency.
Of course both ADC input impedance and your signal source impedance are
considered to be ideal.
But also you must keep the maximum value of this capacitor acordingly to
datasheet because the internal ADC is a sort of sample and hold.
If the input signal is clean you don't need this capacitor.
You can't use this capacitor as a  trick to increase the potentiometer
value up to 250K without to diddle the AD performances because the
capacitor will minimize the equivalent signal impedance only in AC.


Regards, Vasile



On Sat, 24 Nov 2001, Josh Koffman wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservKILLspamspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\11\26@153752 by Douglas Butler

flavicon
face
Note that a 10K pot will have an output impedance of 5K if the wiper is
set to the middle.  The output impedance will be lower as the wiper
moves away from the middle.

Also if you are not using the full resolution of the A/D you can scrimp
on capacitor size or pot impedance.  If it is a 10 bit pot you are using
only the most significant 8 bits of, you have a factor of four to fudge
with.

The effect of a high source impedance feeding the A/D is nonlinearity.
If it is just a light dimmer or volume control, you may not really care
if it is a little nonlinear.

Sherpa Doug

> {Original Message removed}

2001\11\27@033911 by dr. Imre Bartfai

flavicon
face
Hi,

an (maybe silly) idea: could one use instead of the capacitor a voltage
follower? (I want to measure the power line and it would be a divider
ladder with a ratio 1:150 (the Vpp is 650V = 2 * 310V = 2 * sqrt(2) *
230V).

Thank you in advance.

Regards,
Imre


+-----------------------------------------------------------------------+
| The information transmitted is intended only for the person or entity |
| to which it is addressed and may contain confidential and/or          |
| privileged material.  Any review, retransmission, dissemination or    |
| other use of, or taking of any action in reliance upon, this          |
| information by persons or entities other than the intended recipient  |
| is prohibited. If you received this in error, please contact the      |
| sender and delete the material from any computer.                     |
+-----------------------------------------------------------------------+

On Sun, 25 Nov 2001, Robert A. LaBudde wrote:

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-request@spam@spamspam_OUTmitvma.mit.edu


2001\11\27@102129 by Martin Peach

flavicon
face
A CMOS op-amp wired as a unity-gain buffer would be close to ideal as an
input to the PIC ADC as the source impedance could be very high.
      +5
      <
R3    <R1   |\
-/\/\--+-----|+\
      <R2   |  \______/a/d
      <     |  / |    \
    GND   +-|-/  |
          | |/   |
          |______|

R1 and R2 are equal to set the offset to midrange. R3 is whatever your input
resistor ladder is.

/\/\/\/*=Martin

{Original Message removed}

2001\11\27@115631 by Harold M Hallikainen

picon face
On Mon, 26 Nov 2001 15:32:51 -0500 Douglas Butler <TakeThisOuTdbutlerspamspamIMETRIX.COM>
writes:
> Note that a 10K pot will have an output impedance of 5K if the wiper
> is
> set to the middle.  The output impedance will be lower as the wiper
> moves away from the middle.
>

       Wouldn't that be 2.5K?


{Quote hidden}

       Also seems like there'd be drift in the nonlinearity due to bias current
changing with temperature.

Harold



FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspammitvma.mit.edu


2001\11\27@131342 by Douglas Butler

flavicon
face
As far as the A/D is concerned a voltage follower would be fine.
Anything to provide a nice low impedance signal to the A/D.  But if you
are measuring the power line there are other questions, such as what
exactly are you trying to measure?  If you only want to measure the
fundamental, then a cap will help in getting rid of nasty spikes and
harmonics.  If the spikes and harmonics are what you are trying to
measure then the cap is bad and the follower is the way to go.

Sherpa Doug

> {Original Message removed}

2001\11\27@131356 by Douglas Butler

flavicon
face
> > Note that a 10K pot will have an output impedance of 5K if the wiper
> > is
> > set to the middle.  The output impedance will be lower as the wiper
> > moves away from the middle.
> >
>
>         Wouldn't that be 2.5K?
>
       Oops... you are right!
{Quote hidden}

Well I suppose so, but I don't think you would notice on an 8 bit
conversion.
At 16 bits and above this all becones very important, but not here.

Sherpa Doug

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2001\11\28@153746 by Vasile Surducan

flavicon
face
Martin, this offset compensation tehniques is out of use by two reasons:

- first: it's minimize the input impedance by R1 || R2 which is wrong
- second: if your OA have such offset that you must
 compensate it at unity gain, you must drop it somewhere...


On these buffers, offset compensation should be done even with special
offset pins or if the OA haven't such pins, on the - input using a
resistor in the negative feedback and another one from - input to a wiper
offset potentiometer which must have a low  bipolar voltage on it.
The input impedance will be kept high in this way.
I think Imre does not need any repetor for his measurement, except maybe
a mains phase isolation.

Regards, Vasile



On Tue, 27 Nov 2001, Martin Peach wrote:

{Quote hidden}

> {Original Message removed}

2001\11\29@075115 by Martin Peach

flavicon
face
----- Original Message -----
From: "Vasile Surducan" <@spam@vasileRemoveMEspamEraseMEL30.ITIM-CJ.RO>
To: <EraseMEPICLISTspam@spam@MITVMA.MIT.EDU>
Sent: Wednesday, November 28, 2001 8:37 AM
Subject: Re: [PIC]: Potentiometer on ADC


> Martin, this offset compensation tehniques is out of use by two reasons:
>
> - first: it's minimize the input impedance by R1 || R2 which is wrong

So use 10 Meg resistors. With TLC271 or similar that's no problem.

> - second: if your OA have such offset that you must
>   compensate it at unity gain, you must drop it somewhere...

Usually the op amp is already compensated for unity gain, but maybe I don't
understand what you mean here.

/\/\/\/*=Martin

{Quote hidden}

input
{Quote hidden}

voltage
{Quote hidden}

+-----------------------------------------------------------------------+
> > > | The information transmitted is intended only for the person or
entity |
{Quote hidden}

+-----------------------------------------------------------------------+
> > >
> > > On Sun, 25 Nov 2001, Robert A. LaBudde wrote:
> > >
> > > > At 06:56 PM 11/24/01 -0500, Josh wrote:
> > > > >How do you figure out the value of the capacitor, and how long it
takes
> > > > >to charge? I'm not an EE, so sometimes these things are hard for
me. If
> > > > >I wanted to go for simplicity, would it be best to just go for a
10K
> > > > >pot?
> > > >
> > > > The size of the capacitor and the resistor are determined by how
> > frequently
> > > > you are making measurements with the ADC, if you are going to rely
on
> > the
> > > > capacitor to do a "sample hold".
> > > >
> > > > For your simple setup, it's a lot easier to simply use a lower R pot
so
> > > > that the issue doesn't arise. The minimum size of the pot depends
only
> > on
> > > > the amount of current you are willing to consume from the power
supply.
> > > >
> > > > For a 5V supply, a 5000 ohm pot will pull 1 mA (I = V/R). A 1 kohm
pot
> > will
> > > > pull 5 mA.
> > > >
> > > > If you are not making a low-power device (e.g., running off a 9 V
> > battery),
> > > > then a 1 kohm pot would be fine.
> > > >
> > > > Now the capacitor is present primarily to remove unwanted AC noise
from
> > the
> > > > ADC input. The pot and the capacitor make an input low-pass filter
to
> > the
> > > > ADC input. The roll-off frequency of the filter is at fc = 1/(2 pi R
C).
> > > >
> > > > The problem with using too low an R for the pot is that you would
need a
> > > > very large C for the capacitor to protect against noise at
relatively
> > low
> > > > frequencies (e.g., 60 Hz). For R = 1 kohm and fc = 30 Hz, you would
need
> > C
> > > > = 5.3 uF. For fc = 3 Hz, this would increase to C = 53 uF.
> > > >
> > > > If you were doing a lot of high-frequency port R/Ws (which I doubt
you
> > > > intend in your application), you might want to bypass the filter
> > capacitor
> > > > with a 0.22 uF tantalum to protect against very high frequency
noise.
> > > >
> > > > For your application (a simple low accuracy pot-controlled test jig
for
> > an
> > > > ADC), a simple 1 kohm pot alone would probably present no problems.
If
> > you
> > > > still want to remove noise, add a 100 uF capacitor from the ADC
input to
> > > > ground. Make sure the capacitor is not so large that fc is less than
> > twice
> > > > the sampling frequency. I.e., if you are going to read at 10 sps,
make
> > fc =
> > > > 20 Hz or more (e.g., 4.7 uF capacitor).
> > > >
> > > > Also be aware that use of a large value capacitor means that you
will
> > not
> > > > get an accurate ADC reading until 6 RC time constants have elapsed
at
> > start
> > > > up. If R = 1 kohm and C = 100 uF, this will be 0.6 sec at start up,
> > which
> > > > you will have to wait out.
> > > >
> > > > You can tell whether or not you need the capacitor by looking at the
> > input
> > > > signal to the ADC with an oscilloscope while it is in its most
frequent
{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...