Diff pressure click carries NXP’s MPXV5010DP signal conditioned, temperature compensated and calibrated pressure sensor with two axial ports to accommodate industrial grade tubing. The click is designed to run either on 3.3V or 5V power supply. It communicates with the target microcontroller over SPI interface (CS, SCK, MISO).
Diff pressure click is designed for comparing two pressure measurements. For example, measuring the difference in the pressure of gasses in a variable diameter flow tube.
The two ports are designated as Pressure side (P1) and Vacuum side (P2). The sensor is designed to operate with a positive differential pressure where P1 > P2. The measurement range is from 0 to 10 kPa. In the temperature range between 0º and 85ºC, the sensor has a maximum error rate of 5.0%.
MPXV5010DP IC has an analog output. The signal passes through the onboard 22-bit ADC before being outputted through the mikroBUS SPI interface (CS, SCK, MISO).
Type | Pressure,Altitude |
Applications | Differential pressure measurement for controlling industrial processes |
On-board modules | NXP MPXV5010DP |
Key Features | 0 to 10 kPa measurement range |
Key Benefits | Onboard 22-bit ADC, Two ports for industrial grade tubing |
Interface | SPI |
Input Voltage | 3.3V or 5V |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
The following code snippet initializes SPI, UART and the Diff Pressure click and reads the difference between the two pressures to the UART terminal.
1 void main() 2 { 3 //Local Declarations 4 int32_t buffer = 0; 5 char uart_text[20] = { 0 }; 6 float difference = 0; 7 status_t status; 8 9 //GPIOs 10 GPIO_Digital_Input( &GPIO_PORT_24_31, _GPIO_PINMASK_6 ); 11 GPIO_Digital_Output( &GPIO_PORT_24_31, _GPIO_PINMASK_4 ); 12 13 //UART 14 UART1_Init( 9600 ); 15 Delay_ms(200); 16 UART1_Write_Text( "UART Initializedrn" ); 17 18 // SPI 19 SPIM1_Init_Advanced( _SPI_MASTER_CLK_RATIO_4, _SPI_CFG_PHASE_CAPTURE_RISING | 20 _SPI_CFG_POLARITY_IDLE_LOW | _SPI_CFG_SS_AUTO_DISABLE | 21 _SPI_CFG_FIFO_DISABLE, _SPI_SS_LINE_NONE ); 22 Delay_ms(200); 23 UART1_Write_Text( "SPI Initializedrn" ); 24 25 //Diff Pressure Click 26 diff_pressure_init(); 27 UART1_Write_Text( "Diff Pressure Click Initializedrn" ); 28 29 while (1) 30 { 31 status = diff_pressure_read_adc( &buffer ); //Read ADC 32 if ( status == OK ) 33 { 34 //Get Pressure Difference 35 difference = diff_pressure_get_kpa_difference( buffer ); 36 //Write it out 37 UART1_Write_Text( "KPA Difference: " ); 38 FloatToStr( difference, uart_text ); 39 UART1_Write_Text( uart_text ); 40 UART1_Write_Text( "rn" ); 41 buffer = 0; 42 } 43 else if ( status == OVH ) //Overflow High 44 UART1_Write_Text( "Overflow happenedrn" ); 45 else if ( status == OVL ) //Overflow Low 46 UART1_Write_Text( "Underflow happenedrn" ); 47 else //Data wasn't ready 48 UART1_Write_Text( "Not Readyrn" ); 49 50 } 51 52 }
Code examples that demonstrate the usage of Diff press click with MikroElektronika hardware, written for mikroC for ARM, AVR, dsPIC, PIC and PIC32 are available on Libstock