I am trying to program a HC-06 Bluetooth module to send data from a pH sensor connected to an Arduino Uno to the serial monitor on my laptop. The code for the pH sensor alone works perfectly and I was able to connect my HC-06 module to my computer and I have the COM port for it set up in the Arduino IDE. This is my first time using a bluetooth module in an Arduino project.
What do I add to my code in order for the data to be sent to the serial monitor via the Bluetooth module?
#include <DFRobot_PH.h>
#include <EEPROM.h>
#define PH_PIN A1
float voltage,phValue,temperature = 25;
DFRobot_PH ph;
void setup()
{
Serial.begin(115200);
ph.begin();
}
void loop()
{
static unsigned long timepoint = millis();
if(millis()-timepoint>1000U){ //time interval: 1s
timepoint = millis();
//temperature = readTemperature(); // read your temperature sensor to execute temperature compensation
voltage = analogRead(PH_PIN)/1024.0*5000; // read the voltage
phValue = ph.readPH(voltage, temperature); // convert voltage to pH with temperature compensation
//Serial.print("temperature:");
//Serial.print(temperature,1);
Serial.print("pH:");
Serial.println((phValue*-0.816226171)+ 10.34788768,2); //using linear regression to compensate for calibration
}
ph.calibration(voltage,temperature); // calibration process by Serial CMD
}