hc-05 AND BINARY DATA

can anyone tell me whether the bluetooth SPP can transmit bytes with the value 0h?

i am sending data between an arduino & a pc using an hc-05 on the arduino & the built-in BT on the pc. Everything seems to work so long as no byte is zero.

thanks in advance

moshejay:
can anyone tell me whether the bluetooth SPP can transmit bytes with the value 0h?

i am sending data between an arduino & a pc using an hc-05 on the arduino & the built-in BT on the pc.
Everything seems to work so long as no byte is zero.

thanks in advance

looks like the problem may be your code (PC or arduino), but we cannot help without seen either!

the thing is that when i used a direct connection from the arduino to the pc (ie a usb-rs232 adapter on the pc that is connected to a rs232 to ttl adapter on the arduino) everything worked perfectly.

So the only thing that has changed is the removal of the direct connection.

Whats a 'bluetooth SPP' ?

srnet: Whats a 'bluetooth SPP' ?

SPP: Serial Port Profile according to Dr. Google

actually i just connected 2 arduinos to each other using 2 hc-05s and the null byte was transmitted & received correctly...therefore the problem lies with my pc bluetooth stack!

moshejay: actually i just connected 2 arduinos to each other using 2 hc-05s and the null byte was transmitted & received correctly...therefore the problem lies with my pc bluetooth stack!

More likely, the problem is with the application that is receiving the data.

for anyone looking at this post...

the problem was indeed hardware. but it was not the pc hardware.

i was using another PCB that has a 3.3V MCU on it and THAT was the issue.

So although the HC-05 was powered with 5V, the Rx & Tx pins were powered at 3.2V which would appear is insufficient for the correct Tx or Rx of 'SOME' values.

eg Sending the bytes 0h, 5h, 9h from the board were received at the pc as 80h, 85h, 89h (but in a random manner). Conversely when sending the bytes 0h,5h,9h, from the pc they were received at the board as 80h, 85h, 89h.

Conclusion...use a 5V MCU with a HC-05 (or boost the voltages).

Conclusion...use a 5V MCU with a HC-05

Sounds rather like a case of not reading the instructions, and the issue is something else. HC-05 signal pins should be on 3.3v as clearly stated on the back of the board (usually), and specifically, the Rx pin should receive a 3.3v signal from Arduino. This is usually done with a 1k/2k voltage divider on the Arduino Tx line.

The real reason for using a 5v Arduino with HC-05 should be no more than ensuring there is an adequate power supply, i.e. from the 5v pin.

I don't know what your problem is but I'm pretty sure it isn't what you think it is. Clearly, the 3.2v signal you talk about is less than required, by 0.1v, but I wouldn't have thought that would cause this. Since you are getting something from Arduino to PC, it might be time to read reply #6 again.

i thought i discovered the cause of the problem...i thought it was due to the capacitance between the Rx & Tx traces and GND on the pcb i was using....but actually it isn't.

As far as i can ascertain, the problem lies with the interpretation of the start of the start bit. Whether the problem is at the transmission end or at the receiving end i cannot definitely say.

A test that i did was to take the HC-05 master mode module and connect it to the RS232-TTL adapter that in turn is connected to a USB-RS232 adapter....i then transmitted from my PCB to the laptop & everything was now received correctly. So that would indicate that there is an issue/incompatibility with the built-in bluetooth adapter of the laptop....but i dont think it is, because i then disconnected and reconnected the Tx wire & suddenly random bytes received again had their bit 8 set...hence my belief that it has something to do with the interpretation of the start of the start bit.