| Author |
Message |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
27-12-2002, 16:48 Subject: VAGCOM Adapter: Faulty Optocouplers Explained |
Quote |
|
Hello everyone.
A few days ago, I finally dared to use VAGCOM to access the airbag control unit.
Result: "Cannot synchronize baud rate," "Too many communication errors to continue," and other brief error messages - although communication with the motor, ABS, and WFS is stable. I used version 2.2 of the adapter.
The baud rate issue suggests that the signal transmission speed between the laptop and the car is not optimal, which is likely due to the adapter. Since different airbag control units (STGs) can operate at different speeds, it seems possible that the adapter is too slow for the control unit that uses the fastest communication protocol.
So, I connected the adapter to a rectangular wave generator and then used an oscilloscope to examine the signal propagation times.
The results made it clear to me why the ready-made adapters are now being offered without optocouplers, and therefore without galvanic isolation.
The signal propagation times depend heavily on the input current of the optocouplers (at least in my PC 817). As soon as the LEDs receive more current than the output transistor "barely" needs to produce enough light to complete the intended switching process, the "turn-off" time becomes longer, and the longer the "excess" control current is supplied, the greater the saturation of the optocoupler.
The issue was particularly noticeable with the signal direction from the car to the laptop: when the K-line was driven low, it took approximately 40 microseconds for RXD to switch to high. Conversely, the reverse transition was transmitted almost without delay, which, for example, meant that low-level signals on the K-line, lasting less than 40 microseconds, were no longer received by the laptop.
However, the situation wasn't much better regarding the "laptop-car" connection: with a high voltage of 12 volts applied to TXD, the K-line responded to the low transition with a delay of approximately 16 µsec.
However, my laptop only provides 6 volts, which at least mitigates the battery life issue.
After performing several measurements with different resistors in the input circuit of the optocouplers, I modified my adapter as follows:
R1 and R3 = 2.2k, R5a = 4.7k, R14 = 10k. In addition, 6.8k resistors were added between pin 3 and pin 4 of OK 1 and OK 2.
With that, I immediately established a stable connection to my airbag control unit (ECU) and also to the other ECUs.
However, these values likely do not guarantee a solution to all adapter problems, as the optimal resistance values probably depend on the specific type of optocoupler being used and may even be influenced by its manufacturing tolerances.
As a solution, it would be possible to install 5k trim pots in series with resistors R1, R3, and R5a, allowing the adapter to be adjusted to match the specific PC/laptop being used and the built-in optocouplers.
This adjustment seems more important to me at the moment than the settings related to VR1 and VR2. It might also be possible to replace those potentiometers with jumpers if R9 and R13 are adjusted accordingly (approximately 3.3k and 68k).
I'll create a version 2.3 and email it to Rainer. Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:08.
|
|
| Back to top |
Profile PM Garage |
 |
chris11 Profi-Schrauber

Joined: 10/02/2002 Posts: 326 Karma: +3 / -1 Location: Münster
Premium Support
|
27-12-2002, 19:19 Subject: VAGCOM Adapter: Faulty Optocouplers - Troubleshooting |
Quote |
|
Hello Ulf,
Why use galvanic isolation at all? As long as you're only connecting the laptop (perhaps with a non-isolated car adapter) in the car, nothing should happen. After all, these are all open-collector drivers. The laptop's RS232 inputs are specified to handle +/- 25V according to the RS232 standard. That should be sufficient.
Best regards,
Christian.
Translated on 22-09-2026, 21:12.
|
|
| Back to top |
Profile PM |
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
27-12-2002, 20:38 Subject: Galvanic Isolation: Explained & Benefits |
Quote |
|
chris11 wrote: | | Why galvanic isolation at all? As long as you're only using the laptop, and in an emergency, using a (non-isolated) car adapter in the car, nothing should happen. They are all open collector drivers. The laptop's RS232 inputs can handle +/- 25V according to the RS232 specification. That should be enough. |
Hi Christian,
Unfortunately, an inverter stage is required, for example, between RS232 and K-Line.
And that requires a reference potential for the switching threshold, which is the ground.
When powering a laptop directly from the car's electrical system (which can draw several amperes), voltage fluctuations between the laptop's ground and the car's ground can occur, depending on the power supply design, which can confuse the adapter.
In such cases, a special design is necessary, for example, using optocouplers.
I have, for example, a laptop that can run without a battery - because I don't want to spend hundreds of euros every 2-3 years on new batteries  . Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:14.
|
|
| Back to top |
Profile PM Garage |
 |
dehlya Guest
Free account, no CAN development support
|
27-12-2002, 21:42 Subject: Probably works! |
Quote |
|
I have to disagree: Since I modified version 2.2 (the only difference is the use of PC 849 and SLH LEDs, which are super bright and consume more power), my primary use for it has been to reset airbag/ABS warning lights. After all, I can't spend the whole day adjusting my pump. I've experimented with various Polo 6Ns, T4s from 1995 onwards, Passats from 1997 onwards, Golf III/IV models, and Beetles (including key adaptation on those). However, I haven't worked on anything newer than 2000. I've set the potentiometer somewhere in the middle, and since it has worked perfectly on about 30 cars so far, I haven't seen any reason to change anything. As mentioned before, I initially built it as a breadboard setup and then installed it in a Bopla test probe. The only annoying thing is that the commercially available connector front end is quite flimsy and sometimes breaks the pins when inserting it, especially on the Passat models.
It's difficult to get in and out because of the handbrake. For added contact security, I've now connected a cigarette lighter adapter for the power supply.
'But this minor stress has nothing to do with the circuit. Thanks to the optical function control, it's really fun to use!!!'
I also don't use any exotic laptops, but rather continue to use the old Compaq Armada and an HP Omnibook.
If you keep playing games with me, I'll send you mine, this can't be real.
Translated on 22-09-2026, 21:17.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
28-12-2002, 14:14 Subject: Details Matter: The Devil Is in the Details |
Quote |
|
dehlya wrote: | I must disagree: Since I modified version 2.2 (the only difference is the PC 849 and SLH LEDs - which are super bright and consume more power), my main use for it has been to reset airbag/ABS warning lights... . .
I have the potentiometer set somewhere around the middle, and since it has been working perfectly fine on about 30 cars so far, I didn't see any reason to change anything.
If you continue to play games with me, I'll send you mine, this can't be true | .
Hi.
I'm glad that "my baby" is at least running smoothly in some places  .
Before I modified my adapter, my airbag control unit could sometimes be opened, but the connection was always quite unstable.
Apparently, my adapter was just barely "on the edge" of working. Your nominally identical one is likely "different" due to component tolerances, and apparently in the right direction. And/or the other PC might be saving the day...
Never change a running system... but if yours starts causing problems someday, remember the modification approaches mentioned  . Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:20.
|
|
| Back to top |
Profile PM Garage |
 |
AndyO Guest
Free account, no CAN development support
|
29-12-2002, 16:47 Subject: Acceleration Capacitor: Speed Up Your System |
Quote |
|
Hello Ulf,
I just finished some dry runs with the rectangle generator.
Solder a 100 nF capacitor in parallel with resistors R7 and R10, and a 100 pF capacitor in parallel with resistor R12. This will work great with the oscilloscope!
P.S. I'm still thinking about the feedback with R12!
Translated on 22-09-2026, 21:22.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
29-12-2002, 17:54 Subject: Acceleration Capacitor: Speed Up Your Project |
Quote |
|
AndyO wrote: | | Solder a 100 nF bypass capacitor in parallel with R7, R10, and R12. It will work great with the oscilloscope! |
Hi Andi,
The worst delays in my unit were caused by what appears to be over-saturation of the opto-output transistors.
Specifically, the output of OK3 continued for almost 40 microseconds after the voltage at the input had already been turned off.
Apparently, a boost capacitor won't help, but rather reducing the saturation of the output. With a value of 4.7 kOhms for R5a, this problem was largely resolved.
If you connect 100 nF in parallel with R12, this capacitance should act as a radical slew-rate limiter during the low-to-high transition of the K-line, as it is connected to ground with a low resistance through D7 and T3 (base-emitter)  .
For the typical line capacitance, you can generally assume around 1 nF, which, in combination with a 3.3 kOhm pull-up resistor, can be observed on the oscilloscope as a noticeably slowed rise in the K-line signal compared to the negative flank.
With 100 nF, the increase should slow down approximately 100 times.
Or have I made a mistake in my thinking? Or have you not been able to observe any such effects on the K-line?
By placing acceleration capacitors in parallel with R7 and R10, the negative slope of the K-line will experience less delay.
What I find unsympathetic about this is that when OK 1 and 2 are switched on, a purely ohmic resistance no longer limits the charging current of the capacitor, which flows through the optocouplers and T1 or T2 (base-emitter).
However, the transition wasn't actually the problem with my adapter; rather, the positive edge on the K-line was significantly delayed compared to the negative edge of the TXD signal – again, mainly due to saturation.
To limit the saturation of OK 1 and 2, I also increased the values of R1 and R3 to the point where T2 is no longer excessively "saturated," and the overall transmission times between TXD and RXD have been reduced to fractions of their original duration.
That seems to me to be at least the "gentler" solution. However, temperature drifts might become more noticeable.  Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:25.
|
|
| Back to top |
Profile PM Garage |
 |
AndyO Guest
Free account, no CAN development support
|
29-12-2002, 18:29 Subject: More Results: Find What You Need Now! |
Quote |
|
Hello Ulf,
Okay, the 100nF capacitors are definitely missing across R7 and R10. This will make the slope of the curve five times steeper. Normally, there should be a 100-ohm resistor in series with R7 and R10. I also don't think that the 100nF capacitors will damage the base without a series resistor. The RCE from OK1 and the RBE from T1 are sufficient as current limiting resistors.
I also experimented with a T3. To ensure that the signals, even at higher frequencies (50 kHz square wave), reach the collector cleanly, I soldered a 100pF capacitor across R12. Furthermore, the current gain is important. A BC547B has a lower cutoff frequency, about 30% less, than the BC879 that I use!
Try it out!
Translated on 22-09-2026, 21:29.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
29-12-2002, 19:48 Subject: More Results: Find What You Need Now! |
Quote |
|
AndyO wrote: | | So, the 100nF capacitors across R7 and R10 are definitely missing. The slope will be steeper by a factor of 5. |
Hi Andi,
Just to make sure we're on the same page: which side of the K-line is steeper, the positive side (going up from the low) or the negative side (going down from the high)? Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:31.
|
|
| Back to top |
Profile PM Garage |
 |
AndyO Guest
Free account, no CAN development support
|
29-12-2002, 19:58 Subject: Rising Slopes: A Climbing Guide |
Quote |
|
'The rising slopes are getting steeper, while the falling slope is okay. What bothers me is the issue with OK3. The collector signal from T3 could be considered good at 50 kHz. However, the output from OK3 on the slopes could be better. Bridging LED3 only provides a slight improvement. However, this should be sufficient given the low baud rates being used.'
P.S. Without acceleration, you will experience a significant phase shift between the input signal and the K/L line.
Translated on 22-09-2026, 21:32.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
29-12-2002, 20:05 Subject: OK Flanken: Your Guide to Perfect Side Dishes |
Quote |
|
AndyO wrote: | | The output from OK3 on the flanks could be better. Bridging LED3 only provides a slight improvement. |
Hi Andi,
The signal propagation time through OK3 when "powering off" improved significantly for me after I increased the value of R5a. Try that  .
What types of OK buttons did you use?
Quote: | | Without the acceleration, you have a significant phase shift between the input signal and the K/L line. |
With a current of approximately 1.5 mA flowing through the input of OK 2 (PC 837), I only observed a delay of 3 µsec between TXD and the K-line, even without the acceleration capacitor connected to R10.
The signal on the K-line is quite clean, but the positive slope is the slowest: it's "bent" at the top due to the cable capacitance towards the car (approximately 3 meters, shielded) in combination with the 3.3k pull-up resistor.
I'm gradually realizing that our adapters probably work quite differently, even though they are based on the same circuit diagram... Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:34.
|
|
| Back to top |
Profile PM Garage |
 |
AndyO Guest
Free account, no CAN development support
|
29-12-2002, 20:08 Subject: PC817: Troubleshooting and Repair Guide |
Quote |
|
The proposed PC817.
P.S. Do you have NetMeeting? If so, give me a call at 80.133.184.81.
Translated on 22-09-2026, 21:36.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
29-12-2002, 20:19 Subject: PC817: Troubleshooting and Solutions |
Quote |
|
AndyO wrote: | The proposed PC817.
P.S. Do you have Netmeeting? If so, please call me at 80.133.184.81. |
Hi Andi,
I'm not familiar with Netmeeting, so I probably don't have it  .
We can continue via email (I just received a notification that one I sent to you bounced). Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:37.
|
|
| Back to top |
Profile PM Garage |
 |
AndyO Guest
Free account, no CAN development support
|
29-12-2002, 20:33 Subject: Delay on Rising K-Edge Slope |
Quote |
|
Hello Ulf,
I have tested the K-line with and without a load (12V square wave at 40 kHz applied to R3). I observe a delay of approximately 6 microseconds on the rising edge of the K-line and about 1 microsecond on the falling edge. Without the acceleration capacitors, the rising edge values were about 5 times slower. What delay do you observe under the same conditions?
Translated on 22-09-2026, 21:38.
|
|
| Back to top |
|
 |
ulf Profi-Schrauber

Joined: 04/13/2002 Posts: 11058 Karma: +18 / -0 Location: Saarland 2023 MG ZS Premium Support
|
29-12-2002, 21:17 Subject: Delay on Rising K-Edge: Analysis & Explanation |
Quote |
|
AndyO wrote: | | I have investigated the K-Line with and without load (12V square wave at 40 kHz applied to R3). The delay on the rising K-edge is approximately 6us for me. On the falling edge, it is about 1us. Without the acceleration capacitors, the rising values were about 5 times slower. What delay do you experience under the given conditions? |
Hi Andi,
It looked similar to what you described, but without the capacitors.
Delay in OK is approximately 8 µsec, and another approximately 8 µsec in T2 when the input is disabled, resulting in a rising K-edge.
So, during the transition from High to Low on TXD, the total time difference between TXD and K is approximately 16 microseconds. Similarly, during the transition from Low to High on TXD, the total time difference is also approximately 1 microsecond.
Connecting a 4.7 kOhm resistor in series with R3 reduced the 16 µsec to approximately 3 µsec, with 12 volts acting as the high level on the TXD pin.
A further reduction in the input current at TXD extended the duration of the TXD low-to-high transition to K, because T2 became slower in its conductivity.
Therefore, in version 2.3, I included a 10k potentiometer in series with R1 and R3. This allows you to adjust the entire circuit to match the high voltage of the PC-COM port, and achieve the optimal minimum run times between TXD and K while maintaining a constant pulse duration. Gruß Ulf
_________
MG4 Electric
Translated on 22-09-2026, 21:40.
|
|
| Back to top |
Profile PM Garage |
 |
rabbit01 Guest
Free account, no CAN development support
|
30-12-2002, 13:40 Subject: Simulate Ulf Adapters with PSpice |
Quote |
|
Hi,
'He gave me some tips on how to simulate Ulf's adapter using PSpice. I don't have an oscilloscope or a VCC pulse generator available, but you can simulate various VCC sources in PSpice and measure a lot of things.'
My problem is with these 'stupid' optocouplers, like the PC817 or 847,...
I can't find a corresponding component for it in the libraries.
'An optocoupler is included, but it has 5 pins, and how do I connect it...?'
I'm also having trouble with the LEDs; are there any ready-made components available in DIP packages?
Otherwise, no problem. If I were to make my results available, it might be very helpful to know where there is likely to be a lot of voltage when searching for a soldering error  .
@ulf
'In my experience, writing a program for runtime testing is quite difficult. It likely needs to be written in C++, and you need to have a good understanding of how to interface with the serial port and how to capture signals in real-time. As I said, it might be difficult to find someone who can do that. However, the idea of testing in this way and optimizing the adapter's quality is a good one!'
Regards,
Florian.
Translated on 22-09-2026, 21:44.
|
|
| Back to top |
|
 |
|