Hi!
I'm trying to connect HC-06(Bluetooth) with PMS 7003(Fine dust sensor).
Measure fine dust data by using PMS 7003 and I want to send this data to another computer by Bluetooth(HC-06).
So, i already connect HC-06 with another computer. I receive manually entered texts. But fine dust data is not displayed in the correct way.
Below is the code what i use
#include <SoftwareSerial.h>
#include <PMS.h>
#define BT_RX 11
#define BT_TX 10
SoftwareSerial nockanda(2,3); //tx=2, rx=3
SoftwareSerial btSerial(BT_RX, BT_TX);
PMS pms(nockanda);
PMS::DATA data;
void setup() {
Serial.begin(115200);
nockanda.begin(9600);
btSerial.begin(115200);
}
void loop() {
if (pms.read(data))
{
Serial.print("PM 1.0 : ");
Serial.println(data.PM_AE_UG_1_0);
Serial.print("PM 2.5 : ");
Serial.println(data.PM_AE_UG_2_5);
Serial.print("PM 10.0 : ");
Serial.println(data.PM_AE_UG_10_0);
Serial.println();
}
if (Serial.available()) { // From Serial monitor to Bluetooth
btSerial.write(Serial.read());
}
if (btSerial.available()) { // From Bluetooth to Serial monitor
Serial.write(btSerial.read());
}
}
Below is error message
Below images are my real connection.