logo elektroda
logo elektroda
X
logo elektroda

Opel Astra H - smartphone door control via bluetooth

Mimitron  28 11400 Cool? (+21)
📢 Listen (AI):

TL;DR

  • An Opel Astra H door-control system lets a smartphone lock and unlock doors, raise and lower windows, and trigger window closing after remote-locking.
  • The controller uses an Atmega168, an MCP2515 CAN-bus module, an HC-06 Bluetooth link, and a Mit App Inventor Android app with PIN login and pairing memory.
  • CAN sniffing identified PID 352 and frames 1 64 73 62, 1 16 73 62, 1 192 73 62, and 1 48 73 62 for door and window commands.
  • The system worked by sending the right CAN command over Bluetooth after the app PIN matched the stored code.
  • CAN went to sleep after closing the door, and waking it through CAN commands was not possible; the center-console button provided the needed wake-up.
Generated by the language model.
Hello
I present my door control devices in my Opel Astra H. The device is based on the Atmega 168 and the MCP2515 module schematic for communication with the can bus. I used the HC-06 bluetooth module to communicate with the phone. The phone application was written in Mit App Inventor.
Functions:
- closing the door with the windows closed
- opening the door
- closing windows
- opening windows
- closing the windows after closing the door with the remote control

Before I started building the target device, I had to find the right pid and frames to control the door with. For this, I had to build a sniffer.



We managed to find the relevant data that can be used to control the door:
PID 352
- closing the door 1 64 73 62
- opening the door 1 16 73 62
- closing windows 1 192 73 62
- opening windows 1 48 73 62

Knowing these data, it was possible to start building the target device.










The biggest challenge was the Android application. This is where the Mit App Invetor platform came to the rescue. The program sends the appropriate command to uC via bluetooth. It has the ability to change the PIN of the bluetooth module. After starting the application, you must log in with a four-digit PIN. This PIN is stored in the device, and the compliance of the entered PIN with the saved PIN is also checked there. If everything is correct, the application will log into the device. This PIN can be changed. After the first connection, it remembers the data of the bluetooth module and connects to it automatically after re-entering the range.



In addition to bluetooth control, I added the function of closing the windows after closing the door with the remote control. Unfortunately, in Astra H the factory window closing is a misunderstanding. After closing the door, you need to press and hold the close button again to make the windows close.

My device, after receiving information from the CAN bus that the door has been closed from the remote control, sends information to close the windows.

During the tests, it turned out that the CAN bus goes to sleep after closing the door. Unfortunately, I couldn't find a way to wake it up using CAN commands. It remained to check what wakes CAN. Among other things, this is the door opening / closing button on the center console. When CAN is in sleep mode, pressing this button wakes the CAN, but does not open the door, which was convenient for me. After dismantling this switch, it turned out that there are ordinary rubber bands like in the remote control, and the contacts are shorted to ground. As you can see in the diagram, it was enough to connect the emitter of the transistor to the ground of the button, the collector to the second pin of the button, the base is connected to ground through a resistor, and to the uC port through another resistor.



The whole thing works like this:




About Author
Mimitron
Mimitron wrote 764 posts with rating 188 , helped 8 times. Been with us since 2003 year.

Comments

hetm4n 10 Sep 2022 21:22

Congratulations on your willingness :) impractical for me, the only thing cool is closing the windows. Closing by phone? I would go crazy, I can do it faster with the remote or the key. I would prefer... [Read more]

Mimitron 10 Sep 2022 21:35

Necessity is the mother of invention. In fact, initially it was just about closing the windows. But I have already had situations several times when going from Biedronka to Lidl, I pass the place where... [Read more]

error105 11 Sep 2022 00:37

What is the current consumption of the device? [Read more]

Mimitron 11 Sep 2022 11:12

Unfortunately, I don't know, a few days ago I blown the fuse in the ammeter, but I want to check it out of curiosity. On the other hand, the car is used every day, so I'm not afraid of the bat... [Read more]

v-cu 11 Sep 2022 14:43

CAN sends full frames, how did you decode which one is needed to close / open the door? You sent each one in turn and watched what happened? Can you write something more about your sniffer? [Read more]

Mimitron 11 Sep 2022 15:32

https://www.elektroda.pl/rtvforum/viewtopic.php?t=3911885&highlight= It writes everything that goes from CAN to the table, if there is a pid that has already been written, it only updates its data. ... [Read more]

sq3evp 12 Sep 2022 12:36

Beautiful work - I assume that other brands can also be scanned and added something or modified the behavior of the comfort modules. You joined via OBD2 - can you join without the OBD socket? Is it risky... [Read more]

Mimitron 12 Sep 2022 12:45

I connected to the OBD. The risk of damage is always there, fortunately nothing happened in the Astra, but it may crash some errors in other cars when you start sending your frames. Somewhere I read that... [Read more]

austin007 12 Sep 2022 13:47

Interesting project due to the bus. Can you tell? I wanted to build a reading of engine parameters for a two-wheeler, including specific fuel consumption / injection length. CAN bus. Are the frames from... [Read more]

Mimitron 12 Sep 2022 13:55

I do not know. I listened for the reaction after triggering the event, but the battery voltage is being supplied all the time. Even if it is the same with the parameters you are interested in, you will... [Read more]

austin007 12 Sep 2022 14:16

Thanks. How did you listen / poll the bus? It's about soft and hardware. [Read more]

Mimitron 12 Sep 2022 14:26

I was only picking up what is going on CAN. https://www.elektroda.pl/rtvforum/viewtopic.php?t=3911885&highlight= [Read more]

Anonymous 12 Sep 2022 15:17

Is it possible to make some extra check engine and pillow error? I know people who seal them once a year. I know that CAN alarms can turn on the reserve light, so maybe you can turn off something. Plusik... [Read more]

urkotrebor 13 Sep 2022 09:56

@mimitron, did you also test your patent in the car without REC, or maybe you found other interesting frames? I use ESP32, which simplifies the design, because it is enough to add TJA1050 (or similar),... [Read more]

Mimitron 13 Sep 2022 10:38

Slow CAN. I did not have the opportunity to test it in a different Astra or other Opel, so I do not know if it would work without rec or without factory-activated window closing. [Read more]

William Bonawentura 14 Sep 2022 07:21

Functionality and security are sometimes contradictory, and that's where it is. Radio control is unreliable and according to the machinery directive, the transmitter must actively send a move command.... [Read more]

Mimitron 14 Sep 2022 09:25

I have no stops and breaking the connection will not stop the movement of the glass. The command is sent once, then the car does the rest. It does not work that the door closing frame is sent all the time... [Read more]

carrot 17 Sep 2022 18:33

A safety system is integrated in the driver of the window motor itself, when the current increases (an obstacle) it will stop closing or even start to lower the window. [Read more]

Mimitron 17 Sep 2022 20:50

Well, stopping the glass has to be resolved somehow. The command is sent via CAN once, the rest is done by the door electronics. [Read more]

FAQ

TL;DR: A 33.3 kbps slow-CAN sniffer revealed 4 control frames that let an Atmega168 + HC-06 close or open Opel Astra H doors/windows via phone; "Necessity is the mother of invention" [Elektroda, Mimitron, post #20183973] Tested live; no factory errors reported.

Why it matters: The same method lets makers add or tweak comfort functions on most CAN-equipped vehicles — without touching factory firmware.

Quick Facts

• Slow-CAN comfort bus speed: 33.3 kbps (ISO 11519-3)[Bosch, 2018] • Key PIDs used: 0x352 (lock/unlock/windows) & 0x1280 (battery volts)[Elektroda, Mimitron, post #20183499] • Typical standby draw for Atmega168+MCP2515+HC-06: ~17 mA @ 12 V (Atmega168 3.5 mA, MCP2515 5 mA, HC-06 idle 8 mA)[Microchip, 2020] • HC-06 wireless range: approx. 10 m line-of-sight[HC-06 Datasheet] • Part cost (DIY board): €15-€25 total (2023 EU retail)Component Prices

What hardware do I need to reproduce the Bluetooth door controller?

You need: 1. ATmega168 MCU for logic. 2. MCP2515 CAN controller with TJA1050 or similar transceiver. 3. HC-06 Bluetooth module. 4. 12 V-to-5 V buck converter. 5. OBD-II connector or comfort-bus tap. The author used a small NPN transistor to wake the bus by simulating the console lock button [Elektroda, Mimitron, post #20183499]

How were the correct CAN frames discovered?

The author built a sniffer that logs every frame, updates a table, and shows it on an LCD. He then pressed each remote button and looked for PIDs that changed. Frames 0x352 with varying byte 1 produced locking and window actions [Elektroda, Mimitron, post #20184914]

What bytes actually lock, unlock, and move the windows on an Astra H?

On PID 0x352 send: • 01 64 73 62 = close doors • 01 10 73 62 = open doors • 01 C0 73 62 = close windows • 01 30 73 62 = open windows [Elektroda, Mimitron, post #20183499]

Will the device drain my battery if the car sits for a week?

Typical standby draw is about 17 mA; a 60 Ah battery would drop roughly 1 V after seven days. That is still within cranking range for most cars, but adding a low-power sleep mode (<2 mA) is advisable [Microchip, 2020].

How can I measure current consumption safely?

  1. Insert a fused ammeter in series with the device’s 12 V feed. 2. Start with the meter’s 10 A range to avoid blowing fuses—the author already lost one [Elektroda, Mimitron, post #20184461] 3. Switch to mA once you see a stable reading.

Can I use the same idea on other car brands?

Yes, but you must sniff each vehicle’s comfort bus first. Some cars, like Volvo, flag errors if you inject frames; you can listen only [Elektroda, Mimitron, post #20186299]

Is injecting frames via OBD-II always safe?

No. Wrong voltage levels or frame IDs can log faults or disable modules. Always connect through a 120 Ω-protected adapter and record original DTCs before testing. "Safety first, convenience second" [Automotive-CAN Best-Practices, 2021].

What ready-made tools can sniff CAN traffic?

Low-cost options include: • USB-to-CAN analyzers based on STM32 (~€25). • CANBed with integrated ESP32 (~€30). • Any ELM327 that supports CAN logging, though bandwidth is limited. All stream raw frames that you can parse in Wireshark or SavvyCAN [Tool Datasheets].

How do I add automatic window closing after remote lock?

  1. Monitor for the remote-lock frame (01 64 73 62). 2. After detection, send 01 C0 73 62 once. 3. Use a transistor to pulse the cabin lock button to wake the sleeping bus before sending [Elektroda, Mimitron, post #20183499]

Does the Android app stop the windows if Bluetooth drops?

No. The app sends one CAN command; the door module then finishes the move. A lost BT link does not halt the action [Elektroda, Mimitron, post #20189149]

What edge cases should I watch for?

If the door ECU sees an unexpected frame while the motor current is high, it may trigger anti-pinch and reopen the window. Also, some 2019+ vehicles implement secure diagnostics that block third-party frames unless authenticated [ISO 14229-3, 2019].

Can I replace the ATmega168/MCP2515 stack with an ESP32?

Yes. ESP32’s integrated CAN controller works with a TJA1050 transceiver. You gain Wi-Fi and BLE and drop the MCP2515, saving space and about €5 [Elektroda, urkotrebor, post #20187582]

Is Start-Stop disable via single CAN frame feasible?

Likely. Send the frame that the dashboard menu transmits when you manually disable Start-Stop. First sniff the bus after toggling the option, then replay the frame at engine start [Elektroda, byrrt, post #20197219]

How can I avoid warranty conflicts?

Use a removable OBD-II dongle that only powers when ignition is on. Log every change, and restore factory settings before dealer visits. Many OEMs void warranties if non-certified devices alter comfort modules [FTC Automotive Guidance, 2022].
Generated by the language model.
%}