Go Down

Topic: Bluetooth sending funny characters (Read 1 time) previous topic - next topic

iliyaniliev57

Hi,

i am making a weatherstation and it's suppoused to measure temperature, pressure and humidity. The measurements work fine and when i am getting them on the serial monitor with cable it also works fine. When i try to recieve the infos from a HC-06 bluetooth module all i get are some strange symbols. Can anyone help me rewrite the code or do something so the weatherstation funktions with the bluetooth like it should be.

groundFungus

#1
Jun 11, 2017, 04:34 pm Last Edit: Jun 11, 2017, 04:35 pm by groundFungus
In order to help with a coding problem we kind of need to see the code.  Are you sure that it is not a hardware problem (mismatched baud rates, for instance)?  Please post the data before and after being sent so that we can see what is happening.

Please read the "how to use the forum" Stickies to see how to format and post code.  And some hints on how to ask an effective question.

iliyaniliev57

Here is the code:

#include <Wire.h>
#include <dht.h>
#define dht_apin A3
#define lightPin A1
int brightness;
dht DHT;
void setup() {
  Serial.begin(9600);
  brightness = 0;
}
void loop() {
  DHT.read11(dht_apin);
  brightness = analogRead(lightPin);
  Serial.print("| Temperature: ");
  Serial.print(DHT.temperature);
  Serial.print(" C");
  Serial.print("     ");
  Serial.print("Humidity: ");
  Serial.print(DHT.humidity);
  Serial.print(" % ");
  Serial.print("     ");
  Serial.print("Brightness: ");
  Serial.print(brightness);
  Serial.println("  |");
  delay(5000);
}


The bluetooth is hooked up properly, i tried changing the baud rate, but it doesn't work with several values.

groundFungus

Please read the "how to use the forum" Stickies to see how to format and post code.  And some hints on how to ask an effective question.

Please provide a block diagram or schematic of how your project is wired.  Which Arduino are you using?  Is the hardware serial (pins 0 and 1) connected to the bluetooth device and serial monitor at the same time?

iliyaniliev57

Hallo. I am making a small weatherstation project based on Arduino Uno. I have the following problem:

Using the cable everything is ok - the information is sent via Serial Port and everything works fine.




When i hook up the HC-06 Bluetooth module it starts to send some funny characters to the Serial port or nothing at all. With my new PC there are 3 Serial Ports available after connecting the HC-06 to the PC Bluetooth and none of them recieves information from the Arduino. I've been told to change the baud rate and try again but it doesent work also.

I am asking for advice now - how can i  solve the problem and get the weatherstation working with the Bluetooth module?

Power_Broker

When i hook up the HC-06 Bluetooth module it starts to send some funny characters to the Serial port or nothing at all.
That is a baud issue.


Can you post your code and a schematic of your setup?
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

TomGeorge

Hi,
Is this related to this thread?

https://forum.arduino.cc/index.php?topic=483101.msg3297307#msg3297307


Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

iliyaniliev57




This is the schematic. I think it is right wired. Up in the topic is the code. I really don't know where the problem is.

TomGeorge

Hi,
Please read http://forum.arduino.cc/index.php/topic,148850.0.html

Attach your schematic as a jpg, png or pdf file.

Thanks.. Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up