Reading pressure sensor using arduino analogue


I’m using a Arduino Uno to read pressure and I want to know if I have wired/coded the sensor correctly. I’m not sure I’m getting the correct readings (It could be the right readings - I just want to check I have done everything right). The sensor I am using is an OsiSense™ XMLP pressure sensor that reads between 0 and 100 bars and gives out a 0v (zero bars) to 10v (100 bars) charge. Due to the Arduino Uno only being capable of reading up to 5 volts, I’ve used a voltage divider to reduce the maximum voltage the arduino receives to 5v.

I’ve attached a hand written diagram (I couldn’t work out how to create the pressure sensor in fritzing). Let me know if you need any more information. I’ve attached the wiring and also the code.

Thanks in advance.

ReadPressureSensorAndPostToMQTTTestCode.ino (2.7 KB)

Connect the grounds.

The word "circuit" is the clue - if there isn't a return path for current, no current can flow, you
don't have a circuit. Typically for signals ground is the return path (as well as the voltage reference