I have an application where I need to emulate a conventional 5K linear pot. The result should be indistinguishable from a mechanical pot when viewed through the eyes of an A2D converter which is controlled by embedded software which is designed (it seems) to make life hard. A microcontroller is used. Incremental cost should approach zero. _____________ A controller that replaces a unit with a motor driven feedback pot interfaces to "a computer" that expects a pot. The computer provides 3v supply and ground and expects to see the pot wiper. An electronic replacement for the pot should be a slow cost as possible while working well. eg $US1 is most undesirable. Adding an opamp would assist accuracy but add cost. I have implemented a pot replacement using a PWM drive to a transistor buffer. This produces acceptable voltage but has essentially constant output resistance across its range, unlike a pot and is not explicitly ratiometric without software feedback. The computer to pot excitation signal can and does sag and rise quite widely. As it is read by an ADC using ratiometric conversion (pot top supply = reference) these changes are relatively invisible to the computer. To make the voltage track the excitation sag I can read the excitation voltage and alter the output voltage to track. PWM filtering then needs to exclude PWM ripple but to be fast enough to track pot excitation variations. The software in the computer is fixed and unavailable and after having made an "endpoint-reached" decision it stops sampling until it decides another change is needed. Pot emulation must therefore track as fast and as well as a mechanical pot does to avoid the computer erroneously deciding the pot value is correct. (eg there is a delay in the PWM filter such that the endpoint is reached but the output is still settling. The target computer stops sampling but the output varies somewhat due to the delay.) I could use a digital pot, but the cost is annoying. I could add an active filter to the PWM allowing crisper response - adds more cost. I will definitely be able to make the result "good enough" using a transistor or two and some passives plus software feedback. But maybe someone else has done this sort of thing already and can comment accordingly. The killer is the need to meet the embedded software's expectations re pot wiper settling tine. Russell McMahon -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist