The problem I'm having it that the gauge is showing -26.87 psi at 0psi
Everything works but the reading are all over the place.
However I'm not using the same transducer as in the project.
Here are the specs of the transducer i have.
Range: 0-100psig Output: 0-10vdc Input: 14-36vdc
I believe it's also Radiometric.
So by using a different transducer i know it needs to be calibrated.
I'm new to coding and i have no idea where to start or what line i need to edit.
Here is the code I'm using:
Sorry the code is too large to include it in Code tags.
nuworld:
However I'm not using the same transducer as in the project.
Here are the specs of the transducer i have.
Range: 0-100psig Output: 0-10vdc Input: 14-36vdc
I believe it's also Radiometric.
If it has a voltage output, then it's not ratiometric.
That's good, because the NodeMCU has an absolute A/D, and can only properly measure voltage sensors.
The article is using a ratiometric sensor, and that's wrong.
GolamMostafa:
Feed you sensor signal into this resistor network: sensor voltage ---> (R1)1.5k + (R2)1.5k + (R3)2.2k ---->GND.
Are you forgetting that the NodeMCU already has a 100k:220k voltage divider connected to A0.
All you need is a 680k resistor between sensor output and A0.
The code can be as simple as:
float pressure = analogRead(A0) * 0.097656; // calibrate by changing the last digit(s)
(0.097656 being 1/10.24, including the A/D range and 100psi span)
Leo..
As you are using ESP8266, please follow guide lines pf Post#4. I was not prompted to enter into your link to see that you are actually using an ESP8266 based Project.
I'm using a ESP8266(LiLon NodeMCU V3)
And a 24v pws for the sensor.
As for the code it was too large to include code tags.
there is a 9000 character limit for each post.
This is why the included code is in the attachment in OP.
Can't be bothered to read all of that.
You should always try sensors with the least amount of code before adding them to a complicated setup.
Advice still stands.
680k resistor between 0-10volt sensor output and A0, shared grounds, and only this line to convert A/D to pressure.
float pressure = analogRead(A0) * 0.097656; // calibrate by changing the last digit(s)
Nothing else, except for maybe a 100n ceramic cap between A0 and ground if used in an electrically noisy environment or with pressure fluctuations.
Leo..
Try this minimal sketch to test the the sensor on the serial monitor.
Leo..
float pressure;
void setup() {
Serial.begin(9600);
}
void loop() {
pressure = analogRead(A0) * 0.097656; // calibrate by changing the last digit(s)
Serial.println(pressure, 1); // one decimal place is all you're getting
delay(1000);
}
Wawa:
Try this minimal sketch to test the the sensor on the serial monitor.
Leo..
float pressure;
void setup() {
Serial.begin(9600);
}
void loop() {
pressure = analogRead(A0) * 0.097656; // calibrate by changing the last digit(s)
Serial.println(pressure, 1); // one decimal place is all you're getting
delay(1000);
}
Prune out the analogRead part of the code, and insert the new one.
I sure hope you wrote the code yourself, or do understand it.
If you did copy/paste, then take 10 steps back, and start learning.
Leo..