Skip to main content
shopping_basket Basket 0

Will a Raspberry Pi accept pressure reading up to 5 bar from a pressure sensor & send to a computer ?

Upvote 0 Votes


November 26, 2019 08:56

I made a circuit with a 5v pressure transmitter, a shifter (to have 3.4 volts) and an analogue/digital converter. Using GPIO I read the values through I2C. I made a script with python to have the readings (converted in Bars) on the screen.
Remember that each transmitter can go up to a specific value of bar, you have only to choose the right one for you. It's very important to find the conversion value with a mechanical pressure gauge put in line with the transmitter.

0 Votes

November 21, 2019 08:19

  • Moderated

TE Connectivity part number MS5803-05BA, RS Stock no (893-7219) is a 0-5 bar pressure sensor with I2C and SPI output capability, which should work with the Raspberry Pi. So the short answer is yes. But it comes with caveats. Do you need absolute pressure (relative to a vacuum), or relative pressure (difference in pressure between two ports)? Is the air/gas/liquid you are measuring benign or corrosive? What level of accuracy you need? What temperature range do you need to operate under? Do you need full accuracy over that entire range? What is your power budget (factory floor with plenty of power available, vs solar/battery powered sensing in the field)? How far away will the sensor be from the Raspberry Pi or computer?
The latter question determines which interface methods are appropriate. I2C and SPI are really designed for short distances. An analog voltage-output sensor will need conversion to digital close to the sensor to avoid noise. A 4-20ma interface is more buffered and can handle longer distance, but still needs conversion circuitry on the receiving end. RS-485 is suitable for longer distances, up to 1/4 mile or so.
Sample rate also comes into play. Some things (like atmospheric pressure) don't change very quickly. But if you were measuring pressure in a drive mechanism, you might need much faster response.
The answers to these will help you narrow your pressure sensor search down to a reasonable set of choices.


November 19, 2019 13:22

Without knowing the sensor type this question cannot be answered. Typical industrial sensors are 4 to 20 mA current loop sensors. The current is proportional to the pressure. Without an electronic circuit converting this current to a digital number your Raspi is not able to read the value. So you would need to get further electronic devices to convert the current signal.
In general: a common Raspi (i.e. without any additional components) cannot deal with analogue signals as an Arduino does. But if you use something like the RevPi (an industrial version of the Raspi) together with its AIO module you could attach any industrial sensor with current loop or voltage ( e.g. 0 to 10 V) signal.
To make the answer complete: There are digital sensors ICs on the market which do have I2C or SPI or serial interfaces integrated. But I don't know any 5 bar (i.e. 500 kPa) sensor chip which does work like this. There are also industrial high pressure sensors with digital interfaces like ProfiBus etc. But they are extremely expensive and you would not be able to read most of the protocols with a pure Raspi. There are Modbus (RS485) pressure sensors on the market which you could use together with a RS485 to USB interface in combination with a Raspi to read the pressure value and transmit it to any other PC or the cloud.

DesignSpark Electrical Logolinkedin