You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should we add support for final voltage conversion?
Reading will be between (1015) is 12 bits: -2048 and 2047
Reading will be between (1115) is 16 bits: -32,768 and 32,767
In the data sheet table 3 there is the voltage conversion instructions.
So to convert to volts I did the following: (for the 1015)
@doc """
This is for ADS1015
see data sheet Table 3
"""
def convert_to_voltage(fsr, gain \\ 2048) do
factor = gain / 1000
# 32768 bit shifted >> 4
{:ok, fsr * (factor / (32768.0 / 16.0))}
end
The only catch here is to be sure to use the same gain that was used when making the reading. The read and conversion both default to 2048 (for the ADS1015). ADS1115 has the same gain settings, but the FSR range is 16 bit so it'd be the following final line.
{:ok, fsr * (factor / (32768.0))}. # For ADS1115
The text was updated successfully, but these errors were encountered:
Should we add support for final voltage conversion?
In the data sheet table 3 there is the voltage conversion instructions.
So to convert to volts I did the following: (for the 1015)
The only catch here is to be sure to use the same gain that was used when making the reading. The read and conversion both default to 2048 (for the ADS1015). ADS1115 has the same gain settings, but the FSR range is 16 bit so it'd be the following final line.
{:ok, fsr * (factor / (32768.0))}. # For ADS1115
The text was updated successfully, but these errors were encountered: