I'm currently trying to pair BT HC-05 and this app to show mq131 data. I ve tried a test with another sensor, DHT11, and it worked:
#include <DHT.h>
#define DHTPIN 2 // Pin connected to the DHT sensor
#define DHTTYPE DHT11 // Type of the DHT sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial3.begin(9600); // Initialize Serial3 with a baud rate of 9600
dht.begin();
}
void loop() {
delay(2000);
float h = dht.readHumidity(); // Read humidity
float t = dht.readTemperature(); // Read temperature in Celsius
float f = dht.readTemperature(true); // Read temperature in Fahrenheit
// Check if any reads failed
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Print readings to the Serial3 connection
Serial3.print(h);
Serial3.print(",");
Serial3.print(t);
Serial3.print(" C,");
Serial3.print(f);
Serial3.print(" F;");
delay(2000); // Adjust delay according to your needs
}
!
But when it comes to mq131, i got no results:
#include <MQ131.h>
void setup() {
Serial3.begin(9600); // Initialize Serial3 with a baud rate of 9600
MQ131.begin(2,A1, LOW_CONCENTRATION, 1000000);
MQ131.calibrate();
}
void loop() {
delay(2000);
MQ131.sample();
MQ131.getO3(PPM);
MQ131.getO3(PPB);
MQ131.getO3(MG_M3);
float mq131 = MQ131.getO3(UG_M3);
Serial3.print(mq131);
Serial3.print(",");
Serial3.print("ug/m3");
Serial3.print(";");
delay(2000); // Adjust delay according to your needs
}
But there's no shown data on the app.
What could have gone wrong?