Unlock my car dors using an Arduino BT

Hello

As a school project I want to have my Arduino BT installed inside the car. Then I want to have my bluetooth enabled cell phone in my pocket. When the cell phone is in range of the car, I want an output of the arduino to be "high" (car unlocked).
When I (and the cell phone) leave the car, I want an output of the Arduino to be "low" (car locked).

The perfect solution would be that i do NOT need to use any software on the cell phone except having bluetooth enabled. If I do need to program a cell phone to be able to do this, I would be grateful with some inputs of how to program the arduino to do this =)

Thanks mates =)

On your phone, you can probably choose it to "auto-pair" with certain devices.
First you must pair the arduino and phone, and then, when phone is in range w/ bluetooth on, arduino and phone connect and unlock. I'm not sure, though, how to auto-pair w/ arduino.

EDIT: passcode should be "12345", and after you pair, devices SHOULD autoconnect. Tell us how it works.

How are you unlocking the doors from there?

yes, the auto pairing is not the problem. All phones I've used are auto-connecting to a pre-paired bluetooth-thing.

But I'm wondering how I can get an output when there are a paired connection between the phone and the arduino =)

You would need to determine if your phone's OS has support for the serial port profile. Otherwise, it may not be possible to pair it with the Arduino BT.

Why not? How about just having the doors unlock on a device pair, lock on an unpair. No data transfer necessary.

Because if the phone's OS doesn't support the Serial Profile, it probably won't have a way to pair with a serial port BT device.

I will test to pair my non-smart Sony Ericsson tomorrow, and see if it can be paired. If not, I'll need to use the back-up solution and use android.

Thanks for the help so far :smiley:

edit: baum: I did not understand anything of your post :stuck_out_tongue: "unlock on a device pair"? "lock on an unpair"?
Could you please explain?

Okay, I think I just hit the wall. Well, when I'm using my Samsung Galaxy with android and "Amarino - Android application", I'm able to connect to the Arduino BT. I don't yet know how I can add the "MeetAndroid - Arduino Library" to this program. Anyone?

But anyway... I tried to connect to the Android BT with my old Sony Ericsson phone. I searched for bluetooth-units and detected the ARDUINOBT. Then I wrote the pin 12345.

The Arduino is now paired, but it is not connected. I see in the list of "My devices" that I can select "Services" for the "Arduinobt". The screen that appears is:

Service supported:
No local services found

If God is with me, this means that I CAN connect my old Sony Ericsson to the Arduino, but since there's no programs on the Arduino, the cell phone does not know how to communicate with it.

Is there any hope in the sea?

Sounds like you could get it to work.

On a side note they make a BT device that does this already. You can search for it on mp3car.com. A few people over there use it.

Shush! Don't let my teacher know that it exists :stuck_out_tongue: Do you have a link so I can read about it? There's so many different ways to search for it. Could not find it specific.

But yeah, I would get nothing out of copying a finished product. Part of the point is that I want to learn more about Arduino =)

Does anyone knows what I need to do to the Arduino to have it communicating with the phone? =)

LOL.... well if you are going to have the phone talk you need a program on the phone to talk to the arduino via serial. If you have a android phone there are some things you can do. For Iphone you can use touchosc, but not sure if that does bt or just Wifi. Mabye you can have the Arduino ask BT if its paired or not. Check the commands that can be sent to the BT module. Which one are yo using?

Yes, it would be much better to have the arduino to ask the phone, than having the phone to ask the arduino.

The plan is that if the battery on the phone dies and the car is locked, I can borrow another phone, pair it and then open the car. It would be "too much work" to install the program on the phone I borrows every time the phone looses the battery. But using an android would be a much better solution than nothing.

Mabye you can have the Arduino ask BT if its paired or not.

Well, technically the phone could be a mile away and still paired. I guess you mean "connected".
I have no problems to have the phone paired, the problem is to connect the phone to the arduino, maybe because there is nothing to connect to because ther is no program on the arduino?

Check the commands that can be sent to the BT module.

What BT module? The one on the arduino or the one on the phone?
How do I check this?

Which one are yo using?

Phone: Sony ericsson W995 and Samsung galaxy android
Android: Android BT (the arduino with integrated bluetooth)

r2d290:
Yes, it would be much better to have the arduino to ask the phone, than having the phone to ask the arduino.

The plan is that if the battery on the phone dies and the car is locked, I can borrow another phone, pair it and then open the car. It would be "too much work" to install the program on the phone I borrows every time the phone looses the battery. But using an android would be a much better solution than nothing.

You could have 2 modes one for door locks without a program and another with a app that can control other aspects of the car. Windows/ignition/lights/etc

You could do a lot once you get the framework going.

Mabye you can have the Arduino ask BT if its paired or not.
Well, technically the phone could be a mile away and still paired. I guess you mean "connected".
I have no problems to have the phone paired, the problem is to connect the phone to the arduino, maybe because there is nothing to connect to because ther is no program on the arduino?

Yea that is what I meant wither it is connected or not. What do you mean no program on the Arduino? You need a loop that checks for a connected device and if so activate a relay to unlock the doors, and if not connected make sure the door is locked. Also probably need to keep track of the state of the door so that youu don't keep locking the door over and over again. Or have a input pin that is high/low when the door is locked and check before locking if locked already.

Check the commands that can be sent to the BT module.
What BT module? The one on the Arduino or the one on the phone?
How do I check this?

Check the datasheet for the bt module/btduino

Which one are yo using?
Phone: Sony ericsson W995 and Samsung galaxy android
Android: Android BT (the arduino with integrated bluetooth)

. What do you mean no program on the Arduino? You need a loop that checks for a connected device and if so activate a relay to unlock the doors

This is where my big problem is right now. I'll try to explain it better:

In the beginning I had the clean arduinoBT (no program code saved at the ROM).

Then I take my Sony Ericsson phone and goes to "My devices" where there are no devices.
By the way: in the top of the screen on the SE-phone, there will always be a symbol of what BT-device that is connected. If I connect the phone to a computer, i get a computer-symbol. If I connect the phone to a hands free, I got a symbol of a hands free. So I will always have a symbol in the top of the screen if the phone is connected to a bluetooth device.

And here comes the problem. I use the phone to search for BT-devices and it finds the ARDUINOBT. I pair it by using the password 12345. I do now have the arduino paired with the phone, but there is no way to connect the phone to the arduino (as I mentioned earlier). I don't know why, but I guess maybe there has to be a "pre-installed" software on the arduino so the phone can know what kind of bluetooth-thing it's cannected to?

r2d290:

. What do you mean no program on the Arduino? You need a loop that checks for a connected device and if so activate a relay to unlock the doors

This is where my big problem is right now. I'll try to explain it better:

In the beginning I had the clean arduinoBT (no program code saved at the ROM).

Then I take my Sony Ericsson phone and goes to "My devices" where there are no devices.
By the way: in the top of the screen on the SE-phone, there will always be a symbol of what BT-device that is connected. If I connect the phone to a computer, i get a computer-symbol. If I connect the phone to a hands free, I got a symbol of a hands free. So I will always have a symbol in the top of the screen if the phone is connected to a bluetooth device.

And here comes the problem. I use the phone to search for BT-devices and it finds the ARDUINOBT. I pair it by using the password 12345. I do now have the arduino paired with the phone, but there is no way to connect the phone to the arduino (as I mentioned earlier). I don't know why, but I guess maybe there has to be a "pre-installed" software on the arduino so the phone can know what kind of bluetooth-thing it's cannected to?

All the BT does on the Arduino is provide a serial link, just like if you had a wire connected to the phone. The Arduino doesn't really see a differance between the USB serial port or BT serial port, or any other serial connection. You have to upload a sketch that sends serial commands to the BT which in this case is probably Serial 0 not sure if the BT is using its own serial connection. I am sure the BT has commands you can send to set passoword and get connection status. Post the link to the product page and see if there is a datasheet with the commands and such.

Post the link to the product page and see if there is a datasheet with the commands and such.

I'm still a bit unsure what you are referring to, but the link to the Arduino BT is here: http://www.arduino.cc/en/Main/ArduinoBoardBluetooth

I see there's a data sheet there, and I will look at it to morrow :smiley: I still do not understand how I can have the arduino to handshake with the phone while they are not connected to each other, but maybe the data sheet will help :smiley: