View previous topic :: View next topic |
Author |
Message |
ad
Joined: 24 Mar 2015 Posts: 14
|
Potentiometer |
Posted: Tue Mar 24, 2015 1:46 am |
|
|
Hi, I 'm making a data acquisition unit for a two-wheeled vehicle. And I want to purchase four variables, temperature, fuel level, speed and accelerations. If the fuel level simulate with a potentiometer, because the sensors with a minimum quality are expensive. I have many problems to program the potentiometer, to observe that performs the instructions I give him correctly, I tried different programs but do not work. If someone could help me, to be able to do, would be very grateful.
Thanks. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Mar 24, 2015 2:49 am |
|
|
You're not giving us mch to work on.
1) PIC.
2) Compiler version.
3) Sample of what you've tried.
4) Resolution/accuracy required.
5) ..................
6) ..................
For a simple pot you connect:-
a) One end to GND.
b) Other end to Vref.
c) Wiper to ADC input.
Then use PIC's ADC
Mike |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Tue Mar 24, 2015 12:12 pm |
|
|
Making sure the value of the pot is high enough to not conduct more current than it is rated for at that voltage, but low enough to meet the input impedance requirements of the selected PIC (see the data sheet for the input impedance requirements for your selected PIC). I would also use a capacitor from the wiper to ground to help suppress noise etc.
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|