Pang wrote: > > Hi, > > Thanks for suggestions and questions. It shows I have not been thinking > thoroughly on the method of implementation. First of all, the application I > will be building is going to be a tilt sensor. > It is meant to be installed > in an automotive to detect towing. As such, I think an angle sensor will be > a more appropriate name. > >The potentiometer is > fixed to a flat board. Whenever the board is raised at either side, the > weighting will move the shaft. > I have enquire things like rotary encoder, position sensor, optical sensor > and angle sensor. But most of them are either costly or that they cannot > withstand much load to the shaft. I have a solution that is cheap, small, reliable and "zero" torque. The only down side is that it will need a calibration table in software. Use a IR pair, a transmit/receive reflective pair as found in VCRs etc. (Some are only about 3mm cube size) Like this: pin * | | ,-------, | | | | | IR |==========> | White | pair | | surface | |<========== | | | | | | | | | | '-------' | ,-----*-------, | Weight | | | '-------------' <----- swings -----> (all under a light proof cover!) The IR pairs can be attached to a PIC very easily, you run the led at about 5mA and set the receive diode as half of a voltage divider, and it will give an analogue voltage somewhere between 0-5v as the device is tilted. The voltage output is not linear, but can be calibrated in software to give an easy 32 positions etc, which is probably plenty? :o) -Roman -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.