This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ADS1115 Gain & Calibration
#1
Hello,
Iam new to OP, still learning. I have connected a fuel filter vacuum/pressure sensor via a ADS1115
The sensor operates at 0,5 to 4,5 Volts but I only see 4,006 Volts as maximum. Can this be adjusted with Gain ? and where do I access the Gain Adjustment ?

The sensor should be linear but is it possible to add Calibration points if not ? and where do I do it ?

Thanks in advance
Klaus
Reply
#2
(2023-11-05, 09:30 AM)SY Kalinka Wrote: Hello,
Iam new to OP, still learning. I have connected a fuel filter vacuum/pressure sensor via a ADS1115
The sensor operates at 0,5 to 4,5 Volts but I only see 4,006 Volts as maximum. Can this be adjusted with Gain ? and where do I access the Gain Adjustment ?

The sensor should be linear but is it possible to add Calibration points if not ? and where do I do it ?

Thanks in advance
Klaus

Have you checked the output of the sensor with a multimeter to see what voltage range it is actually producing?

OP sets the gain for the ADS1115 by default to 1 giving you a measurable range of 0V to 4.096V. You can change the gain if required but I would start by verifying the output voltage with the meter.
Reply
#3
(2023-11-05, 07:59 PM)baltika_no_9 Wrote:
(2023-11-05, 09:30 AM)SY Kalinka Wrote: Hello,
Iam new to OP, still learning. I have connected a fuel filter vacuum/pressure sensor via a ADS1115
The sensor operates at 0,5 to 4,5 Volts but I only see 4,006 Volts as maximum. Can this be adjusted with Gain ? and where do I access the Gain Adjustment ?

The sensor should be linear but is it possible to add Calibration points if not ? and where do I do it ?

Thanks in advance
Klaus

Have you checked the output of the sensor with a multimeter to see what voltage range it is actually producing?

OP sets the gain for the ADS1115 by default to 1 giving you a measurable range of 0V to 4.096V. You can change the gain if required but I would start by verifying the output voltage with the meter.

Thanks, I dont have a test pump at the moment but will see what I can rig up for testing. How and where do you change the gain setting ?
Reply
#4
When you install the ADS1115 in the I2C app you set the gain there:

By default it is set to 1 meaning an input voltage range of 0 to 4.096V. If you were to change it to 2 for instance the range would reduce to 0 to 2.048V etc.

The problem I have is that I have no idea how to set it to the gain of two-thirds which should set the range 0 to 6.144V . I've tried gain=2/3, gain=0 etc but they don't seem to work.

Once you know the output range of your sensor in terms of voltage range, and the corresponding pressure or vacuum range then you can change the mapping in OP to provide meaningful output.

E.g voltage range 0 to 4.5V = -x to +y bar

Edit - Can I ask which sensor you have?


Attached Files Image(s)
   
Reply
#5
I did this project with an ESP32 and SensESP, but never got it installed before I sold the boat. I think the ADC reads voltage and assigns a digital value, does it not? So it isn't displaying a voltage, but 4.096 (2.048 or 1.028) as the max voltage, whatever that is? Would it not, then read 0 (.5 volts-ish - bottom range) to 4.098 (4.5 volts-ish - top range)? Test it with a potentiometer and see what it displays as min/max of known/equivalent voltages.

I've always had a hard time understanding how these things work, but usually muddle through to make it happen. I am probably way off here.
Reply
#6
Yes and no. Of course the ADC converts an analogue voltage to a quantized representation. It's output is always an integer in the range 0 to 32767 (for the ADS1115 which is a 16 bit device), OpenPlotter reads this and converts it to a voltage which is presented to Signal K.

Just because you are connecting a device which can output 0.5V to 4.5V does not mean that a value of 0 corresponds to the 0.5V and 32767 corresponds to 4.5V that's absurd.The ADS1115 has no idea what the min and max values might be of anything you happen to want to connect to it, it is just reading a voltage and assigning it to the nearest quantized value within a range. It has no further knowledge. So if I connect something that swings say from 1V to 3V it can't automatically adjust so that 0V returns a level 0 and 3V returns a level of 32767. The gain you set on the device determines the range of voltage it can measure; a gain of 1 for instance means it can measure 0V to 4.096V. If it is supplied with an input of 4.096V then the digital level will read 32767, If the voltage increases to say 4.5V then the device has run out of range, I cannot assign a higher value than 32767.

In fixing the gain for the ADS1115 you are fixing the intervals between each voltage step it can resolve. What you have to do is to set the gain and/or use a potential divider to ensure that the voltage presented to the ADC is within the range for the gain specified and within the overall capabilities of the ADS1115 (e.g. no more than around Vcc +0.3V).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)