Hi Team,
https://www.mouser.in/datasheet/2/764/LP1420_Series-768805.pdf
Please kindly help me with sample code reading above sensor data with Arduino MEGA 2560.
Hi Team,
https://www.mouser.in/datasheet/2/764/LP1420_Series-768805.pdf
Please kindly help me with sample code reading above sensor data with Arduino MEGA 2560.
To operate he pressure sensor over I2C Bus of the MEGA, we need to know the 7-bit (called slaveAddress) address of the sensor which is not found in the data sheets. Please, consult the Manufacturer, collect the address of the device, the address(es) of the internal registers(s), and the full data sheet. Also ask if the Pressure Counts that are coming from the sensor are natural binary (every bit carries positive positional value).
The following is the structure of the codes to be executed to read pressure counts from the sensor.
#include<Wire.h>
#define slaveAddress 0xnn
#define regAddress [s]o[/s]0xmm
byte busStatus;
void setup()
{
Serial.begin(9600);
Wire.begin(); //default bit rate = 100kbit/s
//----
{
Wire.beginTransmission(slaveAddress);
Wire.write(regAddress);
busStatus = Wire.endTransmission();
}
if(busStatus != 0x00)
{
Serial.println("No Communication with Sensor...!")
while(1); //wait for ever
}
//-----------------
//-----------------
}
void loop()
{
}
Hi GolamMostafa,
Thanks a lot for the help, really appreciated.
As from the below attachment, I could see I2c address 0x38.
I2c address will not be a slave address?
What is this address #define regAddress oxmm ??
Please help me.
You are right -- 0x38 is the slaveAddress which I carelessly missed from the brief data sheet. The data coming from the sensor is 14-bit; therefore. there must be at least two pressure registers inside the sensor to hold this data. We need to know the addresses of these registers. #define regAddress 0xmm has equated the address of the internal pressure register (higher byte) into 0xmm (0xmm is a value within 0x00 - 0xFF).