Help choosing a serial bluetooth device

Hi all!

I'm new here, I've had a look around and done some searching both on this forum, and google.

My problem is this:

I have a device I wish to interface with from my Arduino. I have done so successfully directly using a (adhoc) cable directly to my UNO TX/RX and works perfectly. Now the cabling had to be a bit of a botch job as the original cables for my device are no longer available (or priced way above my hobbyist pay packet :wink: ).

My best idea to resolve this is to use a Bluetooth rs232/UART/FTDI adapter which I see widely available on eBay and various electronics websites. I do not wish to modify the existing ports on my device as I do not wish to change/modify anything on a permanent basis (apart from a few wires soldered internally to attach the Bluetooth adapter.)

Here is what I need:

  1. Bluetooth serial adapter that can interface directly with UNO TX/RX which I believe is 5v TTL? Also the same reason for this as it is then fully compatible with my device without level shifters and additional circuitry as space is limited (ideally at the device end just the Bluetooth adapter nothing more)

  2. The device uses a separate "Command Line" which defaults High and pulled Low before Command data is sent then reverts to High. Most of the Bluetooth devices I have seen don't breakout any other (useable) pins other than VCC/GND/TX/RX (I'm using RI on my FTDI at present) . I have heard that you can trigger possibly the DTR line High or Low, but which of these boards support this I am unsure. (Also latency could be a problem when switching these pins as it may require AT mode enabled to do so and my device is time sensitive to replies possibly as low as 950usec )

-- note I could do away with the command line by using software to encode and send my data but this will require and extra piece of hardware i.e. an Arduino Nano maybe to decode the data and perform the operation locally at the device end, but again extra hardware.

  1. I have considered using an esp8266 or similar nut this adds extra hardware which I need to avoid. Also the use of Wi-Fi access points isn't an option as it needs to be portable to use anywhere without reconfiguration.

  2. I did want this device external as the Arduino Uno is too large to fit inside the device and even if it did fit , I need to access an SD Card and USB port for further updates etc. I do not wish wires poking through holes or modifying of the original device case. From what I Can see is an Arduino Nano may not be suitable as an SD card/serial/LCD display and possibly other additions, may be too many connections but It is possibly an option if I can port the code and the connections aren't an issue.

I do keep mentioning device rather than what it actually is, but right now what I am attempting is possibly the only one in existence (if it works) so for now I keep that to myself until its completed, which then it will be open source. The device works fine with 5v TTL signals so except for the Command line issue its pretty straight forward and doesn't need any further detail for the time being.

Sorry for the essay trying to be as detailed as possible for both A) what i NEED and B) what I WANT :slight_smile:

Any help or direction would be gratefully recieved.

High500:
Sorry for the essay trying to be as detailed as possible for both A) what i NEED and B) what I WANT :slight_smile:

None of which is particularly comprehensible, and not helped by the possibly of there being three categories
A) what you need B) what you want and C) what you think you need
Some notes
is then fully compatible with my device without level shifters and additional circuitry as space is limite probably not true and probably not as problem either. Bluetotoh moduels typically run on 5v but the signals are 3.3v, this is fixed by a couple of resistors.

Most of the Bluetooth devices I have seen don't breakout
True but, if the control signal is simple enough, it may be possible to use the State pin, which I understand is programmable in the HC-05. It is not programmable in the HC-06, and may not be in others.

an Arduino Nano may not be suitable
A Nano can do anything a Uno can, so can a Pro Mini, which is even smaller and likely more suitable as I understand you already have the 5v available to power it.

You might look at Sparkfun Mate, here is a link describing a few of the different modules they offer

learn.sparkfun.com/tutorials/using-the-bluesmirf?_ga=2.232591258.464481571.1535338887-1232910141.1531008858

Nick_Pyner:
None of which is particularly comprehensible, and not helped by the possibly of there being three categories
A) what you need B) what you want and C) what you think you need

I thought I was quite clear what I need and want but I will elaborate a little if its unclear.

I want to achieve my goal without damaging the case of my device or changing any ports etc.

I need simple wireless circuitry with as smaller size possible whilst keeping it compatible with the existing devices protocols.

What I "think" I want is not a factor as that's what my question is to help me with. There is a lot of information out there regarding such Bluetooth devices but none clearly state it will fulfil all my requirements, or I am misinterpreting the information incorrectly, or such devices need to change state to AT mode, as it were, which could compromise the communication speed between state changes.

Nick_Pyner:
Some notes
is then fully compatible with my device without level shifters and additional circuitry as space is limite probably not true and probably not as problem either. Bluetotoh moduels typically run on 5v but the signals are 3.3v, this is fixed by a couple of resistors.

Yeah from what I have seen some work from 3.3v some 5v. But the use of resistors to modify the Logic Levels I have not seen. I have always been under the impression a level shifter is required. If I am incorrect and resistors is all I require then that would make life easier. Thank you I will read up a little further.

Nick_Pyner:
Most of the Bluetooth devices I have seen don't breakout
True but, if the control signal is simple enough, it may be possible to use the State pin, which I understand is programmable in the HC-05. It is not programmable in the HC-06, and may not be in others.

I have considered a device such as the HC-05 but have not seen anyone using the state in such a way. The only information I have picked up on is that it reports the Bluetooth connection state (either High/Low) when connected or disconnected. I will dig up some datasheets and see if I can find out any more regarding programming the state independently. Ideally I would like it to work like a standard serial that just passes the High/Low signal without any extra commands etc. But its definitely worth a look.

Nick_Pyner:
an Arduino Nano may not be suitable
A Nano can do anything a Uno can, so can a Pro Mini, which is even smaller and likely more suitable as I understand you already have the 5v available to power it.

I was unsure about the Nano due to the lower power output of 20ma per pin if it would cause any issues with the LCD/SD Card reader etc , same with the use of the FTDI 232, is the code identical for the serial chip? is it 5v Logic Level? I need to get a Nano and experiment I think. I wasn't aware of the Pro Mini, again I will look into this a little more thanks for the heads up.

Thanks for the reply it has give me plenty to look into

Thanks for the Sparkfun link sumguy, I actually stumbled across these myself also just this morning.
They "Appear" to have a few more serial lines on the breakout CSR/DTR also bluefruit by adafruit. These are a little more expensive which isn't an issue except sourcing them in the UK looks like a no go so intl. shipping on top makes this a riskier move just to get a device only to find it wont actually do what I need. But sometimes I guess you have to take that risk.

I will start with the HC series of chips and look a little deeper as Nick has mentioned and work up from there.

Thanks guys I appreciate you taking the time to reply!

I don't think this is really an issue in normal practice, but Nano and Pro Mini say they are good for 40mA on the i/o pins. I believe this is down to them using the 328P. Standard Unos are 20mA, and I guess this because they use the other thing.

same with the use of the FTDI 232, is the code identical for the serial chip? is it 5v Logic Level?

This is pretty incoherent, perhaps you are talking about using an FTDI adapter to configure Bluetooth instead of an Arduino, in which case, an AT command is an AT command, irrespective of where it comes from. As far as Nano is concerned, the only operational difference from Uno is the plug on the end of the USB cable. A USB>TTL adapter is required for programming a Pro Mini.

If you have clean 5v available, and space is a problem, there clearly isn't much point in using a Nano.

or such devices need to change state to AT mode, as it were, which could compromise the communication speed between state changes.

This is incoherent nonsense - probably just more of what you think you want clouding the issue. IF you can get by with using the STATE pin, which is just a guess, you will may need to configure Bluetooth accordingly. Other than that, there is nothing to suggest you need to use AT mode for anything, and I'm betting you don't, indeed you may never need to.

Level shifter is just technobable clouding the issue - again. Voltage divider is what you see in real life, and is common, as well as good, practice. You only use it on Bluetooth Rx, and omitting this is not usually fatal anyway. Arduino is fine with a 3.3v signal.

The only information I have picked up on is that it reports the Bluetooth connection state (either High/Low) when connected or disconnected.

Correct, hence my comment. The implication here is that Arduino may be redundant.

40mA is pushing it for an output and can cause long term damage. How many times do we have to keep saying that?

Keep it to under 20mA to keep your part healthy.

Uno/Nano/Promini all use the same '328P, just different physical package, and all have the same limitations.

Thanks for the replies again. The reason I asked about the pin rating is I don't want to overload a Nano if I went that route, As I have limited knowledge about the inner workings of an Arduino device I wasn't sure if there was a chance the more "addons" I connect to the IO pins, would cause potential issues or damage.

@Nick_Pyner

As per the Nano/Arduino difference. That information came from the specs stating that the Nano uses a different serial interface chip than the Uno. Was just clarifying if there would be any differences to how I code for it.

The AT mode switch -- Incoherent nonsense? A bit harsh seems as it is perfectly clear I wish to trigger a high/low state on a pin within strict timing parameters. I have done some extensive looking around and haven't yet found anyway to trigger an external pin without changing the mode in which the Arduino talks to the HC series Bluetooth devices.

There are 2 modes, serial mode (which is what I need) and AT mode for configuring the device baud rate etc (which should be a one off once set).

All my research findings so far have told me that I need to switch to AT mode to trigger an IO pin state change. Doing so means a little extra code and time to switch, send the command then switch back. It may be a really short interval that will make no difference at all, but it MAY impact so I need to be sure before I can actually say "yep this is the device I need". So I don't believe this to be incoherent as its definitely a potential issue for me, unless of course the State pin can be used in a simple manner.

I am still looking for the information of the State pin usage, not found anything as yet, but right now my time is limited.

To be honest I think it may be a none starter anyway as I have hit another snag that may be the biggest issue of all.

My Device accesses the serial port instantaneously at boot. There is no "Standby" power. The bluetooth serial device will not boot until my device power is on. The short period my Device waits for the reply may be too short to wait for the Bluetooth connection negotiation. There is a reset button on my device so possibly i can just use that to reinitiate the serial port access as long as it dont cut power to the 5v line when pressed. My understanding its more a reinitilisation button than hard reset. I will have to test with my arduino driectly on the serial port and get some timings as I dont have that information in my Device datasheet for some reason.

Do appreciate all the responses thanks. Still have a lot to look into.

High500:
The reason I asked about the pin rating is I don't want to overload a Nano if I went that route, As I have limited knowledge about the inner workings of an Arduino device I wasn't sure if there was a chance the more "addons" I connect to the IO pins, would cause potential issues or damage.

Arduino's spec says, with great clarity, 20mA for i/o pins on Uno and 40mA for Nano. I guess the difference is down to the packaging. These are just for signals and proper practice is to have just a few mA on both. You are making something out of nothing and, if you want to control power, you use a relay or some solid state device. Any power for "add ons" comes from the 5v or 3.3v pins, also clearly marked.

As per the Nano/Arduino difference. That information came from the specs stating that the Nano uses a different serial interface chip than the Uno.

I wasn't aware of that, indeed I don't think it's true. It certainly isn't relevant. As far as I'm aware, the only difference with a Nano is the shape of the USB socket. Leonardo is different in that area but that only means the slightest change to serial commands.

The AT mode switch -- Incoherent nonsense?

That is exactly what it is, hence the comment.

I wish to trigger a high/low state on a pin within strict timing parameters. I have done some extensive looking around and haven't yet found anyway to trigger an external pin without changing the mode in which the Arduino talks to the HC series Bluetooth devices.

Also incoherent, but I bet it has nothing to do with AT commands

There are 2 modes, serial mode (which is what I need) and AT mode for configuring the device baud rate etc (which should be a one off once set).

Correct
I said previously that the State pin is programmable. I think this is incorrect.
http://www.martyncurrey.com/hc-05-fs-040-state-pin/
If you are still debating "yep this is the device I need", I submit you should conclude it isn't, but a standard HC-05 just might be.

Its not incoherent if you can understand what I mean. Why are you nit picking at certain information? I made it quite clear what I understand from my research how it appears these devices work. what I typed is correct and not incoherent, its correct according to my research and makes proper sense. You have to switch between 2 different modes to use A: pass through serial via Bluetooth, and B: Programmable mode using AT commands

Considering this is my first post here it seems very condescending to talk in such a manner when all i wanted was some input and guidance.

I will leave it at that and find my own way through more researching and testing.

I do appreciate the input you have given me but find it very rude stating information is incoherent when you clearly understood what i wanted, and you gave me no reason why it is incoherent in the slightest.

Thank you for taking the time to reply