Find the percentage of a value within a logarithmic range?

Calab

New member
Joined
Dec 19, 2025
Messages
3
Forgive me if I don't explain clearly... I'm not a math expert by any means...

I have a range of numbers between 1 and 32768. This range increases logarithmically. In other words 50% of this range is not 16384, but a much lower number, which I would guess is around 2600 - but that is a guess.

If I have a value between 1 and 32768, how would I find out what percentage of the scale that value falls at?

My problem is that I am reading a potentiometer and my sensor returns a value between 1 and 32768. As I turn the potentiometer, the increase in readings starts out small. The further I turn the faster the value climbs. I need to get a linear reading from this sensor.

Any kind of assistance with this problem would be greatly appreciated.
 
I think I stated my problem backwards. I know the value between 1 and 32768. I need to know the percentage that it falls at.

In other words, if my value is 0, then it's 0%. If my value is 2600 (a guess), then it's 50%, if my value is 32768, then it's %100. It's the percentage I'm after.

I believe I'm working in a natural logarithm, but could use a specific base if needed.
 
Last edited:
What function did you graph? Does that represent what you have in mind, or is it just similar?

One trouble is that if you want this to be an exponential function (so that the percentage is a logarithmic function), then there can't really be a zero point as shown (without some adjusting). Furthermore, you need some other number to determine the scaling, such as your example of 2600 being 50%. The 0% and 100% values are not sufficient to determine the curve, even if we assume a particular form.

Here's an example:

1766202584495.png

Note that this doesn't pass through (0, 0).

How close is that to what you want?
 
Top