Jump to content


Photo

Bluetooth HC-05 - drop incoming TX voltage level?

JY-MCU Blueetooth voltage level arduino

  • Please log in to reply
7 replies to this topic

#1 RichC

RichC

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 June 2014 - 12:00 PM

Hi Guys,

Nathan, thanks for sending my 2 bluetooth HC-05 units so quickly!

 

Question:

I've seen posts where it is recommended to drop the incoming +5 VDC signal level to about +3.3 VDC to the HC-05's RX pin.

Then again, I've seen posts that say it's already taken care of on the breakout board between the pin and the BT unit with SMD resistors etc.

So, do we need to drop the voltage on the HC-05 modules that Foxytronics ship? - If so,  would probably use a voltage divider setup like below:

 

Thanks for your help.

 

Rich.

 

0J1423.600.png?ba900a2037e04a07928013504

 

 


  • 0

#2 Nathan House

Nathan House

    Administrator

  • Administrators
  • 122 posts
  • LocationLynchburg, VA

Posted 06 June 2014 - 12:52 PM

Hi Rich!

 

The Bluetooth module can be a little confusing because there are so many different versions of it (as well as because most of the documentation is poorly translated from Chinese), so there's a lot of conflicting information out there!

 

The RX&TX pins on the Bluetooth IC on the board have their max voltage specified as 3.3V, and 1.06 version of the board you purchased does not have a 5V-3.3V level shifter on board. So, technically, you should use a level shifter. Many people, either out of ignorance or because they like rolling the dice, have interfaced this version of the board directly with 5V and to my knowledge haven't experienced any problems, but it's possible at some point it could cause damage.

 

So, yes, with this version of the board, if you want to be 100% safe you should use a level shifter. A voltage divider as you have shown will probably work fine as long as you are operating at fairly slow serial speeds. If you find the signal is being distorted (such as if you have missing or wrong characters), try using lower resistor values such as 1k and 2k, which will allow the signal to change more quickly (using a resistor voltage divider introduces an RC filter, which will cause a little distortion of the signal).

 

There is also a version of the Bluetooth board that has a level shifter built-in. I actually just got some in stock and will be replacing the current version I'm selling with them soon.

 

I've been planning on writing a tutorial on using the Bluetooth module, so if you need any help getting it working let me know and I'll push it to the top of my to-do list! 


  • 0

#3 RichC

RichC

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 June 2014 - 05:28 PM

Hi Nathan,

 

Awesome information thank you!

I'll look into the level shifter option, rather than the voltage divider, because with the signal distortion potentially introducing artifacts into the messages, it will complicate an already complex project.

 

I just started trying out some Android development using the SDK for Eclipse to have my phone send messages to a ATMEGA running the Arduino environment & that was a bit of a learning curve, so anything that will help keep unexpected behavior out of the mix is very welcome!

 

My next step is to try two way comms, hence the HC-05's - it'll be cool to have the chip respond with data back to the phone. I think the AT command set up is a little more involved than with the HC-06 Linvor modules, but shouldn't be too hard with a bit of tinkering with CoolTerm.

 

Cheers!

 

Rich.


  • 0

#4 Nathan House

Nathan House

    Administrator

  • Administrators
  • 122 posts
  • LocationLynchburg, VA

Posted 06 June 2014 - 05:51 PM

I'll look into the level shifter option, rather than the voltage divider, because with the signal distortion potentially introducing artifacts into the messages, it will complicate an already complex project.

 

The voltage divider will probably work fine, as it's only at higher data rates that the distortion would become an issue. But, if you want to use a level shifter just to be sure, then this one would work well with the BT module:

 

https://www.foxytron...nverter-2-lines

 

If you want to buy one (or two) for your BT module(s), let me know and I'll give you a coupon for free shipping.

 

I just started trying out some Android development using the SDK for Eclipse to have my phone send messages to a ATMEGA running the Arduino environment & that was a bit of a learning curve, so anything that will help keep unexpected behavior out of the mix is very welcome!

 

OK, I'll try to get the tutorial done sometime this weekend!

 

My next step is to try two way comms, hence the HC-05's - it'll be cool to have the chip respond with data back to the phone. I think the AT command set up is a little more involved than with the HC-06 Linvor modules, but shouldn't be too hard with a bit of tinkering with CoolTerm.

 

These are HC-06 slave modules. The difference between the HC-06 and HC-05 modules is that the HC-05's can be configured as master (almost never needed) or slave via the AT commands, while the HC-06 comes preconfigured as master or slave from the factory and can't be changed.

 

I'll put the command set and links to the datasheets in the tutorial when I write it this weekend.


  • 0

#5 RichC

RichC

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 June 2014 - 07:58 PM

Hi Nathan.

 

Thanks for the offer of level shifters and free postage- I'll have a think about what I'm going to do as I made a little error:

 

These are HC-06 slave modules. The difference between the HC-06 and HC-05 modules is that the HC-05's can be configured as master (almost never needed) or slave via the AT commands, while the HC-06 comes preconfigured as master or slave from the factory and can't be changed.

 

 

I must have made a mistake and not read the product description carefully - I'd been specifically looking to buy HC-05 modules as I thought that these ones were the only ones that could send (via arduino code/sketch etc) back to the phone or Macbook etc. Maybe I confused this line on the ebay description?

and you can send and receive data wirelessly!

 

 

If so, not a problem, I'll use them at some point :)

Or is there a way to send a short string back from the arduino? - I mean it's already sending back acknowlegement bits. Please excuse my newbie status when using Bluetooth.

Another option is to flash new HC-05 firmware onto the CSR chip - it sounds fairly straight forward on here:

 

http://byron76.blogs...oth-module.html

 

One way or another, I'll figure it out!

 

Thanks,

 

Rich


  • 0

#6 Nathan House

Nathan House

    Administrator

  • Administrators
  • 122 posts
  • LocationLynchburg, VA

Posted 06 June 2014 - 09:54 PM

I think you got the module you need for your project.

 

There are two classes of Bluetooth devices: master and slave. A master device is something like a computer (with a Bluetooth card) or a cell phone, while a slave device is something like a mouse, keyboard, headset, or the slave version of the HC-06. In a Bluetooth network, there is only one master device, but there can be multiple slave devices. The master device handles communication and the slave device just does what the master tells it too. A master device is kind of like a USB hub, while a slave is kind of like a peripheral. There can be bidirectional communication, but the master device facilitates the communication.

 

If you are wanting to send data back and forth between an Arduino and computer or cell phone, then you want the slave version of the Bluetooth module. If you get the master version of the Bluetooth module, it will not be able to communicate with a computer or phone, because two master devices cannot communicate with one another.

 

So I'm pretty sure you got what you were wanting  :)

 

If it turns out you really do need the master version, you are of course welcome to return the modules you purchased!


  • 0

#7 RichC

RichC

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 06 June 2014 - 10:48 PM

Awesome! - thanks again for the info and clarifying the operation of these BT devices.

 

If I do need the master version, I'd still keep the HC-06's - it's great that you're willing to accept a return of these, but in this case, I think my misunderstanding is on me :)

 

I have these units working successfully to receive incoming data from Android, so I'll continue to work on having bi-directional communications with the HC-06, if not, hey, not the end of the world right! lol.

 

Have a good weekend.

 

Rich.


  • 0

#8 RichC

RichC

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 10 June 2014 - 09:31 AM

Hi Nathan,

 

An update on the two way capabilities of slave configured HC-06 modules.

 

Yes, I can confirm that these can & will send messages back in addition to the expected module's AT commands.

 

In Android's case:

Establishing the initial bluetooth connection from Android to the HC-06 is a little tricky since if the HC-06 is not powered up and blinking red, the Android app can crash even though the absence of an available device is handled in a number of try-catch statements, but once it is connected, setting Serial.begin to the correct Baud rate of the unit and writing Serial.println('xyz'); will send that string. For Android, a separate thread needs to be set up using an instance of Handler in the onCreate method which receives incoming bytes and appends them to a string. Each of the inoming bytes are checked for end of line chars ("\r\n") and if not EOL, appended to the msg string until EOL at which point, the msg gets written to Android's display.

 

Cheers,

 

Rich.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users