05-18-2020, 07:48 AM | #1 |
Private First Class
99
Rep 155
Posts |
[DIY] Remote start using Arduino
Hi everyone! Today, I want to show you this little Remote start project, made with Arduino.
Cost: around 30 euros. Source code: https://github.com/AlbertoMarziali/bmw_remote_start If you like my work and you want to support me, you can Donate! Video Video of remote start in action: Features This project allows to do this things: - If the engine is off, remote start the car with a triple click on the lock button of the OEM keyfob. - After 15 minutes from remote start, if no one started driving, automatically shut off the car - If the engine is on, remote stop the car with a triple click on the lock button of the OEM keyfob. - You have to unlock the car before driving it (why wouldn't you) or it will perform an emergency anti-thief stop How it works The Arduino, thanks to the MCP2515 board, constantly listen to the BMW K-CAN2 bus, looking for a triple lock button click. If found, it starts a 18 seconds long operation, during which it does those steps: 1. Turns on the in-car keyfob 2. Unlocks the car 3. Locks the car 4. Virtually presses the start button, turning on the ignition 5. Waits some seconds, to let the engine be ready to start. 6. Virtually presses the brake and the start button, turning on the engine 7. Turns off the in-car key. Security issues What happens if a thief enter the car (by smashing the window) and tries to steal it? If someone tries to engage a gear with the car remote started, without unlocking it with a keyfob first, the car automatically shuts off. The spare key is always in the car. Wouldn't this be enough to allow a thief to turn on the engine? Yes, but actually no. The Arduino turns on the keyfob only when it needs it to remote start. Normally the key isn't powered so the car doesn't see it and can't be turned on! Why do the Arduino open and close the car before starting the engine? The lock and unlock thing is needed to be able to turn on the ignition. This is because of the BMW security protocol, which disables the possibility of turning on the car if the car wasn't opened before. This is not a security issues though, because this process happens in 2 seconds and the car remains open for just 1 second. Required things Here's a list of things you need for this project: - Arduino Nano - LM2596S voltage regulator board, with the output regulated to 5V - MCP2515 Canbus board (Niren) - 6x Relay Board with 5V relays - 2x 560Ω (to replicate the start button internal 560Ω resistor) - 1x 1100Ω (to replicate the 12mA current outputted by the hall sensor inside the brake light switch) - The spare keyfob You can get those resistance values by putting more resistors in series and sum the resistance value. For example: - to get a 550Ω resistance, you can put 220Ω and 330Ω resistors in series! - to get a 1100Ω resistance, you can put 1kΩ and 100Ω resistors in series! Wiring You have to do the wiring for: - KCan2 bus - 12V and GND - Brake light switch - Start button switches - Keyfob battery - Keyfob lock switch - Keyfob unlock switch Car Wiring KCAN2 Attention: the OBD2 port doesn't have KCAN2. You can't use it. You have to take KCAN2 from the FEM - KCAN2_H: FEM A173\*8B, pin 50 - KCAN2_L: FEM A173\*8B, pin 49 12V and GND Attention: you can't use the 12V plug as power source, you need an always-powered 12V source. You can find it at the FEM. - 12V: FEM A173\*3B, pin 33 - GND: FEM A173\*3B, pin 6 Brake Light Switch and Start-Stop Button Here you can see how to wire break light switch and start/stop button: - The start-stop button wiring is right behind the switch button, just pull it out. - The break light switch wiring is above the brake pedal. KeyFob Wiring KeyFob Power You have to interrupt the battery positive connection, split it in 2 wires and feed them inside the relay: KeyFob Lock and Unlock buttons You have to simulate the press of the switch using the relay. To do that, just hook to the key switches like that: Arduino wiring Schematic You can follow this schematic to build everything. Note: this schematic shows a 8x relay board, but you can use a 6x one Final look This is the final look, with the spare key wired. You have to hide it somewhere inside the car. (it's ugly, I know. You can make it definitely better) Credits autowp for arduino-mcp2515 library Last edited by AlbertoSONIC; 05-18-2020 at 07:54 AM.. |
Appreciate
19
nitsuj1756.00 raphaelpais6.00 Momir1340.00 fantanas112.00 Marco115912.00 SlickShift324.50 chr12.00 VipinLJ1950.50 cozzzz36.50 ngl119.50 Siki78145.00 HarryMrn15.00 david51541.50 Onizukachan1139.00 Pondaire37.00 terahertz162.50 fe7565557.50 kovalchuk7112.00 Infam0uspt0.00 |
05-19-2020, 04:29 PM | #2 |
New BMW owner
139
Rep 622
Posts
Drives: BMW 316d, BMW F40 116d
Join Date: Jan 2012
Location: Belgium
|
Nice write up!
|
Appreciate
1
AlbertoSONIC98.50 |
12-19-2021, 07:23 AM | #4 |
New Member
2
Rep 5
Posts |
I need help
Hey AlbertoSONIC.
Really cool what you have done there, I'v copied your project but I can't manage to make it to work. I have connected to pin 49 and 50 in A173*8B, but it does not seem to receive info over CAN, I don't know if my arduino it's broken or my MCP2515 it's not working and I can't figure it out, can you help me with more info or a idea what to do next? |
Appreciate
1
AlbertoSONIC98.50 |
12-19-2021, 03:50 PM | #5 | |
Private First Class
99
Rep 155
Posts |
Quote:
Thanks! Make sure you connected the MCP to arduino the right way. The first time I tried it I inverted 2 wires by accident |
|
Appreciate
0
|
12-22-2021, 12:10 PM | #8 |
New Member
2
Rep 5
Posts |
Hey AlbertoSONIC , I have maneged to install almost everything and I run into other issue.
If I'm in the car and 3xclick the lock button the engine starts, but does not wait for the preheating time, if I'm outside the car it says in the dashboard that "Rem. control missing. No engine start.", as if the key it's not powered on all the way until engine start. Can you help me please? I don't know how to modify relay key power to be longer and also a longer time for preheating. |
Appreciate
0
|
12-22-2021, 12:15 PM | #9 | |
Private First Class
99
Rep 155
Posts |
Quote:
|
|
Appreciate
0
|
12-22-2021, 12:18 PM | #10 |
New Member
2
Rep 5
Posts |
Yes, key on, unlock, lock, brake - all good. If good key is in the car engine starts. If it's only the key connected to arduino, it does not start the car and says that message.
|
Appreciate
0
|
12-22-2021, 03:13 PM | #11 |
New Member
2
Rep 5
Posts |
Hey AlbertoSONIC , I think I found out the problem.
There are 12 steps in starting the engine, but your code is missing the steps 4 to 7, and also steps 2 and 3 are to lock and not unlock the car. Why is your code like this? /* ENGINE START: * 1) Turn on the in-car key (2 sec) * 2) Press unlock button (1 sec) * 3) Release unlock button and wait (1 sec) * 4) Press lock button (1 sec) * 5) Release lock button and wait (1 sec) * 6) Press start button (1 sec) * 7) Release the start button and wait (1 sec) * 8) Start holding the brake and wait (5 sec) * 9) Press the start button (2 sec) * 10) Release the start button and wait (1 sec) * 11) Release the brake and wait (1 sec) * 12) Turn off the in-car key (1 sec) */ void engine_do_start() { if(engine_do_start_time == 0) { engine_do_start_time = millis(); Serial.println("*** Engine starting ***"); } //divided in phases: //KEY_POWER_ON - 100 ms if(millis() - engine_do_start_time < 100) { digitalWrite(RELAY_KEY_POWER, RELAY_HIGH); Serial.println("1) Turn on the in-car key (100 ms)"); } //KEY_LOCK - 300 ms else if(millis() - engine_do_start_time < 400) { digitalWrite(RELAY_KEY_LOCK, RELAY_HIGH); Serial.println("2) Press lock button (300 ms)"); } //KEY_LOCK_RELEASE - 400 ms else if(millis() - engine_do_start_time < 800) { digitalWrite(RELAY_KEY_LOCK, RELAY_LOW); Serial.println("3) Release lock button and wait (400 ms)"); } //BRAKE - 100 ms else if(millis() - engine_do_start_time < 900) { digitalWrite(RELAY_BRAKE, RELAY_HIGH); Serial.println("8) Start holding the brake and wait (100 ms)"); } //START - 1500 ms else if(millis() - engine_do_start_time < 2400) { digitalWrite(RELAY_START_1, RELAY_HIGH); digitalWrite(RELAY_START_2, RELAY_HIGH); Serial.println("9) Press the start button (1500 ms)"); } //START_RELEASE - 100 ms else if(millis() - engine_do_start_time < 2500) { digitalWrite(RELAY_START_1, RELAY_LOW); digitalWrite(RELAY_START_2, RELAY_LOW); Serial.println("10) Release the start button and wait (100 ms)"); } //BRAKE_RELEASE - 200 ms else if(millis() - engine_do_start_time < 2700) { digitalWrite(RELAY_BRAKE, RELAY_LOW); Serial.println("11) Release the brake and wait (200 ms)"); } //KEY_POWER_RELEASE - 100 ms else if(millis() - engine_do_start_time < 2800) { digitalWrite(RELAY_KEY_POWER, RELAY_LOW); Serial.println("12) Turn off the in-car key (100 ms)"); } //ENGINE STARTED else { remote_started = true; remote_start_time = millis(); engine_do_start_time = 0; engine_start = false; Serial.println("*** Engine started ***"); } } |
Appreciate
0
|
12-22-2021, 05:10 PM | #12 | |
Private First Class
99
Rep 155
Posts |
Quote:
Give me some minutes, I'll upload an update with longer timings! |
|
Appreciate
0
|
12-22-2021, 05:26 PM | #13 | ||
Private First Class
99
Rep 155
Posts |
Quote:
Now it waits more time before starting the car. This should give the car enough time to find the embedded key. Let me know if it works! |
||
Appreciate
0
|
12-23-2021, 08:01 PM | #15 | ||
Private First Class
99
Rep 155
Posts |
Quote:
|
||
Appreciate
0
|
12-24-2021, 08:45 AM | #16 |
Captain
542
Rep 817
Posts
Drives: bmw M3 F80
Join Date: Dec 2013
Location: france
|
Possible to do this on an M3 F80? |
Appreciate
0
|
12-24-2021, 10:57 AM | #18 |
Captain
542
Rep 817
Posts
Drives: bmw M3 F80
Join Date: Dec 2013
Location: france
|
|
Appreciate
0
|
12-24-2021, 11:56 AM | #19 |
Private First Class
99
Rep 155
Posts |
|
Appreciate
0
|
12-24-2021, 04:52 PM | #20 |
Captain
542
Rep 817
Posts
Drives: bmw M3 F80
Join Date: Dec 2013
Location: france
|
|
Appreciate
0
|
12-29-2021, 06:07 PM | #21 |
Captain
542
Rep 817
Posts
Drives: bmw M3 F80
Join Date: Dec 2013
Location: france
|
I have a question
do you have to leave the battery on the remote control? |
Appreciate
0
|
12-29-2021, 07:46 PM | #22 |
Private First Class
99
Rep 155
Posts |
Nope, you have to completely tear down the key and solder wires on the actual key's board. The battery has to be connected to the project's board. The arduino will take care of powering the key's board using the battery. (using a relay to connect it)
|
Appreciate
0
|
Post Reply |
Bookmarks |
Tags |
f30, remote, remote start |
|
|