Digital pressure sensors output in formats like IIC bus, SPI bus, Microwire/PLUS bus and one-wire single bus, etc. The IIC digital pressure sensor has gradually expanded its application field after years of market promotion, and its advantages are obvious as below:
1. The output consistency error of the sensor can reach 0.5% or less, and the characteristic parameters of the sensor can be identical, so it has good interchangeability.
2. Excellent electromagnetic compatibility, increased anti-interference ability of the sensor, and more reliable than analog signals.
3. Standard digital communication interface, the signal can be directly connected to the MCU, the MCU can obtain and process more different parameters, realize multi-functional intelligent instruments.
Products
The MPM3801 pressure sensor is digital with IIC bus output.
Product Programming
The data acquisition of the digital signal sensor needs to be programmed by MCU, which is more complicated than the analog signal sensor. We take the MPM3808 I²C pressure sensor as an example to illustrate how digital sensors can read measurement data.
MPM3808 I2C digital pressure sensor, the I2C default communication address is 0x28, write: 0x50, read: 0x51; SCLK clock frequency: 100KHz ~ 400KHz.
The I²C master device (such as a microcontroller) sends a 7-bit slave address (0x28) and an 8th bit = 1 (read). As a slave device, the pressure sensor sends an acknowledge (ACK) as a sign to indicate that the communication is successful. The slave device then returns two bytes of pressure data (P[13:8] and P[7:0]), two bytes of temperature data (T[10:3] and T[2:0] to the master. ]). The I²C communication process is as follows:
I²C is a commonly used communication method. Many integrated development environments (IDE) integrate the I²C library function. When data is acquired, the MCU can directly call the library function to realize the sensor IIC signal reading. For example, if you call the library function wire.h, the communication flow is as follows:
Wire.begin(4,5); // Initialize I2C bus, SDA:4, SCL:5
Wire.beginTransmission(0x28); // Start transferring data once
Wire.endTransmission(void); // The communication ends and the host sends a STOP signal.
Wire.requestFrom(0x28, 4); // Read 4 bytes of data from the 0X28 device
Wire.available(); // Number of bytes received
Wire.read(); // Receive data, P1, P2, T1, T2
Pressure = P1 <<8 | P 2; // 14-bit pressure data (BIN)
Temperature = T1 <
Notes
The data read by the MCU from the MPM3808 pressure sensor is the code value, the pressure is a 14-bit binary number (0~16383), and the temperature is an 11-bit binary number (0 ~ 2047). For example, the sensor's basic range: 0~300Kpa, the output signal (5%~95%) corresponds to 819 ~ 15563, the code value and pressure and temperature conversion are as follows:
(IIC data collected by MCU is simulated and printed by the SecureCRT terminal through the serial port)
At present, most sensor applications use analog output signals, but the convenience of digital output sensor applications such as I²C has been recognized by more and more designers. The sensor uses serial bus technology, which can simplify the system's hardware, reduce the size, and improve reliability. At the same time, the system upgrade and expansion are extremely easy.
Contact Us
For specific applications of the MPM3808 digital pressure sensor, please contact us via sales@microsensor.cn. Our engineers will provide the corresponding product solutions according to your actual needs.