0

I am trying to read the analog signal from a Pfeiffer TPG 261 Single Gauge (https://www.idealvac.com/files/brochures/Pfeiffer_Single_Gauge_TPG261.pdf)

The pin assignment of the connector I am using is the following:

RS232Pinassingement

Here is the circuit I have built:

BreadboardConnection

And here is the code used:

int pressureSensorPin = A0;

int analogValueP = 0;

void setup(void)
{
  Serial.begin(9600);
}
void loop()
{
  analogValueP = analogRead(pressureSensorPin);
  Serial.println(analogValueP);
  delay(1000);
}

Unfortunately the ouput I get with such a build is only 0 with now and then a 1023.

Any idea of what I am doing wrong ?

  • 3
    The Arduino has 5 V TTL Serial. the connector is RS232, possibly +/-12 V. You need a converter. The value read on RS232 would be data to read with Serial.read(), not an analog signal – Juraj Oct 2 at 11:13
4

You have a misconception, which signals get's outputted where. If you want to simply read the analog signal of the sensor, you need to use the "control" connector. There you can find the analog signal on pin 2. But this analog signal goes up to 10V, so you need a voltage divider between the sensor and the Arduino, to divide the voltage down to 5V max.

Currently you are using the RS232 connector. RS232 is a communication standard, which transmits digital data, not analog data. Thus you read only digital values (min voltage and max voltage, nothing inbetween). You can use it do talk with the sensor, change configuration settings and reading data digitally. But to actually do this, you need to consider 2 important things:

  1. RS232 is an interface, which involves it's own voltage levels (namely +-12V), which do not fit the TTL level (0 - 5V) that the Arduino Uno uses. You can very well destroy your Arduino by connecting it directly to RS232. For making this work, you need a level converter chip (I think the MAX232 is commonly used for this), to convert the voltage levels to TTL logic. From there on this communication is normally called UART.

  2. You need to understand and then implement the sensors communication protocol (when to send what data), so that the sensor and Arduino are understanding each other


For me it seems, that the analog signal from the "control" connector is all, that you currently need, so for simplicity you can use this. RS232 is used for more control over the functionality of the sensor.

  • Even the analog signal from the control connector supplies a voltage range of 0 .. 10V, which requires some treatment (voltage divider) and is not directly applicable to an Arduino. – DataFiddler Oct 2 at 12:26
  • You are correct, I will add this to the answer – chrisl Oct 2 at 12:53
  • Thanks for all the information, yes I did have a major misconception, I understand better now. So if I wanted to access the digital output something like this could work : conrad.de/de/p/… ? – Anthony Lethuillier Oct 2 at 14:08
  • Yes, that would work – chrisl Oct 2 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.