# FSR not showing more than 2047?

**URL:** <https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684>\
**Category:** Raspberry Pi\
**Created:** [4 December 2023 14:52 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684 "2023-12-04T14:52:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [4 December 2023 14:52 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/1 "2023-12-04T14:52:25Z")

</div>

Hello everybody,  
I followed the link below to setup Raspberry Pi with FSR sensor.

> **[How to use Force Sensitive Resistors with a Raspberry Pi and a ADS1015 ADC -...](https://core-electronics.com.au/guides/raspberry-pi/force-sensitive-pads-raspberry-pi/)**
>
> Force-sensitive resistors (FSR) are remarkable electrical components and are proper unsung heroes in the Makers World. Name me a better variable touch input device which has basically no moving parts, all whilst being available in such a tiny form...

With the help of tech support, I got it to work but unfortunately, the max pressure the FSR produces is 2047. WHat can I change in the setup for it to show higher pressure? Please help, our project is STUCK ☹

I tried multiple FSR units but same results .  
Thanks for your help!!  
Julie

---

<div class="post-metadata">

**Author:** ![Liam120347](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/liam120347/32/5003_2.png) [@Liam120347](https://forum.core-electronics.com.au/u/Liam120347)\
**Post date:** [4 December 2023 20:21 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/2 "2023-12-04T20:21:39Z")

</div>

Hi Julie,

Are you looking to get higher numbers from the code or looking to get higher equivalent force values?

---

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [4 December 2023 21:22 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/3 "2023-12-04T21:22:29Z")

</div>

Hey Liam,  
I am collecting force applied on the FSR sensor. The reading doesn’t go beyond 2047. It appears there is a max value set somewhere. I found two other threads that mention the same issue, but I am sure where to modify.

[gpio - Strange readings when connecting an FSR to Pi using MCP3008 - Raspberry Pi Stack Exchange](https://raspberrypi.stackexchange.com/questions/61212/strange-readings-when-connecting-an-fsr-to-pi-using-mcp3008)

[Swap size limited to 2047MB? - Raspberry Pi Forums](https://forums.raspberrypi.com/viewtopic.php?t=150141)

Any guidance will be much appreciated. Thanks!!

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [5 December 2023 03:19 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/4 "2023-12-05T03:19:58Z")

</div>

Hey Julie,

Hm, 2047? I am almost certain this doesn’t have anything to do with the FSR.

It is interesting that value 2047 is exactly 11-bits (12-bits if combined with a bit representing signature).

The ADS1015 is a 12-Bit ADC - 4 Channel with Programmable Gain Amplifier, the maximum possible range of values that can be represented in 12-bits is -2047 to 2047 as each bit can either be a 1 or a 0. So with first or last bit representing + or - then the next eleven bits represented in base-10 would have values of:

1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024

Which if all zeros would represent zero, then all ones “unsigned” 2047, with combinations representing every value in-between and the sign bit whether it is positive or negative. This is your maximum level of precision capable with an ADS1015.

However, even with limited precision, you can “read” values from a wider range with the help of gain adjustment, there’s a programmable gain amp on the ADS1015 as stated in the description:

`As a nice bonus, it even includes a programmable gain amplifier, up to x16, to help boost up smaller single/differential signals to the full range`

All you should need to do is tweak that gain so each increment measured represents a wider/tighter measurement from the FSR, you’ll lose or gain some precision in exchange for a wider or shallower sensor measurement range.

Can you please shoot through the code and library you’re using? Should have a way to change the gain so 2047 actually represents either the maximum value of the FSR, or at least some higher max reading than what you’re getting now.

---

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [5 December 2023 15:17 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/5 "2023-12-05T15:17:34Z")

</div>

That’s a good question, but the only coding I have done is what’s in your article. Also, will it help if I get a 16 bit ADC instead? I have no idea how to modify the gain value. Thanks Julie

[https://www.youtube.com/redirect?event=video\_description&redir\_token=QUFFLUhqazIyUFpYaU5jMWFzS2d5MUE1MERJd2YxX1ZoZ3xBQ3Jtc0tuZE0tSWI3S2F2RXdxSzJkRDcwVHZTS3lQMnMyV0xyakJxTUd5WFdDNk5NN2xsUjl5Z3I5ZGJzb1lmM1B1WGhtSzVQR2RHQ09CY2RJdTdubnBnRDFOeWhaMDF3Y1BfQUpIc2lJbVE3cUxWZXA2ejFNMA&q=https%3A%2F%2Fcore-electronics.com.au%2Fguides%2Fraspberry-pi%2Fforce-sensitive-pads-raspberry-pi%2F&v=SX0636jmktM](https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqazIyUFpYaU5jMWFzS2d5MUE1MERJd2YxX1ZoZ3xBQ3Jtc0tuZE0tSWI3S2F2RXdxSzJkRDcwVHZTS3lQMnMyV0xyakJxTUd5WFdDNk5NN2xsUjl5Z3I5ZGJzb1lmM1B1WGhtSzVQR2RHQ09CY2RJdTdubnBnRDFOeWhaMDF3Y1BfQUpIc2lJbVE3cUxWZXA2ejFNMA&q=https%3A%2F%2Fcore-electronics.com.au%2Fguides%2Fraspberry-pi%2Fforce-sensitive-pads-raspberry-pi%2F&v=SX0636jmktM)

---

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [5 December 2023 19:37 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/6 "2023-12-05T19:37:27Z")

</div>

Just increase the variable GAIN? I’ll give that a try.

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [6 December 2023 00:06 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/7 "2023-12-06T00:06:06Z")

</div>

Hi @Julie261228 - can you provide a photo of how you have everything wired up, especially around the FSR + resistor

a paste of the code will be helpful too

It _could_ just be that all you need is a change to the gain setting, but pictures really help too

---

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [10 December 2023 15:13 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/8 "2023-12-10T15:13:30Z")

</div>

Hey Michael,  
I changed the GAIN value but the max value showing up is 2047. Will changing it to 16 bit ADC help?

 ![](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/3/3b9df496135fb1785ead130b62c23497fa2fafb3.jpeg)  
 ![](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/0/00ed5e3e473d61dc3ec17acfb08fc09262e714d1.jpeg)  
 ![](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/1/1f24159edf9d96b270d47a5dd7037b8932dd570c.jpeg)  
 ![](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/3/3ce4def18bcb72d679e1d8c1a1ba47fb4d356d10.jpeg)

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [11 December 2023 00:47 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/9 "2023-12-11T00:47:37Z")

</div>

Hi Julie,

I think you actually want _less_ gain, and I’m not super sure 5 is a valid value looking at [the tutorial page](https://learn.adafruit.com/adafruit-4-channel-adc-breakouts/arduino-code#adjusting-gain-2974139)

Alternatively, you can adjust the resistor value to skew the voltage output of the FSR to keep it in range of your ADC, try a lower resistance to “pull it harder” towards GND.

---

<div class="post-metadata">

**Author:** ![Julie261228](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Julie261228](https://forum.core-electronics.com.au/u/Julie261228)\
**Post date:** [11 December 2023 16:53 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/10 "2023-12-11T16:53:19Z")

</div>

James,  
How do I adjust the resistor value? in the code? or hardware adjustment? sorry, I am such a newbie  
Thanks for your time!!  
Julie

---

<div class="post-metadata">

**Author:** ![Jack](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/jack/32/9287_2.png) [@Jack](https://forum.core-electronics.com.au/u/Jack)\
**Post date:** [12 December 2023 00:15 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/11 "2023-12-12T00:15:46Z")

</div>

Hi Julie,  
The resistor value is a hardware adjustment. The resistor you have currently appears to be 80k Ohms.  
There are many helpful [calculators](https://www.digikey.com.au/en/resources/conversion-calculators/conversion-calculator-resistor-color-code) for determining resistor values.

---

<div class="post-metadata">

**Author:** ![Bryce](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/bryce/32/3631_2.png) [@Bryce](https://forum.core-electronics.com.au/u/Bryce)\
**Post date:** [12 December 2023 00:48 UTC](https://forum.core-electronics.com.au/t/fsr-not-showing-more-than-2047/18684/12 "2023-12-12T00:48:33Z")

</div>

Hi Julie,

Before you make any hardware changes, that shouldn’t be necessary. Once you change your gain, 2047 isn’t actually representing 2047 anymore, it’ll always max out to 2047 no matter what you do as that’s the maximum signed value that can be represented by 12-bits as I mentioned earlier.

Using a 16-bit adc will instead give you a range of 32767 if signed (2 ^ 15), as it has more bits worth of precision.

When you changed the GAIN to 5 in your earlier code, you’re essentially amplifying/minimizing the representative value of that 2047, exchanging your precision or range for a benefit in the other.

Should just be a straight multiplication/division of values by GAIN to get the actual representative value of each reading (can probably do it in an enumeration on a one-liner pretty easily) if I remember correctly (unless it is a non-linear relationship and I’ve misremembered this which could certainly be the case, please correct me if I’m wrong here 😅).
