How To Detect Bluetooth ID

I'm interested in building an Arduino + Bluetooth project where the Arduino would unlock a door when it detected the bluetooth ID from my phone. I'm not looking for an app running on the phone or anything. I'd want the Arduino to be listening for bluetooth devices and looking for the ID of my phone. When it detects my phone (iPhone 4S) it would trigger one of the outputs to turn on a relay to unlock a door. I've built a few Arduino projects, but I've never done anything with Bluetooth. Would this be hard to do? It would also be nice if I could detect the strength of the bluetooth signal so the Arduino would only keep the door unlocked if the signal strength above a certain level. I'd appreciate any suggestions on how to get started.

1 Like

Unless set to "Discoverable" Bluetooth hosts do not broadcast their presence.

Unlike some phones (coughBlackberrycough), the iPhone does not exist in Discoverable mode usually. It only becomes discoverable when you open the Bluetooth preferences. It is constantly listening for paired devices. However, since it doesn't support the serial profile, pairing with a serial-based Bluetooth device might be difficult.

Probably be better off running the arduino bluetooth in slave mode and having the phone detect it, connect, and send a (hopefully secure) password to unlock the door, or just leave the door unlocked - probably be about as secure :-).

i don't want to discourage you, but i've heard from several persons that the bluetooth from the iphone is blocked in a certain way z-so it can only communicate with other iphones and computers. So it should be possible, but i think it will be easier with a non-apple phone

If I put the Arduino bluetooth in slave mode and paired it to my iphone, would the iphone then automatically pair with the Arduino bluetooth when I was in range? If so, would I be able to use Arduino code to see what it was paired with my particular phone.

I've paired my iphone with bluetooth headsets and bluetooth speakers that were not made by Apple and never had a problem, so I don't see how the iphone bluetooth protocal could be restricted to other iphone or computers.

Steen:
i don't want to discourage you, but i've heard from several persons that the bluetooth from the iphone is blocked in a certain way z-so it can only communicate with other iphones and computers. So it should be possible, but i think it will be easier with a non-apple phone

You may be onto something with this iphone and bluetooth. I found this article on Make magazine website that says iphone's don't work with Arduino bluetooth modules, but the new Bluetooth 4.0 might.

Steen:
i don't want to discourage you, but i've heard from several persons that the bluetooth from the iphone is blocked in a certain way z-so it can only communicate with other iphones and

It's fun when I get to repeat myself.

  1. The iPhone doesnt stay in discoverable mode unless initiated by the settings screen.
  2. The iPhone doesn't support the serial profile, so your device won't automatically see your the phone when it is in range.

If you can use a Bluetooth device that supports the HID profile, you might have better luck...

I was hoping that since I'm not really trying to communicate or pair with the iphone (just detect and ID), some of these limitation may still let me get my project to work. But it sounds like I should wait for a Bluetooth 4.0 shield. Instead of using bluetooth to unlock the door, maybe I'll just use the thumbprint reader that Adafruit just came out with. I like the bluetooth project a lot. I think it would be really cool if a door unlocked as I approached. But I'm not going to switch phones just for this.

Weird. This new bluetooth 4 shield still looks and talks like a UART, but isn't using the RFCOMM profile? What profile does it use? (By the way, I think not all android phone talk RFCOMM either, but fortunately my Motorola does speak it).

This is very similar to a project I want to do. 3.5 years later, is it possible, now, to do this with BLE?
Mine isn't a door, so I don't care how secure it is. It's only a temporary thing, so I don't even mind making my phone discoverable if that makes it easier.

If you use a BLE module, you can talk to iPhone. All you need then is the iPhone app, or the ability to manipulate the iPhone, to do what you want. Even if the iphone can be configured to stay permanently discoverable, I'm not sure how that helps.

My first post here, so please be gentle with me!

This is a project that ranks high on my list.

I am currently using a Mega2560 as a boat monitor - fore and aft bilge pumps running continuously or too often, cabin humidity too high which means the dehumidifier isn't kicking on, temp too high, loss of shore power at the dock, generator or house battery banks not charging, 12V fridge power kicking off when we're not on shore power, automatically sending the wife texts via the GSM module with my location (NMEA from GPS)/speed(NMEA from GPS)/direction(NMEA from autopilot)/depth(NMEA from depthsounder)/anchored + amount of anchor out (windlass deployed down with rotation counter but not up yet)/Autopilot on or not (NMEA from autopilot) every 15 minutes when I'm offshore fishing through the NMEA network on the boat (HUGE WAF (wife acceptance factor) - she doesn't question the cash I spend on gizmos now), etc etc etc.

I would like to have the system detect:
No 110v (I killed the shore power and I'm heading out) - easy, already do this with a cheap 110VAC>5VDC Walmart and an optoisolator.
My GPS position changes so that the boat is no longer in the marina - easy, already do this by reading stream from NMEA network and signaling when the current location deviates more than 1/4 mile from the marina.
My phone isn't on board (it's not sensed via Bluetooth) - this is the long pole in the tent.

Then it can pop up a warning on my MFD display to tell me that I'm in moron mode and to go back in and grab my phone before the wifely sort cancels my day of fishing.

I do something very similar to this with my home automation using RFID sensors. If my car leaves the garage (the RFID tag in the car drops out) but the RFID tag in my wallet does not, then text me to tell me to return home and grab my wallet.

I only want the BT module to SEE my phone (discoverable all the time), no need to pair. Is this possible with the current libraries, and more importantly, has anyone done something similar so I can blatantly plagiarize all of the hard work you've already done?

Thanks in advance!
//j