As shawn stated, op-amps are fairly simple, but you can certianly give it a try with just a resister. The 10k impedance problem simply means that voltage levels will measure less than what they actually are. The real issue here is that once you go outside the specification the one PIC may not work like the other, so the circuit and program you make may work fine on one PIC, but you might have to change the program slightly on another PIC. Alternately it may work at room temperature, but it may change slightly in colder temperatures. In most cases I suspect you won't even run across these problems. To give yourself maximum range, I'd use a large (8k to 10k) resistor, then hook it up to the PIC and read the values out. If they are sufficiently distenguished (they should be) then you can use just the resistor. So, as a one off, you should be fine with a resistor and setting the levels inside the PIC by hand. -Adam Omer YALHI wrote: >Adam, thank you for the reply. However, the circuit I have given is a >"black box", I am only exposed to the pins A and B. I think I can still put >your idea to work by adding another resistor (something smaller than 10K >perhaps?) at point A and measure the voltage at that point. Does this sound >right? Also, I am not familiar with op-amps, so I wouldn't know where to >start; therefore I am trying to avoid using an op-amp (unless it becomes >necessary). > >Regards, > >Omer > > >-----Original Message----- >From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On >Behalf Of M. Adam Davis >Sent: Saturday, April 17, 2004 12:12 AM >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PICLIST] [EE:] Reading different resistor values > >This circuit uses large value resisters, which makes it difficult to read >when directly connected to an analog input pin, but by no means impossible. > >You have a simple resister divider. Hook the analog input pin to the >junction of R1 and R2 (where B1 connects). As the switches open and close >the voltage level at that junction varies. > >If the voltage is one volt, then these are the voltages at that junction you >can expect: >B1, B2 open --> .745 >B1 closed --> .109 >B2 closed --> .647 >B1, B2 closed --> .093 >B3 close --> 0 > >If the voltage going in is higher, then just multiply the above values by >that voltage, so for 5 volts it would be 5 * .745 = 3.72 and so on. >You can measure this directly with a multimeter at that point. > >The PIC may measure slightly different voltages for both open and B2 closed >since there is an impedance limit in the PIC - it doesn't like to measure >voltages through resistors more than 10k (It's a little more complex than >that, but this will get you started). > >However, it will still be able to detect the change and correctly identify >the various states of the switches. If it doesn't work very well adding an >op-amp to buffer the voltage will set it straight. > >I hope this helps! > >-Adam > >-- >http://www.piclist.com hint: PICList Posts must start with ONE topic: >[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.