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:
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:
Cool? Ranking DIY