So ... what now....

So I was able to read the voltage from my sensors, and I was able to see the change in value.

so can use those Values on the programs?

or do I have to create some sort of log for the program to understand?

here’s what I got when I read the sensor

Steve

Gauges.rtf (21.7 KB)

What is your goal? I miss a clear question…

so can use those Values on the programs?

Yes

val = analogRead(0);
if (val > 512) {
digitalWrite(13,HIGH);
}
else {
digitalWrite(13,LOW);
}

Will turn the on board LED on or off depending on the value you read from the analogue input.

@robtillaart I want to be able to print the sensors readout to a LCD.

Grumpy Mike that’s exactly how I had it written! thanks!

When I compile and upload to my mega, the LCD shows Voltage instead of PSI. Is there a formula to show PSI instead of Voltage?

Also my LCD Sccreen it seems that the refresh rate is too slow. Can I speed it up so it doesn't show like it's reloading everytime it reads the sensor?

the LCD Screen is using I2C board.

Steve

What are the specifications of your pressure sensor? You need to know the sensitivity (transfer function) of the sensor to translate volts to PSI.

groundfungus:
What are the specifications of your pressure sensor? You need to know the sensitivity (transfer function) of the sensor to translate volts to PSI.

Well that's part of the problem I can't find and specifications for the sensor. Here a link

At 0psi it reads .06v sensor value = 12.
If you open the attached file on the first first post it shows the readout.

Can you post a model number and manufacturer? With out either the specs or a way to apply known pressures to calibrate it you can't know the scale factor to translate volts to PSI. The 0.06 volts at 0 PSI is just the inherant offset and by itself tells us nothing.

Here’s the pics of the sensors … nothing much to it…

200 AIr Pressure Sensor
GS-S06
Pressure: 0-220 PSI
Ohm:12-180Ohms
0-15.2bar
1210

all the numbers on the sensor

I found this link Page 11 seems to be the same as mine minus the warning contact.

Pressure: 0-220 PSI
Ohm:12-180Ohms

Well at a guess I would map the range 0 to 220pis to the resistance 12-180 ohms.
Now you need to work out your reading from the A/D gives over this resistance range. This depends on the value of pull up resistor you have used when you wired up the sensor.

Grumpy_Mike:
Well at a guess I would map the range 0 to 220pis to the resistance 12-180 ohms.
Now you need to work out your reading from the A/D gives over this resistance range. This depends on the value of pull up resistor you have used when you wired up the sensor.

ok I get the Map() 0 to 220 but how can I read the resistance thru arduino?

Im not using a resistor to connect to the sensor. I go Sensor to A0. I dunno how to tell what the resistance is of the Pullup Resistor in arduino.

You need to have the sensor in series with a fixed resistor. One end connects to VCC, the other end to ground. Where the sensor connects to the fixed resistor should be connected to an analog pin. You can then use the voltage division formula to determine the resistance.

Is the sensor connected to the gauge? Can you apply pressure to the sensor and read on gauge?

Arrch:
You need to have the sensor in series with a fixed resistor. One end connects to VCC, the other end to ground. Where the sensor connects to the fixed resistor should be connected to an analog pin. You can then use the voltage division formula to determine the resistance.

Ok but I'm using the gauge( if you look at the pic i posted ) as the external power supply.

so there's only ground and (Gauge) data.

groundfungus:
Is the sensor connected to the gauge? Can you apply pressure to the sensor and read on gauge?

Yes when I apply pressure I see the PSI on the gauge and the Voltage on the Serial.print of the arduino.

dasaint80:
Im not using a resistor to connect to the sensor. I go Sensor to A0. I dunno how to tell what the resistance is of the Pullup Resistor in arduino.

If you are not using a resistor then you will not measure anything. The resistor needs to be external not internal and normally is half the mid value of your sensor.
So with a sensor outputting 12 to 220R then you should use a 100R pull up resistor.
Then at full scale your sensor will be 220R combined with the pull up you will have a total of 320R across the supply.

By ohms law this will give you a current of 5 / 320 = 15.625mA
With that going through the sensor the voltage across the sensor will be:-
15.625 10-3 * 220 = 3.4375 Volts

Given the A/D gives you 1024 steps for 5V that is 5/1024 volts per step = 0.0048828125 Volts so your full scale gives you a reading from the analog input of :-
3.4375 / 0.0048828125 = 704

work the same thing out for the minimum reading and that is the range to map your pressure to.

Can you give us an idea of the readings you are getting? Like when the gauge reads 5 PSI the serial monitor shows some number and at other gauge readings the serial monitor numbers.

groundfungus:
Can you give us an idea of the readings you are getting? Like when the gauge reads 5 PSI the serial monitor shows some number and at other gauge readings the serial monitor numbers.

Gauge reads: 0

SensorValue1: 12
Last voltage1: 0.0587
Current voltage1: 0.0587
dV/dt: 0.0000

Gauge reads: 2

SensorValue1: 19
Last voltage1: 0.0587
Current voltage1: 0.0929
dV/dt: 0.3421

Gauge Reads: 50

SensorValue1: 74

Grumpy_Mike:

dasaint80:
Im not using a resistor to connect to the sensor. I go Sensor to A0. I dunno how to tell what the resistance is of the Pullup Resistor in arduino.

If you are not using a resistor then you will not measure anything. The resistor needs to be external not internal and normally is half the mid value of your sensor.
So with a sensor outputting 12 to 220R then you should use a 100R pull up resistor.
Then at full scale your sensor will be 220R combined with the pull up you will have a total of 320R across the supply.

By ohms law this will give you a current of 5 / 320 = 15.625mA
With that going through the sensor the voltage across the sensor will be:-
15.625 10-3 * 220 = 3.4375 Volts

Given the A/D gives you 1024 steps for 5V that is 5/1024 volts per step = 0.0048828125 Volts so your full scale gives you a reading from the analog input of :-
3.4375 / 0.0048828125 = 704

work the same thing out for the minimum reading and that is the range to map your pressure to.

I don’t have a Resistor inline because there’s a Voltage Divider inside the Gauge that powers the Sensor… Reistor Value 59A(402) and 01C(10K).

The 01C(10K) is shared between both sensors. Each Sensor get its own 59A(402).

The Gauge gets 12V power.

Basically I need to tell Arduino 0 = Sensor1Value 12
and Gauge Reads 50 = Sensor1Value 74

Grumpy_Mike:

dasaint80:
Im not using a resistor to connect to the sensor. I go Sensor to A0. I dunno how to tell what the resistance is of the Pullup Resistor in arduino.

If you are not using a resistor then you will not measure anything. The resistor needs to be external not internal and normally is half the mid value of your sensor.
So with a sensor outputting 12 to 220R then you should use a 100R pull up resistor.
Then at full scale your sensor will be 220R combined with the pull up you will have a total of 320R across the supply.

By ohms law this will give you a current of 5 / 320 = 15.625mA
With that going through the sensor the voltage across the sensor will be:-
15.625 10-3 * 220 = 3.4375 Volts

Given the A/D gives you 1024 steps for 5V that is 5/1024 volts per step = 0.0048828125 Volts so your full scale gives you a reading from the analog input of :-
3.4375 / 0.0048828125 = 704

work the same thing out for the minimum reading and that is the range to map your pressure to.

According to the data I gave before
Pressure: 0-220 PSI
Ohm:12-180Ohms

Should it be 12-180 Ohms so Mid value should be 90 Ohms

Instead of 0-220R + 100R = 320R?

Steve

Should it be 12-180 Ohms so Mid value should be 90 Ohms

It is not critical, it is just you can actually buy 100R resistors and you can't buy 90R ones.