Maker Pro
Maker Pro

PIC24 ADC VOLT REF QUESTION

Hi all, I have a rheostat position sensor which I have is mounted on a single axis control lever. Rheostat is 2k so at center I have 1k to both extremes. I feed ADC1 on my pic this potential. I have seen on other projects like electric wheel chairs have a center tapped pot which gives an appropriate voltage ref from the center position outward which the ADC could then digitize and control various movements. I have not experimented on how the voltage ref choices on the ADC input would work to give me a relative value from the center ref voltage. Do I just set my ref pin to the center voltage and will the ADC give me a digitized value from that center voltage? I don't need to have negative values to accomplish the needed control. Any suggestions to the workings on my ADC would help. I am using a PIC24HJ128GP
 

Harald Kapp

Moderator
Moderator
You set the voltage reference to the max. input value you expect to get a good resolution of your measurements. In your case you will probably use AVdd and AVss as reference (manual, chapter 17).
The potentiometer would be connected with the ends to AVdd and AVss, wiper to an ADC input. The wiper of the potentiometer in mid-position will scale down the voltage to approx. 1/2:(Avdd-AVss) = 1/2*AVdd assuming Avss = 0 V.
Since the ADC is a 10 bit converter this will voltage will translate to a reading of 512d (0x200). Higher voltages will give higher readings from the ADC (>512d), lower voltages will give lower readings (<512d).

Here's an intro into PIC ADC usage.
 
Last edited:
Top