HM-10 Bluetooth device never displays results in serial monitor

Hi everyone,

I am using the Arduino Mega 2560 and have connected it to an HM-10 bluetooth device.

I am experiencing strange / unpredictable results and was wondering whether anyone can offer advice.

The HM-10 I have operates at 3.3v, so I have built a 3.3v to 5v converter using 2n7000 mosfets and 10k ohm resisters.

Measuring via my oscilloscope, I can see the voltages are good.

I can connect to the HM-10 via my phone - I can send text via the LightBlue app to the HM-10 and see the tx channel respond via my oscilloscope. Yet I never see anything in the serial monitor.

If I send commands - again, I never see results in the serial monitor.

I am using Mac OS Sierra.

Occasionally, I see the Bluetooth device change it's name - act as expected in terms of changing settings it has received. It seems though that this is a 1 in a 50 case... I have two HM-10's - both behave exactly the same.

Any thoughts please?

Ok - so I finally found a solution.

I found an instructable referenced on another post by someone suffering with the same issue on an HM-05.

I've switched to using pins 10 and 11 for rx and tx respectively.

I guess this falls in line with the fact I'm using softwareSerial?

My question now, is why aren't pins 15 and 14 working? Any advice would be welcome :)

if i am connected to the phone with an app, i can see the outputs on the serial monitor, but i can't process any at commands.

as soon as i disconnect from the phone, i can process at commands.

not sure on the pin numbers, but mine on the mini only works on pins 2,3 and not the uno pins 7,8, although the pins are the same spec wise... :-?

Than you for your response Kelvin.

I don't seem to see any difference, no matter what I try. The name is stuck on a test name from this afternoon. Even when disconnected from my phone, I see no responses from the device - and none are registered on the oscilloscope either. Yet, if I were to send data from the phone, I see that on the oscilloscope.

So on that basis, I know it's connected...

I've read that the HM-10 acts as a pass through and that there are versions with bugs in... I'm starting to think maybe I have a buggy version...

The HM-10 I have operates at 3.3v, so I have built a 3.3v to 5v converter using 2n7000 mosfets and 10k ohm resisters.

Not sure why you bothered doing this, the Mega has a 3.3v supply on board - just the thing for times like this, and rather prompts to question the need for 3.3v anyway. For, while the HM-10 is a 3.3v device, it usually comes on a breakout board which will work at 5v.

I don't seem to see any difference, no matter what I try. The name is stuck on a test name from this afternoon. Yet, if I were to send data from the phone, I see that on the oscilloscope. So on that basis, I know it's connected...

No you don't. All you know is that the power is on and that means is that it will connect to your phone, indeed you will be hard put to prevent that, but it has nothing to do with Arduino. I submit it is time to put the oscilloscope down at the back of the bottom drawer where it belongs, and consider your code, which is conspicuously absent but, in the light of comments like:

I guess this falls in line with the fact I'm using softwareSerial?

it seems likely that that is where your problems lie. I rather think it is just as likely the problem is due to improper wiring between Arduino and bluetooth - Tx>Rx and Rx>Tx

You might find the following background notes useful http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino

Nick, thank you for your response.

I am aware the Mega supplies 3.3v. However, there were clear instructions supplied with my bluetooth board, that it's data lines are 3.3v. Hence I made the converter.

Actually, I did know it was connected. The app I used displayed data received by the bluetooth device from the Mega. If I sent data from my phone, I could see the same values on the oscilloscope. On the 3.3v side, the values were present at 3.3v, on the 5v side, the values matched and could be converted back from binary to ascii values I had sent. It's been a while, but I still know how to use an oscilloscope. As the 5v side connected directly to the Mega, I knew the values were getting that far. Why they were not being processed on the lines 0 and 1 (rx and tx), I do not understand. Why I had to switch to different non tx lines, I don't understand. An area I need to learn more about the Mega and it's capabilities.

The source code was originally example code, modified to suite what I was attempting. Other than setting the baud rate to 9600 and matching the rx tx lines, there was very little I needed to change.

I tried for over a day before writing on the forums. I had tried the obvious such as switching the Rx and Tx, the difference was as expected - with the lines the incorrect way round, the results were worse.

I have since found out that the board I have is a cheap clone and temperamental. Refusing to change it's name is commonly experienced and I've moved on from that as it's working how I need it to. Since switching to pins 10 and 11, it is working, I am sending data between two arduino's with two bluetooth devices and for now, that is good enough.

Thank you for the link, it's a good read.