HC-05 Bluetooth

Hi Guys,
Having problem with the HC-05 bluetooth module!

My two arduino uno are connected via the HC-05. The pairing has been done successfully using the AT commands.

Several sensors are connected to one of the arduino board (Slave system). Actual Sensor values needs to be displayed on an LCD connected to the other board.(master system). The codes used are as follows:

Master System code:

int LED =12;
int sensorReading;

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(0, 1); // RX, TX

#include “Wire.h” // For I2C
#include “LCD.h” // For LCD
#include “LiquidCrystal_I2C.h”
LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7);

void setup()
{

Serial.begin(9600);

while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

Serial.println(“Ready!”);

BTSerial.begin(9600);

pinMode(LED, OUTPUT);

lcd.begin (16,2); // 16 x 2 LCD module

lcd.setBacklightPin(3,POSITIVE);

lcd.setBacklight(HIGH);
}

void loop()
{

sensorReading = analogRead(A1)/4;

if (BTSerial.available())
{

sensorReading = BTSerial.read();
BTSerial.println(sensorReading);
}

if (Serial.available())
{
sensorReading = Serial.read();

Serial.println(sensorReading);

BTSerial.print(sensorReading, DEC);

lcd.print(“Moist =”);

lcd.print(sensorReading, DEC);

lcd.print(’\r’);

lcd.print(’\n’);
}

if (Serial.available()){

digitalWrite(LED,HIGH);

}

else {
digitalWrite(LED,LOW);
}

}

}
}

Slave System Code:
#include <SoftwareSerial.h>

SoftwareSerial BTSerial(0, 1); // RX, TX

void setup () {

Serial.begin(9600);

BTSerial.begin(9600);

}

void loop () {
{

sensorReading = analogRead(A1)/4;

if (BTSerial.available())
{

sensorReading = BTSerial.read();

Serial.write(sensorReading);
}

if (Serial.available())

Serial.println(sensorReading);

BTSerial.write(“sensorReading”);
}

}
}

SoftwareSerial BTSerial(0, 1); // RX, TX

You can NOT do SoftwareSerial on the hardware serial pins while doing hardware serial on those pins. Get over it.

How do i initialise the HC -05 module for the hardware?

How do i initialise the HC -05 module for the hardware?

I do not understand the question.

In the light of

Yudish: SoftwareSerial BTSerial(0, 1); // RX, TX

This

Yudish: The pairing has been done successfully using the AT commands.

Is doubtful. But if it is true, it means only that - they are paired, they can connect, but the only involvement of Arduino is to provide the power. There is no actual communication.

Choose the proper pins for software serial, presumably the ones you used for the configuration, OR get rid of the virtually redundant hardware serial command, leave bluetooth connected where it is, and use hardware serial to run it.