Connect with us


Discussion in 'Microcontrollers, Programming and IoT' started by GATO_AMP, Dec 6, 2018.

Scroll to continue with content


    Dec 6, 2018
    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
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    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: Dec 7, 2018
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day