Hey everyone, finally out of school and I finally have done something to my e30 worth posting.
The inspiration for this is really from the thought of being able to open and maybe even start the car from a smart watch. Unfortunately, I don't have a smart watch yet but I'll be grabbing one later this year. In the mean time, keyless entry with my phone will have to do.
The get started, I used the following parts:
These parts were all used for the final build, I used an Arduino Mega and a breadboard for prototyping
Wiring the Arduino is fairly straight forward, the only thing that matters is that all communication pins are is digital i/o pins (marked on the board) and that the write-wire from the bluetooth module is on an interrupt port (pin 8, 9, 10, 11, 14 on the Arduino Micro. Varies with other microcontrollers) otherwise the Arduino will not hear any incoming signals.
For connecting the bluetooth to the arduino, here are how things were connected.
Bluetooth Arduino
GND ------------------------------------ GND
. . . . . . . . . . . . . . . . . . . . . . ./
. . . . . . . . ___440ohm resistor /
. . . . . . . ./
RXD --------220ohm resistor --------- Pin 9
TXD ------------------------------------ Pin 8
VCC ------------------------------------ 5v
*Just to clarify, the wire from the RXD pin on a bluetooth module splits. One path has the 440ohm resistor and connects to ground. The other has a 220ohm resistor and connects to Pin 9 on the arduino.
The resistors are for splitting the 5v current signal from the arduino to to the bluetooth so that the voltage will drop to 3.3 so the bluetooth will understand the arduino. Wiring the realy is simpler. GND to GND, VCC to 5v, and the last 4 pins on the relay module to any 4 digital i/o pins on the ardion. I used pins 4, 5, 6, 7.
Until I figure out how to use r3v gallery, we have links
Here is a picture of my proof on concept prototype:
Prototype
Final assembly
I added a little under a meter of wire to the bluetooth module so that I may more freely position it when I install it.
Ok, now for the software starting with the arduino. You can find it here under the sketch folder:
Code
This code may not work for everyone as it requires all the pins to match to mine If any pins are different or you are using a different microcontroller, change the pins used in the sketch to match what you are using. You will need the arduino sdk to load the program onto it, there are plenty of tutorials of how to do that already out there.
Note, you will want to change the passwords used in the sketch as they aren't particularly hard to guess. Currently limited to 4 characters long.
Once that is done, every time the arduino is started it will immediately start this program and await to be connected. The device name will be "HC-05" and the default password is "1234". To test the microcontroller with the new passwords, I downloaded Bluetooth Terminal from the Play Store and typed the commands. You'll know it is working if any command you send it is sent back to you.
Now for the phone application. This is only for Android because I don't know how to code for iPhones and I don't want to learn. Also, android will be a lot easier to put on the store for others to download once I add a settings tab so that you may select the device to connect to and the commands to send. Until it is on the store, you will have to download the code, compile it, and install it to your phone through the android sdk. Tutorials out there already and the code is under the CarEntry folder:
Code
Like with the arduino, you will need to change the commands to what you want. The commands are in the TalkToCar file. Also, make sure the device name the widget will try to connect matches the device. You will need to connect to it at least once before so connect with the password and then the widget will connect automatically.
Hopefully soon, I will update both sets of code with lots of comment describing many things.
Alrighty, so how does it look? Like this:
The widget
Using it:
There really isn't anything special to using the widget. Just leave it on the phone and when you hit any of the buttons it will try to connect if it isn't already. If it does connect, it then sends the command you hit.
Make sure that you connect to the device at least before using the widget. This way you can login to it with the required password and the widget will find it in the bonded bluetooth devices.
In terms of what the buttons are actually supposed to do, hitting unlock will open the second relay to unlock the car, and tap the third relay twice to blink the turn signals. Hitting lock will open the first relay to lock the car, tap the third relay twice to flash the blinkers, and very shortly tap the fourth relay for the horn to tell you it is locked. The Panic button just turns on the third and fourth relay and around half second intervals for about 10-15 seconds. This does the horn and blinkers. Hitting the button again will make it stop.
That's it, wire into the car like any other keyless entry. Just be careful to make sure all the connections are correct and to test before putting it in the care. I am taking no responsibility if something goes wrong. Just sharing a personal project.
For power usage, I measured 35 mAmp drain while waiting for commands. That's low enough for me to be fine with it.
Thanks and I'll post the next microcontroller project when it's done. Dream would be a plug and play lcd gauge cluster to replace the onboard obc and add camera's, more info, etc but that would take quite a while. Summer project maybe? This project only took me about 10 hours to do everything. Until that is started, give me comments on these smaller project ideas:
The inspiration for this is really from the thought of being able to open and maybe even start the car from a smart watch. Unfortunately, I don't have a smart watch yet but I'll be grabbing one later this year. In the mean time, keyless entry with my phone will have to do.
The get started, I used the following parts:
- Arduino Micro. I used this one because it is tiny and is powered by micro usb just like a phone.
- 4 channel relay board for arduino
- HC-05 bluetooth module for arduino
- 440ohm resistor
- 220ohm resistor
- old car charger
- multimeter
These parts were all used for the final build, I used an Arduino Mega and a breadboard for prototyping
Wiring the Arduino is fairly straight forward, the only thing that matters is that all communication pins are is digital i/o pins (marked on the board) and that the write-wire from the bluetooth module is on an interrupt port (pin 8, 9, 10, 11, 14 on the Arduino Micro. Varies with other microcontrollers) otherwise the Arduino will not hear any incoming signals.
For connecting the bluetooth to the arduino, here are how things were connected.
Bluetooth Arduino
GND ------------------------------------ GND
. . . . . . . . . . . . . . . . . . . . . . ./
. . . . . . . . ___440ohm resistor /
. . . . . . . ./
RXD --------220ohm resistor --------- Pin 9
TXD ------------------------------------ Pin 8
VCC ------------------------------------ 5v
*Just to clarify, the wire from the RXD pin on a bluetooth module splits. One path has the 440ohm resistor and connects to ground. The other has a 220ohm resistor and connects to Pin 9 on the arduino.
The resistors are for splitting the 5v current signal from the arduino to to the bluetooth so that the voltage will drop to 3.3 so the bluetooth will understand the arduino. Wiring the realy is simpler. GND to GND, VCC to 5v, and the last 4 pins on the relay module to any 4 digital i/o pins on the ardion. I used pins 4, 5, 6, 7.
Until I figure out how to use r3v gallery, we have links
Here is a picture of my proof on concept prototype:
Prototype
Final assembly
I added a little under a meter of wire to the bluetooth module so that I may more freely position it when I install it.
Ok, now for the software starting with the arduino. You can find it here under the sketch folder:
Code
This code may not work for everyone as it requires all the pins to match to mine If any pins are different or you are using a different microcontroller, change the pins used in the sketch to match what you are using. You will need the arduino sdk to load the program onto it, there are plenty of tutorials of how to do that already out there.
Note, you will want to change the passwords used in the sketch as they aren't particularly hard to guess. Currently limited to 4 characters long.
Once that is done, every time the arduino is started it will immediately start this program and await to be connected. The device name will be "HC-05" and the default password is "1234". To test the microcontroller with the new passwords, I downloaded Bluetooth Terminal from the Play Store and typed the commands. You'll know it is working if any command you send it is sent back to you.
Now for the phone application. This is only for Android because I don't know how to code for iPhones and I don't want to learn. Also, android will be a lot easier to put on the store for others to download once I add a settings tab so that you may select the device to connect to and the commands to send. Until it is on the store, you will have to download the code, compile it, and install it to your phone through the android sdk. Tutorials out there already and the code is under the CarEntry folder:
Code
Like with the arduino, you will need to change the commands to what you want. The commands are in the TalkToCar file. Also, make sure the device name the widget will try to connect matches the device. You will need to connect to it at least once before so connect with the password and then the widget will connect automatically.
Hopefully soon, I will update both sets of code with lots of comment describing many things.
Alrighty, so how does it look? Like this:
The widget
Using it:
There really isn't anything special to using the widget. Just leave it on the phone and when you hit any of the buttons it will try to connect if it isn't already. If it does connect, it then sends the command you hit.
Make sure that you connect to the device at least before using the widget. This way you can login to it with the required password and the widget will find it in the bonded bluetooth devices.
In terms of what the buttons are actually supposed to do, hitting unlock will open the second relay to unlock the car, and tap the third relay twice to blink the turn signals. Hitting lock will open the first relay to lock the car, tap the third relay twice to flash the blinkers, and very shortly tap the fourth relay for the horn to tell you it is locked. The Panic button just turns on the third and fourth relay and around half second intervals for about 10-15 seconds. This does the horn and blinkers. Hitting the button again will make it stop.
That's it, wire into the car like any other keyless entry. Just be careful to make sure all the connections are correct and to test before putting it in the care. I am taking no responsibility if something goes wrong. Just sharing a personal project.
For power usage, I measured 35 mAmp drain while waiting for commands. That's low enough for me to be fine with it.
Thanks and I'll post the next microcontroller project when it's done. Dream would be a plug and play lcd gauge cluster to replace the onboard obc and add camera's, more info, etc but that would take quite a while. Summer project maybe? This project only took me about 10 hours to do everything. Until that is started, give me comments on these smaller project ideas:
- Slightly more intelligent wipers
- Automatic climate control
- Check panel car compass
- Automatic mirror lowerer when in reverse like in my e34
- Automatic windows (just tap the button)
- Can't think of any more atm
Comment