Hi, I am trying to to collect temperature/humidity with sensor DHT22 and visualize data via Bluetooth (module HC-05).
I am using Bluetooth Terminal HC-05. Correctly paired the module. I can see "Connected" to HC-05 but no data displayed. I can visualize data from Serial Monitor in IDE but data do not seem to be sent to the Module. The wiring looks good. What could be the cause of the issue? I can share my code/wiring if needed.
Thanks in advance for your help
Welcome to the forum
Do you think it might help if you posted your sketch and a schematic of your project ?
Which Arduino are you using ? Are you by any chance using pins 0 and 1 of a Uno or Nano to communicate with the HC-05 ?
Hi,
Find here my wiring diagram as well as my code. Hope it is clear. Note i am a beginner in programming and electronics.
I am using ATmega328p and i am not using pins 0 et 1.
#include <SoftwareSerial.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT22
SoftwareSerial BTserial(10, 11); // RX, TX
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
BTserial.begin(9600);
dht.begin();
}
void loop() {
delay(2000);
float temp = dht.readTemperature();
float hum = dht.readHumidity();
Serial.print("Température : ");
Serial.print(temp);
Serial.print("°C - Humidité : ");
Serial.print(hum);
Serial.println("%");
BTserial.print("Température : ");
BTserial.print(temp);
BTserial.print("°C - Humidité : ");
BTserial.print(hum);
BTserial.println("%");
}
I put together a circuit with an Uno, a HC05 and a DHT22. I do not seem to have the DHT library that you used so the code for the DHT was changed to a library that I do have. The code for the HC05 was unchanged. When I run the code, the temperature and humidity values are transmitted to my tablet running the Bluetooth serial terminal app. The Bluetooth portion works fine.
Your schematic does not show how the HC05 is wired very well. It show RX and TX going to Vcc and ground. This may be a case where a hand drawn, photographed and posted schematic would be more clear.
The input pins in the HC05 are not 5V tolerant. Having the Uno TX go straight to the HC05 RX may "work" but it is treating that input out of spec. It is recommended that a voltage divider be used to drop the Uno 5V to 3.3V for the HC05 input. )Pictured is a Nano, but the pins are the same.
Lots of good information in these Martyn Currie pages >> Arduino With HC-05 Bluetooth Module in Slave Mode | Martyn Currey
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.