https://www.sparkfun.com/products/16476
https://www.mouser.com/datasheet/2/187/ … 073392.pdf
Hi guys,
I purchased over 50 of these sensors for a project, shipping was good as usual from SparkFun and arrived in their respective anti-static bags and the package was intact. This isn’t the first time that I have purchased this particular sensor from SparkFun and I have had a good experience using it.
For this particular shipment I noticed that some of the devices are not functioning as expected. During startup I query for the status and receive “1100100”. The 4th bit is ‘1’ indicating the sensor is busy and the 3rd bit is 1 indicating the integrity test failed. Unfortunately 27 out of the 80 sensors I ordered are reporting this issue :shock: . I have exhausted my search and I am not able to figure out what could possibly be happening outside of a fault with the batch.
I did away with my custom code and used the very basic example supplied by SparkFun:
/*
Basic test of the Qwiic MicroPressure Sensor
By: Alex Wende
SparkFun Electronics
Date: July 2020
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Feel like supporting our work? Buy a board from SparkFun!
https://www.sparkfun.com/products/16476
This example demonstrates how to get started with the Qwiic MicroPressure Sensor board, and read pressures in various units.
*/
// Include the SparkFun MicroPressure library.
// Click here to get the library: http://librarymanager/All#SparkFun_MicroPressure
#include<Wire.h>
#include <SparkFun_MicroPressure.h>
/*
* Initialize Constructor
* Optional parameters:
* - EOC_PIN: End Of Conversion (defualt: -1)
* - RST_PIN: Reset (defualt: -1)
* - MIN_PSI: Minimum Pressure (default: 0 PSI)
* - MAX_PSI: Maximum Pressure (default: 25 PSI)
*/
//SparkFun_MicroPressure mpr(EOC_PIN, RST_PIN, MIN_PSI, MAX_PSI);
SparkFun_MicroPressure mpr; // Use default values with reset and EOC pins unused
void setup() {
// Initalize UART, I2C bus, and connect to the micropressure sensor
Serial.begin(115200);
Wire.begin();
/* The micropressure sensor uses default settings with the address 0x18 using Wire.
The mircropressure sensor has a fixed I2C address, if another address is used it
can be defined here. If you need to use two micropressure sensors, and your
microcontroller has multiple I2C buses, these parameters can be changed here.
E.g. mpr.begin(ADDRESS, Wire1)
Will return true on success or false on failure to communicate. */
if(!mpr.begin())
{
Serial.println("Cannot connect to MicroPressure sensor.");
while(1);
}
}
void loop() {
/* The micropressure sensor outputs pressure readings in pounds per square inch (PSI).
Optionally, if you prefer pressure in another unit, the library can convert the
pressure reading to: pascals, kilopascals, bar, torr, inches of murcury, and
atmospheres.
*/
Serial.print("SENSOR STATUS: ");
Serial.println(mpr.readStatus(), BIN);
Serial.print(mpr.readPressure(),4);
Serial.println(" PSI");
Serial.print(mpr.readPressure(PA),1);
Serial.println(" Pa");
Serial.print(mpr.readPressure(KPA),4);
Serial.println(" kPa");
Serial.print(mpr.readPressure(TORR),3);
Serial.println(" torr");
Serial.print(mpr.readPressure(INHG),4);
Serial.println(" inHg");
Serial.print(mpr.readPressure(ATM),6);
Serial.println(" atm");
Serial.print(mpr.readPressure(BAR),6);
Serial.println(" bar");
Serial.println();
delay(1000);
}
I also did away with my custom circuit and connected the sensor directly to my RedBoard Artemis via the qwiic cable. The following is a snippet reported in the terminal:
17:59:39.806 -> SENSOR STATUS: 1100100
17:59:39.806 -> 316.9229 PSI
17:59:39.806 -> 2185001.2 Pa
17:59:39.806 -> 2185.1072 kPa
17:59:39.806 -> 16389.635 torr
17:59:39.806 -> 645.2614 inHg
17:59:39.806 -> 0.783079 atm
17:59:39.806 -> 21.851833 bar
17:59:39.806 ->
17:59:40.812 -> SENSOR STATUS: 1100100
17:59:40.812 -> 316.9229 PSI
17:59:40.846 -> 2185001.2 Pa
17:59:40.846 -> 2185.1072 kPa
17:59:40.846 -> 16389.635 torr
17:59:40.846 -> 645.2614 inHg
17:59:40.846 -> 0.774610 atm
17:59:40.846 -> 21.851833 bar
17:59:40.846 ->
17:59:41.860 -> SENSOR STATUS: 1100100
17:59:41.860 -> 316.9229 PSI
17:59:41.860 -> 2185001.2 Pa
17:59:41.860 -> 2185.1072 kPa
17:59:41.860 -> 16389.635 torr
17:59:41.860 -> 645.2614 inHg
17:59:41.860 -> 0.810174 atm
17:59:41.860 -> 21.851833 bar
The sensors are all open to the atmosphere during my tests and should be reading about 14psi. I am not sure what’s going on and I am in need of some help! Please assist geniuses of :ugeek: SparkFun!