Exponential ADC

Status
Not open for further replies.

tom_pay

Member
Hi Everyone,


Today I made a little device that should get an ADC value and display the 8 bit value on 3x 7 segment displays.

There is only one problem, the number displayed seems to be acting exponentially compared to the rotation of the pot. It takes about half a rotation to go from 0 to 1 a quarter to go from 1 to 5 and the last quarter goes to the full 255.

I don't think it is the pot, it is a 10k linear pot.

Does anyone know what I'm doing wrong? Can anyone help?

Thanks

Tom
 
Hi Tom,
It is possible you have a logarithmic pot but it could also be your code for the ADC. If you can post your schematic and code then we can see if it is the code or your schematic.

Regards Bryan
 
How is the pot connected? Between V+ and ground, with the wiper to the analog input?

Have you tried measuring the voltage between ground and the wiper? Is the voltage varying in a linear fashion as expected? This measurement narrows the problem down to hardware or software.
 
I was so lost as to what it could be, I forgot to test the voltage of the pot. Sorry!!

The pot is connected with one terminal to 3v one to Gnd and the wiper directly to the analogue input.

I checked the voltage at the analogue input and it rises exponentially, just like the numbers. However when the wiper is disconnected from the input it rises in a linear fashion.

I am now really confused, how can this happen? How do I fix it?

Thanks

Tom
 
Ohhhhhhhhhhhhhhh,

I have just read my code and I had set the TRIS value for my analogue input as a digital input.

I am so very sorry to every one. I have learnt my lesson.

Sorry Big Time!!

Tom
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…