Iphone Bluetooth Control Arduino

54,394

101

31

Introduction: Iphone Bluetooth Control Arduino

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: 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 :)

Be the First to Share

    Recommendations

    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    31 Discussions

    0
    demorgansucks
    demorgansucks

    6 months ago

    Hey my ios app is not discovering HM10... How and why?

    0
    demorgansucks
    demorgansucks

    6 months ago

    Arduino: 1.8.9 (Mac OS X), Board: "Arduino Nano, ATmega328P"
    Sketch uses 3600 bytes (11%) of program storage space. Maximum is 30720 bytes.
    Global variables use 210 bytes (10%) of dynamic memory, leaving 1838 bytes for local variables. Maximum is 2048 bytes.
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
    Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    0
    demorgansucks
    demorgansucks

    Reply 6 months ago

    I figured out now... I need to use an older bootloader

    Screen Shot 2019-10-02 at 12.51.01 AM.png
    0
    seungmin lee
    seungmin lee

    3 years ago

    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

    0
    demorgansucks
    demorgansucks

    Reply 6 months ago

    Maybe it's too late, but here you go:

    int ledPin = 13;
    String readString;
    void setup() {
    Serial.begin(9600);
    pinMode(ledPin, OUTPUT);
    }
    void loop() {
    while (Serial.available()) {
    delay(3);
    char c = Serial.read();
    readString += c;
    }
    if (readString.length() >0) {
    Serial.println(readString);
    if (readString == "on")
    {
    digitalWrite(ledPin, HIGH);
    }
    if (readString == "off")
    {
    digitalWrite(ledPin, LOW);
    }
    readString="";
    }
    }

    0
    LeongJ6
    LeongJ6

    2 years ago

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

    0
    MinjiN1
    MinjiN1

    Reply 2 years ago

    yes

    0
    MinjiN1
    MinjiN1

    Reply 2 years ago

    yes

    0
    majorhunting
    majorhunting

    3 years ago

    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

    0
    tanveer mahmood
    tanveer mahmood

    3 years ago

    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

    0
    planetleak
    planetleak

    Reply 3 years ago

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

    0
    licheong
    licheong

    3 years ago

    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?

    0
    planetleak
    planetleak

    Reply 3 years ago

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

    0
    licheong
    licheong

    Reply 3 years ago

    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.

    0
    villacu
    villacu

    3 years ago

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

    0
    planetleak
    planetleak

    Reply 3 years ago

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

    0
    villacu
    villacu

    Reply 3 years ago

    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!

    0
    licheong
    licheong

    Reply 3 years ago

    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.

    0
    ShivaganeshguptaS
    ShivaganeshguptaS

    3 years ago

    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.

    0
    licheong
    licheong

    Reply 3 years ago

    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