XRAD
Well-known member
I have a 5v output analog pressure sensor. It does not output > 3.3V until 70psi. My system does not go over 60psi. BUT, just in case I do exceed 70psi, I was thinking that :
if (psi <= 69) { analogRead (sensorPin);}
if (psi>=70){ digitalWrite(sensorPin, LOW);}
this works, in that the pin is semi 'disabled' and pressure readings stop. but I think the sensor pin is not truly disabled. So can I still damage the Teensy 4.0 if >3.3v hits the sensor pin while in LOW setting?
and BTW, i built a 20/10k voltage divider w/cap and did a linear regression plot for converting the new 3.3v readings, and the code adjustments as needed. Even after multiple measurements and attempts, the pressure readings were always off compared to the pure 5v output readings and the initial plot.
aRef is 3.3v
alpha is .95
transducer details:
Pressure transducer works for oil, fuel, , gas, water, air pressure, can be used in oil tank, gas tank, tank etc.
Material: Stainless steel
Voltage: DC 5V
Pressure: 100 psi
Accuracy: within 2% of reading (full scale).
Wiring: Red for +5V; Black for ground; Blue for signal output.
Output: 0.5V~4.5V linear voltage output.
Accuracy: within 2% of reading (full scale).
Thread: 1/8"-27 NPT.
Wiring Connector: Water sealed quick disconnect. Mating connector is included.
Overload Capacity: 2-4 times of rated pressure
Working Temperature: -40℃~+120℃
Compensation Temperature: 0℃~+80℃
Protection Class: IP67
Pressure Medium: Oil, gas and water which is compatible with 316L stainless steel
Load Resistance:≤(supply power-6.5V/0.02A)Ω
if (psi <= 69) { analogRead (sensorPin);}
if (psi>=70){ digitalWrite(sensorPin, LOW);}
this works, in that the pin is semi 'disabled' and pressure readings stop. but I think the sensor pin is not truly disabled. So can I still damage the Teensy 4.0 if >3.3v hits the sensor pin while in LOW setting?
and BTW, i built a 20/10k voltage divider w/cap and did a linear regression plot for converting the new 3.3v readings, and the code adjustments as needed. Even after multiple measurements and attempts, the pressure readings were always off compared to the pure 5v output readings and the initial plot.
aRef is 3.3v
alpha is .95
Code:
void calculatePsi() {
sensorVal = (float)analogRead(PRESSURESENSORPIN); // Read pressure sensor voltage 0-5 for 0-100psi
filteredVal = (alpha * filteredVal) + ((1.0 - alpha) * sensorVal); // Low Pass Filter
voltage = (filteredVal / 1024.0) * aRef; // calculate voltage
psiValInitial = (voltage - 0.4784) / 0.0401; //linear regression calculation from sensor data plot, at 5v
//psiValInitial = (voltage - 0.4423) / 0.0295; //for voltage divider at 3.3v
psiVal = round(psiValInitial); //so I don't see decimals on my OLED
if (psiVal != psiOldVal) {
psiOldVal = psiVal;
}
if (psiVal < 0) { psiVal = 0; }
}
transducer details:
Pressure transducer works for oil, fuel, , gas, water, air pressure, can be used in oil tank, gas tank, tank etc.
Material: Stainless steel
Voltage: DC 5V
Pressure: 100 psi
Accuracy: within 2% of reading (full scale).
Wiring: Red for +5V; Black for ground; Blue for signal output.
Output: 0.5V~4.5V linear voltage output.
Accuracy: within 2% of reading (full scale).
Thread: 1/8"-27 NPT.
Wiring Connector: Water sealed quick disconnect. Mating connector is included.
Overload Capacity: 2-4 times of rated pressure
Working Temperature: -40℃~+120℃
Compensation Temperature: 0℃~+80℃
Protection Class: IP67
Pressure Medium: Oil, gas and water which is compatible with 316L stainless steel
Load Resistance:≤(supply power-6.5V/0.02A)Ω