Hi,
I'm am trying to get 4 Unik 5000 pressure sensors working using ads1115.
The sensor spec is,
0.28 to 7 barg
supply 7 to 32vdc
Output 0 to 5v
I have one sensor working using the below code, however I try I am unable to get 4 working in the code.
I cant work out how to map them to the adc 4 channels, I have tried many times adjusting the code but
keep failing. I know there must be something I keep missing as they are all the same range and spec (I know there will be minor differences with the offset but I'm hoping there is a simple way to do this.
Could someone please advise.
#include <Wire.h>
#include <Adafruit_ADS1015.h>
Adafruit_ADS1115 ads;
int16_t adc0, adc1, adc2, adc3;
void calcPressure (uint16_t Input, uint16_t Zero, uint16_t Max)
{
uint16_t Span = Max - Zero;
uint16_t Map = map( Input, Zero, Max, 0, 700);
float adc0 = (((Input - Zero) /(float)Span)*700.0);
Serial.print("AIN0: "); Serial.println(adc0);
}
void setup(void)
{
Serial.begin(9600);
ads.begin();
}
void loop(void)
{
adc0 = ads.readADC_SingleEnded(0);
calcPressure (adc0,1000, 26700);
delay(2000);
}