logo elektroda
logo elektroda
X
logo elektroda

Opel Astra H - smartphone door control via bluetooth

Mimitron 11400 28

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.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • 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.

    Opel Astra H - smartphone door control via bluetooth

    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.
    Opel Astra H - smartphone door control via bluetooth

    Opel Astra H - smartphone door control via bluetooth

    Opel Astra H - smartphone door control via bluetooth

    Opel Astra H - smartphone door control via bluetooth

    Opel Astra H - smartphone door control via bluetooth

    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.

    Opel Astra H - smartphone door control via bluetooth

    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.

    Opel Astra H - smartphone door control via bluetooth

    The whole thing works like this:




    Cool? Ranking DIY
    About Author
    Mimitron
    Level 20  
    Offline 
    Mimitron wrote 764 posts with rating 188, helped 8 times. Been with us since 2003 year.
  • ADVERTISEMENT
  • #2 20183951
    hetm4n
    Level 20  
    Posts: 812
    Help: 5
    Rate: 525
    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 a mini computer based on OLED with engine temperature, because this model is missing on the clocks :(
  • #3 20183973
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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 the car is standing, without the keys, I could not leave the purchases in the car and had to drag them back and forth ;) Or how many times, being outside, I could use something from the car, but I didn't have the keys with me. The fact that this is a gadget used occasionally, but it will come in handy. :) As for the computer, I used to make a Golf 4 computer, days before arduino and aliexpres. If I had access to this knowledge then, it would be a miracle, and just to calculate fuel consumption, I had to count the injection opening time, you can see it in DIY, I described my computer here.
  • #4 20184173
    error105
    Level 14  
    Posts: 477
    Help: 1
    Rate: 145
    What is the current consumption of the device?
  • ADVERTISEMENT
  • #5 20184461
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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 battery.
  • #6 20184818
    v-cu
    Level 12  
    Posts: 71
    Help: 1
    Rate: 72
    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?
  • #7 20184914
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    https://www.elektroda.pl/rtvforum/topic3911885.html

    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.
    I display the boards on the display. After that, it was enough to look for a PID, which changes after pressing the remote control buttons. That's how I found frames for closing, opening doors and windows with the remote control. I also found data on opening and closing doors and locking the locks, which would be useful for an alarm.



  • #8 20186288
    sq3evp
    Level 39  
    Posts: 6340
    Help: 210
    Rate: 833
    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 - potential damage to the CAN bus.
  • #9 20186299
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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 Volvo does not tolerate such fun, you can only listen. In theory, everything can be scanned, the question of setting the transmission speed.
  • #10 20186391
    austin007
    Level 17  
    Posts: 758
    Help: 6
    Rate: 271
    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 the ECU sent in time intervals spontaneously without a specific query in the CAN system, or do they require polling every time?
  • ADVERTISEMENT
  • #11 20186410
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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 still have trouble finding the right PID and then decrypting the frame. For example, in Astra PID 1280 and frame 00 98.
    I would not come up with the fact that this PID is the battery voltage, and the second byte is the voltage indication, which still needs to be divided by 8.
  • #12 20186437
    austin007
    Level 17  
    Posts: 758
    Help: 6
    Rate: 271
    Thanks. How did you listen / poll the bus? It's about soft and hardware.
  • #14 20186502
    Anonymous
    Level 1  
  • #15 20187582
    urkotrebor
    Level 21  
    Posts: 334
    Help: 37
    Rate: 80
    @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), MCP2515 is then unnecessary, because the ESP32 does the same and there is bluetooth and WIFI for free.
    Can you also reveal which CAN you are operating on, medium or low?
  • #16 20187666
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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.
  • ADVERTISEMENT
  • #17 20189000
    William Bonawentura
    Level 34  
    Posts: 2413
    Help: 185
    Rate: 607
    Mimitron wrote:
    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.

    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. Does your application have a "STOP" function, and if the BT connection is disconnected or the application loses focus, traffic is stopped?
  • #18 20189149
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    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 until the window is closed or opened. I ship once and then the glass opens or closes automatically.
  • #19 20194818
    carrot
    Moderator of Cars
    Posts: 8375
    Help: 1304
    Rate: 3541
    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.
  • #20 20195075
    Mimitron
    Level 20  
    Posts: 764
    Help: 8
    Rate: 188
    Well, stopping the glass has to be resolved somehow. The command is sent via CAN once, the rest is done by the door electronics.
  • #21 20195637
    William Bonawentura
    Level 34  
    Posts: 2413
    Help: 185
    Rate: 607
    carrot wrote:
    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.

    Amperometry will not protect, for example, a child's larynx. The actuator must have enough torque to break the ice off the guides. The security is provided by a man who is on the spot and can react immediately. For this he must have the keys in the ignition.
  • #22 20197219
    byrrt
    Level 21  
    Posts: 726
    Help: 2
    Rate: 833
    Interesting topic mainly due to the connection to the car via CAN. I am thinking of something similar (systemically) but for automatically disabling the start-stop system. So, after starting the engine, one frame that turns off the system. In my car, you have to do it every time you start it, in addition only through the menu on the display. I conclude that this could be done by sending a command.
  • #23 20197291
    sq3evp
    Level 39  
    Posts: 6340
    Help: 210
    Rate: 833
    The manufacturer of the car made sure that you do not think about such evil - ecology is the key.
    Some cars have it on the button in the cabin - so not everyone makes it difficult.
    The very idea of the device is good, it would only be necessary to analyze a lot, what could be controlled by such systems and how safe it is for the car. In some models, it is enough to reprogram the module via ODB2 - the only question is how much the settings have to be interfered with. Such a light hacking of the car's system.

    Or otherwise - adding "features" that the car manufacturer "forgot" about.
  • #24 20197382
    Anonymous
    Level 1  
  • #25 20197385
    byrrt
    Level 21  
    Posts: 726
    Help: 2
    Rate: 833
    @ sq3evp, there are two difficulties in the car I drive - no button and a guarantee. And such an impersonation of some driver, sending the package to the bus with the command turn off the start-stop system seems simple and rather safe. In addition, this system cannot be turned on in specific conditions, e.g. severe heat or at temperatures below 0 ° C, so you would probably have to first read whether the system is not turned off, and if it is, turn it off and silence, cut off the line and that's it.

    Does my friend @Mimitron know if there are no other ways to sniff CAN, maybe via some ready interface or analyzer? Because I tried to find some information on this subject on the Internet, but to no avail. It is of course something reasonably priced.
  • #26 20197486
    carrot
    Moderator of Cars
    Posts: 8375
    Help: 1304
    Rate: 3541
    As for deactivating the start-stop, I know two options: in the VW group, it is enough to re-code in the climatronic module, you need to activate the comfort function, it is enough to have the ventilation turned on so that the engine does not go out.
    The second one, not all cars, but it is worth checking, is the momentary activation of the engine hood opening limit switch.
  • #27 20197544
    Anonymous
    Level 1  
  • #28 20197547
    byrrt
    Level 21  
    Posts: 726
    Help: 2
    Rate: 833
    Gentlemen, we're littering the subject a bit. In my case, it is Toyota Proace City, which is actually a clone of the PSA group of the Berlingo / Partner / Combo type, and it is a car from 2020. I understand that in these years it is not so easy to eavesdrop on OBD?
  • #29 20197775
    sq3evp
    Level 39  
    Posts: 6340
    Help: 210
    Rate: 833
    A question of safety for sure.
    The Start-Stop buttons are still used by new cars - I don't remember, but it probably works so that after turning on the engine, you can turn it off.
    I do not know if they all have the same or cannot be turned off in the settings, but many cars have a button on the board.

    The question is whether this can be turned off in the comfort modules or something similar.

    A small update - apparently VAG (for VW Audi group) and DDT4All (for Renault and Dacia) you can disable the Start-Stop system. I don't know how it works - whether permanently or otherwise, but it is a change of value in the configuration of the corresponding module.
📢 Listen (AI):

Topic summary

✨ The discussion revolves around a DIY project for controlling the doors and windows of an Opel Astra H using a smartphone via Bluetooth. The author developed a device utilizing an Atmega 168 microcontroller and an MCP2515 module for CAN bus communication, along with an HC-06 Bluetooth module. The smartphone application was created using MIT App Inventor. Key functionalities include closing/opening doors and windows, with specific PIDs identified for these actions. The project also involved building a CAN bus sniffer to decode the necessary frames for control. Participants discussed the feasibility of similar projects for other car brands, potential risks of connecting to the CAN bus, and the importance of safety features in such systems.
Generated by the language model.

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.
ADVERTISEMENT