Introduction: Iphone Bluetooth Control Arduino

Picture of Iphone Bluetooth Control Arduino

Step 1: How-To

Picture of How-To

Components:

- Arduino (im used nano)

- HM-10 BLE module

- Iphone 4S or later, and Ipad with BLE (maybe from the "air"?)

- LightBlue app from App Store (Free)

Wiring:

Its similar as other bluetooth modules (HC-05/06) See image if not clear.

Arduino RX to Bluetooth TX

Arduino TX to Bluetooth RX

Bluetooth GND to Arduino GND

Bluetooth VCC to Arduino 3v3 (if basic BLE module without power shield)

If you connect the BLE module to the arduino, and using long time, then place 1K resistor between the

Arduino TX and BLE RX pin, and 2K resistor from between 1K and the GND.

IOS app:

The LightBlue app, very easy use.

After connected to the BLE module, change the "HEX" in the top right corner to "STRING"

Then can send any character or word to the arduino.

With the "Write new value" button can add the strings, what you want to send to the arduino.

If you create a new string, th app send it to the arduino immediately.

Turn on the "listen for notifications", then you can see the data from the arduino side too.

Watch the video for more details.

EDIT: Arduino code download link in video description.

Happy controlling :)

Comments

LeongJ6 (author)2017-09-11

Hi, I am new to the arduino stuff. One quick qs, is it ok to use arduino uno for this project?

majorhunting (author)2017-02-07

Will the HM-10 and HM-11 work on both android and ios? I am working on something that will require access from and android and ios devices

tanveer mahmood (author)2016-10-29

I was using samsung s6 for year and now i have iphone 7 but the problem in with ios is HC-06 is not working so please help me that and i made a home door lock through bluetooth,rfid,fingerprint and voice activation. which bluetooth module do i use HC-06 or HM-10

HC-05/06 are non BLE modules. For iphone, use HM-10 or HM-11.

licheong (author)2016-07-15

Hi, I'm using HC-08, which is probably a clone of HM-10 according to internet.
My iphone detected it with Lightblue, but it doesn't show up on the bluetooth device list on my Macbook. Does Macbook (pro retina, Yosemite) support Bluetooth LE device too?

planetleak (author)licheong2016-07-15

H, sorry, don't know, i have no Mac device.

licheong (author)licheong2016-07-15

And I wonder if it is possible to send UART messages to the module? I've tried sending messages like AT, AT+RX and it doesn't reply at all.

villacu (author)2016-04-26

Would it work if I use an HC-06 instead of the hm 10???? Thanks ;)

planetleak (author)villacu2016-04-26

Nope. HC-06 is not BLE (4.0) module. With iphone, need to use HM-10 or HM-11 or other BLE module.

villacu (author)planetleak2016-04-27

Ok so is there any way to use the HC-06 with an iOS device?? or do i have to get the HM-10?

Again, thank you very much!

licheong (author)villacu2016-07-15

1. Get a HC-08, which is a BLE module.
2. A workaround is using Macbook to connect with your HC-06, and then connect your iOS device with Macbook via wifi. e.g. You can send keystroke or MIDI message by an app called TouchOSC to Macbook, and on the Macbook you can use CoolTerm or other software to establish serial connection with HC-06. I've tried that before. It kind of works but a bit too complicated.

ShivaganeshguptaS (author)2016-07-07

can you please tell me the code for ios app i want develope the app. can u please send me code to my mail id gupta.sunkari@gmail.com

thank you.

waiting for reply.

The link of the code is here. I wonder why he has put it in the youtube description but not here:
https://drive.google.com/file/d/0B6GR9Hj5Ut61NzN5UEhQbGxVUkU/view

seungmin lee (author)2016-05-09

HI, I couldn't open the file in youtube description. is there somebody copy and paste the code in here? or please send it to my email. Thanks!!

addjake@gmail.com

KDLaun (author)2015-01-02

I got this working yesterday, thanks for sharing!

Since the connections on the HM-10 are pretty fine, I ended up mounting it on a small piece of perfboard so I could break out the pins and add the voltage divider resistors for the TX/RX line. One thing to note: disconnect pin 0 when you are uploading a sketch to Arduino to avoid an avrdude error.

jimiredwing (author)KDLaun2015-02-22

Thanks for posting this. I have a question about how you are wiring the resistors. I get the 1k between BLE Rx and Arduino Tx, but where exactly does the 2k go?

FYI for others trying this, I have it working well with no resistors, but after an hour or so it starts to draw way too much current (100 mA) which leads to my arduino voltage regulator burning up.

Thanks for any help on this!

KDLaun (author)jimiredwing2015-03-01

Hi jimredwing,

The 2K resistor should go between the RX/TX connection and ground. You are essentially trying to get 5.0v down to 3.3v using a voltage divider. I just randomly searched online and came up with this calculator that illustrates it pretty well.

https://www.abelectronics.co.uk/tools/resistor-voltage-divider.aspx

If you put 5v in the input, 1000 ohms for R1 and 2000 ohms for R2, you will see that the calculated result is 3.3v. In my case, I didn't have a 2K resistor, so I just used two 10K resistors in series in place of R2. Hope that helps.

planetleak (author)KDLaun2015-01-02

Yes better with board.

Forgot write yet, to remove module when upload the code if using RX/TX pins.

With softwareserial, you can stay connected when uploading the code.

jimiredwing (author)2015-02-23

Thanks for posting this. I have a question about how you are wiring the resistors. I get the 1k between BLE Rx and Arduino Tx, but where exactly does the 2k go?

FYI for others trying this, I have it working well with no resistors, but after an hour or so it starts to draw way too much current (100 mA) which leads to my arduino voltage regulator burning up.

Thanks for any help on this!

planetleak (author)jimiredwing2015-02-23

Hi, htere an example to the resistor voltage divider:

https://cdn.instructables.com/FSK/AI30/HMMFE6UO/FSK...

Im using my modules without voltage divider too, but, have chance to damage the bluetooth because the arduino Tx pin work with 5v, HC-05/06 Rx pin work with 3v.

You mean the arduino draw much current, or the Bt?

jimiredwing (author)2014-12-08

This totally works! I used a 3v mini pro. I understand the HM-10 is very sensitive to input voltage so check that your RX/TX and VCC are all 3V.

planetleak (author)jimiredwing2014-12-29

Yes, in the final project, use voltage divider on rx/tx pin.

omani77 (author)2014-12-01

Nice project sir but where the code ??

planetleak (author)omani772014-12-01

Sorry, forgot to write.

Arduino code in video description.

ibenkos (author)2014-11-25

Smart idea! Thanks for shearing :)