I2C industrial pressure sensor (DCT 532) with Arduino Uno - advice required

Hi all,
I'm quite new in the Arduino world, and trying to process my way through everything.
My project is to control a compressor and a pneumatic valve depending on pressure value in a chamber.
My prototype built will use an Arduino Nano R3. For other components (pressure sensor, compressor, pneumatic valve), I'm trying to use parts that are as close as possible to the parts I would like to use in the final version of the project.

I'm currently in the process of finding the right pressure sensor. For precision purposes, this sensor must be of industrial grade.

Our supplier offered an analogic sensor but not sure it fits my needs: sensor output is either 4-20 mV (which requires an additional conversion before being able to be processed as an analog input on the Arduino, if I understood correctly), or 0-10V (which is not OK as Arduino analog inputs are limited to 5V), or ratiometric to the sensor input voltage, which I don't like because of the possible input voltage variations/precision.

I was then thinking to use a digital I2C sensor available in their catalog, as I understood Arduino could handle this type of serial communication.
However, as I have never used serial communication/I2C protocol, and because of the price of such sensor, I wanted to double check with you first if this sensor seemed appropriate to be used with an Arduino.

Datasheet can be found here : DCT 532 Datasheet

I have an external 5V power supply, which seems to be perfect for Arduino as well as this sensor.

Operating Manual with I2C Com interface can be found here : DCT 532 Operating Manual

My questions:

  • Can you confirm that this I2C sensor can be used with an Arduino R3 ?
  • Do I need any additional componant (except pull-up resistors) to connect this sensor to my Uno R3 ? Or can I directly link it to the A4-A5 digital pins for SDA & SCL lines ? (+ external power supply of course)
  • I've read some are adding RTC module for I2C communication but I don't exactly understand why should I?
  • Should I want to monitor pressure, I guess I will need a datalogger (or at least SD card + RTC module), correct ?
  • All in all, do you think this sensor is a good choice to perform this project ?

Thank you for your help !

Looks ok. You only need pullups.
If you want to log the data on SD, that is separate argument.
You could ask the supplier if they have library to read the sensor...

There is a limit to the distance I2C signals can be sent. Your Arduino will need to be relatively close to the pressure sensor.

I2C was originally developed for communications between ICs on the same PCB, hence the low range.

From the link above

The i²C address is 0x28 (HEX). The I²C frequency must be at least
100 kHz and a maximum of 400 kHz. Pull-up resistors with 4.7 kΩ
are used as standard. The exact value of the pull-up resistors
depends on the communication structure and its electrical
properties (cable length, cable capacitances, etc.).

To read out the recorded measured values, a request must be
sent to the device consisting of the slave address and the read
bit. The NACK of the master is then used to control how many
bytes are read. For the pressure measurement (bridge), 2 bytes
must be read. For pressure and temperature, 4 bytes must be
read.

The pressure measurement works with a resolution of 14 bits. The
raw value D read out is between 0 and 16383. The measuring
span of the pressure measurement is adjusted to 10 - 90 % of the
available resolution (raw v alue D = 1638 ... 14744). The range
below 10 % or above 90% is used to be able to detect an
overshoot or undershoot of the adjusted measuring range.

The temperature measurement works with a resolution of 11 bits.
The raw value D read out is between 0 and 2048. The measuring
span of the temperature measurement is adjusted from 0-100%
of the available resolution, which means that no overshoots or
undershoots of the adjusted measuring range can be detected.
The temperature output of the module used is adjusted directly by
the manufacturer to -40 to 125°C. Note: The temperature value is
measured inside the device and can therefore deviate from the
media temperature.

This document describes far more registers that could be accessed.
It could work for your sensor too.

Industrial grade does not necessarily mean precision. I would think that accuracy would be more important.

Does that sensor have the required accuracy, precision and speed for your control system?

That depens on the distance between sensor and Arduino.
I2C only works over a short distance.
4-20mA is an industrial choice because of long distance and possible noise immunity.
The problem with 4-20mA is calibration.
0-10volt is like 4-20mA, has a 20% higher resolution but possible groundloop problems with longer wires.
I2C would be my choice but make sure your device has an Arduino library if you're not good at coding.
Leo..

what other project requirements are there? e.g. reporting sensor readings and control status via WiFi or Bluetooth?

Hi all,

Thank you for the quick feedback !

In progress but I doubt the answer will be positive as I cannot find any info about it on the website or data sheet. Is this a problem ? Will this make the coding extensively difficult ? I imagined that a lot of info was already in the tech documentation, and the coding should mainly be for requesting the right information/bytes in the I2C format which I have never done but I guess this is pretty similar to other I2C projects that can be found online ?

Sensor will remain in very close proximity to the Arduino, less than 20 cm cable.

Will have a look, thank you !

You’re right about accuracy, and this one thicks the boxes for my need. I just didn’t want to destroy its accuracy and resolution using arduino’s 10-bit ADC.

I’m definitely not good at coding, even less with I2C, but I was hoping that the tech documentation of the sensor + Arduino’s basic I2C library + code examples found online for getting a « read » data from I2C slaves would somewhat help me get a functionnal code. Is that so much more complicated than I thought ? Do you have any pressure sensor reference that could have this I2C library available already ?

None of these. Basically creating a portable device to test a blow off air pressure valve. So I manually install the valve on the system, then push « start », the Arduino will power a compressor building pressure in a chamber connected to this valve, pressure monitored by the pressure sensor, when the valve opens and the drop in pressure is detected by the sensor (and arduino), Arduino shuts off the compressor and max pressure before the drop is displayed (I will also add a pressure relief solenoid valve also commanded by the arduino to later remove all remaining pressure in the chamber).

You are absolutely right. But I'm lazy person with poor coding skills. And that doesn't help when you are trying to figure out if you have hardware or software problem.. :wink:
Ready made working library saves a lot of hassle.

@bvr22

If you want a library for the DCT532 to be written, you can send me a PM.

Hi all again,

Back on the project after a few busy months at work.

So the same manufacturer appears indeed to have a RS485 ModBus version of the same sensor, called DCT531:

For a complete beginner like myself in either I2C or Modbus protocols, and independantly from other sensor characteristics, what do you think is the easiest option to use / code with Arduino ?

@robtillaart I’ve seen you have created a library for ASDX pressure sensors, any idea if one could fit the same caracteristics ?

That's a family of sensors: gauge, absolute, differential.
The sensor page links to analogue outputs,which means the resolution depends on the 10-bit A/D of the Nano (about 820 different pressure steps).
What pressure span do you need, and what resolution is acceptable.
Leo..

I don’t know the specs of all sensors, you need to dive into the datasheets and compare.

This order selection guide might help

Modbus is protocol but RS485 is the standard. Biggest difference is coming in wiring length, I2C is good for few inches, RS485 for long wiring.

I work with industrial instrumentation and the old 4-20 mA system is hard to beat. If all you need is a pressure reading then why not simply feed it into a 250ohm precision resistor and measure the resultant 1-5V signal with the Arduino ADC, like any PLC I/O card does, and avoid all the hassle of trying to get a serial protocol to work. I know this would mean you couldn’t get the temperature reading from the device but it specifically says this reading is inside the sensor, so with no flow it will be inaccurate. And do you actually need it if all you are doing is controlling pressure?

I see lots of smart transmitters that can transmit multiple variables over HART and Fieldbus, and long-term no-one ever looks at anything other than the primary variable. In 99% of basic control applications like pressure and temperature it is a waste of time.

I am guessing 4-20 mA which is a common current loop. What is done with a 4-20 mA loop is to place a 1% 250 Ohm resistor in the loop or a 1% 500 Ohm resistor in the loop which will give you 1.0 to 5.0 volts or 2 to 10 volts. Here is how it works. I have a zero to 500 PSIG pressure sensor having a 4 - 20 mA output. I pass the 4 - 20 mA through a 250 Ohm precision resistance. I now have 1.0 to 5.0 volt proportional to applied pressure on my sensor.

If you are testing for example pressure relief (pop off) valves a common method I used years ago was using a data logger and included an accelerometer:

When the relief valve opens it does so with a bang or pop. The accelerometer or similar picks up the pop. This is where I prefer a data logger over an Arduino. Data loggers are pretty common and actually inexpensive. Dataq Starter Kits are but one example. Easy to use and easy setup and scaling. You can chart the exact pressure when the valve opens.

Today I see pressure sensors outputting just about any type data you want so you choose what will work best for your application.

Something to consider is uncertainty in your measurement plane. Just for example using an Arduino Uno Rev 3. Your analog input channels are 0.0 to 5.0 volts and it’s a 10 bit A/D conversion so 5.0 / 1024 = 4.85 mV. That’s as good as it gets for resolution. Let’s say my sensor is 0.0 to 3,000 PSI with a 4 to 20 mA out and I use a 250 Ohm series resistor so now I have 0 to 3,000 PSI = 4 to 20 mA or 1 to 5 volts, a span of 4.0 volts so 4Volts/3000PSIG = 1.33mV per PSI. The best I can resolve is about 3.0 PSI. Just another consideration. :slight_smile:

Find the sensor that works best for you and one available to you meeting any budgetary constraints. Anyway, I would go with a data logger, even a simple starter kit and many offer -10 to 10 volt inputs.

Ron

@bvr22

Finished a minimal I2C library for the DCT532 today. As I do not have hardware I cannot test.
If you have time and appropriate HW, please give it a try.

See GitHub - RobTillaart/DCT532: Arduino library for DCT532 I2C pressure and temperature sensor.

Hi @robtillaart

Better late than never, thank you for your help. Could not test it yet because project shifted due to other professional constraints, but I’m ordering the sensor at the moment and I will give it a try as soon as I receive it.

Will of course keep you informed !

Of course I’m always open to find any other simpler/cheaper but as reliable sensor options. I will have a 5V and a 12V powe rsupplies available.

Feel free to open issues on GitHub if problems arise.