Page 15 of 20 FirstFirst ... 51314151617 ... LastLast
Results 141 to 150 of 191

Thread: Golf mk7: Auto Start/Stop disable switch - who wants to help?

  1. #141
    Join Date
    Sep 2013
    Location
    Victoria
    Posts
    1,815
    Users Country Flag Thread Starter

    ^^^ OK - 2 Volts will be a problem with my design.

    The "Opto-coupler" is the 4N28 in my circuit (it's a gallium arsenide infrared LED, which is "optically coupled" to a monolithic silicon phototransistor).

    You can't remove the 1K resistor because LEDs are current devices, they generate heat which increases current, which increases heat - result is thermal runaway and destruction!! Here's the spec for the electrical characteristics of the LED in the opto-coupler (it's from the 4N28 datasheet):


    If the 1K resistor is removed, the full 2Volts will be applied across the led. The chart says, that the LED will readily take about 500 mA with that level of forward voltage - if indeed the BCM pin could supply this level of amps. More likely, I suspect that something inside the BCM would saturate to limit current flow - but with only 2 Volts, it's entirely unknown if the LED in the opto-coupler would illuminate sufficiently to turn-on the photo transistor.

    The real problem is that we just don't know the electrical capabilities of pin #60 (socket C) on the BCM as a source of supply. This pin was designed by VW to be an input source- not to be an output source for an external device. So the trick is to make sure that any parasitic current drain for P3 on the Digispark is not seen by the BCM as being too much load.

    My original design was very conservative and I tried to totally isolate my add-on circuit from the inner workings of the BCM.

    As I said, with 2 volts, I suspect that some form of ultra-low volt switch is needed. Perhaps you could consider a FET switch since these require very little drive current and they can be designed to switch ON/OFF at low voltages.

    Don
    Please don't PM to ask questions about coding, or vehicle repairs. The better place to deal with these matters is on-line, in the forum proper. That way you get the benefit of the expertise of the wider forum! Thank you.

  2. #142
    Thanks for the reply don.

    I have since decided against the press and hold to switch on/off the killswitch. I mean, the reason people put these in is to turn the switch off every time. If you were worried when getting it serviced, its a 5 second thing to unclip the surround, and unplug the killswitch.

  3. #143
    Hi guys!
    I made my own clone with digispark and 3 optocouplers for reading the button state back.
    If it works (I will be testing it this week) and there is anybody that would want i can produce the diagrams, but it's a simple permutation of Don's circuit.

    I will publish my code now though, in case anyone is interested. It does exactly what Don suggested a couple of posts ago (is able to disable the system if you keep the SS button pressed when switching the ignition on and waiting for about 8-10 seconds). It also should draw less current from the source, but it should not matter it is just is something 'for free'.

    PSA: The pinouts in the code are different than what the Don's circuits had, so you would need to take this into account when using the code.

    Code:
    #include <avr/interrupt.h>
    #include <avr/power.h>
    #include <avr/sleep.h>
    #include <avr/eeprom.h>
    #include <avr/wdt.h>
    
    const byte ENABLED_BYTE = 0x55;
    const byte DISABLED_BYTE = 0xAA;
    
    const byte MAX_PULSES = 3;
    
    const byte SS_SWITCH_OUT = 0; // opto for controlling the SS state
    const byte DBG_LED_OUT = 1; // debug led
    const byte SS_SWITCH_IN = 2; // opto for reading the SS state
    const byte SS_LED_IN = 4; // opto for reading the SS off led state
    
    void setup() {
      // I/O modes
      pinMode(SS_SWITCH_OUT, OUTPUT);
      pinMode(DBG_LED_OUT, OUTPUT);
      pinMode(SS_SWITCH_IN, INPUT);
      pinMode(3, INPUT); // unused
      pinMode(SS_LED_IN, INPUT);
    
      digitalWrite(SS_SWITCH_OUT, LOW);
      digitalWrite(DBG_LED_OUT, LOW);
      digitalWrite(SS_SWITCH_IN, LOW);
      digitalWrite(3, HIGH); // unused, enable pullup to reduce floating pins
      digitalWrite(SS_LED_IN, LOW);
    
      light(LOW);
    
      // disable unused peripherals
      power_timer0_disable();
      power_usi_disable();
      power_adc_disable();
    
      ADCSRA = 0;
    
      // maximum sleep mode
      set_sleep_mode(SLEEP_MODE_PWR_DOWN);
    }
    
    void loop() {
      // (boot loader takes ~5s)
      
      // read persistend enabled state
      byte enabled = (eeprom_read_byte(0x0000) != DISABLED_BYTE); //(!= DISABLED_BYTE, since the EEPROM is initialized as 0xFF and we want this to mean ENABLED also)
    
      // read the button state 
      byte ssPressed = digitalRead(SS_SWITCH_IN);
      if (ssPressed) {
        // (blinks with led will delay by an additional ~2560ms)
        blink(1);
        blink(1);
      }
    
      // after waiting reread the button state again - if it is still pressed, then swap the disabled info
      if (ssPressed && digitalRead(SS_SWITCH_IN)) {
        blink(8);
    
        enabled = !enabled;
    
        // persist
        eeprom_write_byte(0x0000, enabled ? ENABLED_BYTE : DISABLED_BYTE);
      }
    
      if (enabled) {
        blink(2); // blink 2 times to mark enabled
       
        byte counter = 0;
        
        while (counter++ < MAX_PULSES && digitalRead(SS_LED_IN) == HIGH) {
          blink(1); // blink once for every retry
      
          digitalWrite(SS_SWITCH_OUT, HIGH);
          delay(1024);
          digitalWrite(SS_SWITCH_OUT, LOW);
          delay(512);
        }
      }
    
      blink(3); // blink 3 times as a bye bye
    
      // disable everything else, for minimal power consumption
      power_all_disable();
      power_timer1_disable();
      wdt_disable();
      noInterrupts();
    
      while(1) {
        sleep_enable();
        sleep_mode();
    
        // should not happen
    
        sleep_disable();
      }
    }
    
    volatile byte currentState = LOW;
    void blink(int times) {
      while(times--) {
        digitalWrite(DBG_LED_OUT, LOW);
        delay(128);
        digitalWrite(DBG_LED_OUT, HIGH);
        delay(128);
        digitalWrite(DBG_LED_OUT, LOW);
      }
    
      delay(1024);
      digitalWrite(DBG_LED_OUT, currentState);
    }
    
    void light(byte state) {
      currentState = state;
      
      digitalWrite(DBG_LED_OUT, currentState);
    }

  4. #144

    Question

    Hi there!
    First of all, thank you very much Don for the circuit and other support on the forums!

    I have created my own version of the circuit (this is how I like to learn new things, and I just needed to understand it first). I also wanted the disabling functionality when going to the dealer, so I would have less explaining to do and I am quite lazy so I did not want to disconnect the module every time like wookie_666 .

    If anyone could verify my circuit, before I stick it into my car that would be great (I am not an EE and this is my first time making a circuit)

    I had changed the pinout, so the Don's circuit translates to this one as follows:
    P3 is now P0
    P2 is now P4

    The P0 pin is now sensing the SS switch state using a third optocoupler.

    I also have un-soldered the power led from the digispark and currently the peak current while the circuit is working is below 45mA and it drops to ~8-5mA while in the sleep state (not that it matters really).

    Since the code below enables the internal pull-ups on the unused pins, do not solder the unused pins to ground, since they will be high and you could damage your chip.

    Here is the code:
    Code:
    #include <avr/power.h>
    #include <avr/sleep.h>
    #include <avr/eeprom.h>
    #include <avr/wdt.h>
    
    const byte MAX_PULSES = 5;
    
    const byte SS_LED_IN = 0; // P3 -> P0
    const byte DBG_LED_OUT = 1;
    const byte SS_SWITCH_IN = 2;
    const byte SS_SWITCH_OUT = 4; // P2 -> P4
    const byte UNUSED_0 = 3;
    const byte UNUSED_1 = 5;
    
    const byte ENABLED_BYTE = 0x55;
    const byte DISABLED_BYTE = 0xAA;
    
     void setup() {
      // I/O modes
      pinMode(SS_SWITCH_OUT, OUTPUT);
      pinMode(DBG_LED_OUT, OUTPUT);
      pinMode(SS_SWITCH_IN, INPUT);
      pinMode(SS_LED_IN, INPUT);
      pinMode(UNUSED_0, INPUT); // unused
      pinMode(UNUSED_1, INPUT); // unused
    
      // I/O states
      digitalWrite(SS_SWITCH_OUT, LOW);
      digitalWrite(DBG_LED_OUT, LOW);
      digitalWrite(SS_SWITCH_IN, LOW);
      digitalWrite(SS_LED_IN, LOW);
      digitalWrite(UNUSED_0, HIGH); // unused
      digitalWrite(UNUSED_1, HIGH); // unused
    
      light(LOW);
    
      // disable unused peripherals (timer1 is required for delay)
      power_timer0_disable();
      power_usi_disable();
      power_adc_disable();
    
      ADCSRA = 0;
    
      // maximum sleep mode
      set_sleep_mode(SLEEP_MODE_PWR_DOWN);
    }
    
    void loop() {
      // boot loader takes ~5s
    
      // read persistend enabled state
      byte enabled = (eeprom_read_byte(0x0000) != DISABLED_BYTE); // treat everything not equal to DISABLED_BYTE as enabled
    
      // read the button state 
      byte ssPressed = digitalRead(SS_SWITCH_IN);
      if (ssPressed) {
        // blinks with led will delay by an additional ~1s each
        blink(1);
        blink(1);
      }
    
      // after waiting reread the button state - if it is still pressed, then swap the disabled info
      if (ssPressed && digitalRead(SS_SWITCH_IN)) {
        blink(2);
    
        enabled = !enabled;
    
        // save to eeprom
        eeprom_write_byte(0x0000, enabled ? ENABLED_BYTE : DISABLED_BYTE);
      } else if (enabled) {
        byte counter = 0;
    
        while (counter++ < MAX_PULSES && digitalRead(SS_LED_IN) == HIGH) {
          blink(1); // blink once for every retry
      
          digitalWrite(SS_SWITCH_OUT, HIGH);
          delay(1024);
          digitalWrite(SS_SWITCH_OUT, LOW);
        }
      }
    
      blink(3); // blink 3 times as a bye bye
    
      // disable everything else, for minimal power consumption
      power_all_disable();
      power_timer1_disable();
      wdt_disable();
      noInterrupts();
    
      sleep_enable();
      while(1) {
        sleep_mode();
    
        // should not happen
      }
    }
    
    volatile byte currentState = LOW;
    
    // blinks n-times, and delays by n*192ms + 832ms, eg. 1 blink = 1024ms, 2 blinks = 1216ms
    // after blinking leaves the LED in the same state it was in (currentState)
    void blink(int times) {
      while(times--) {
        digitalWrite(DBG_LED_OUT, LOW);
        delay(96);
        digitalWrite(DBG_LED_OUT, HIGH);
        delay(96);
        digitalWrite(DBG_LED_OUT, LOW);
      }
    
      delay(832);
      digitalWrite(DBG_LED_OUT, currentState);
    }
    
    // changes the state of the LED
    void light(byte state) {
      currentState = state;
    
      digitalWrite(DBG_LED_OUT, currentState);
    }
    The simplified flow diagram:
    (the above picture has an error, it should be SS LED lit? OR <5 pulses sent?)

    And the schematics:


    And the finished product (need to clean it up and isolate it):

  5. #145
    Hi guys,
    I am writing this third time, since I failed to see the big notice above about the requirement to post in the newbies corner first

    I have created my own version of the circuit (since this is the way a learn new things), that has the disabling capability for the module without the need to remove it before visiting the dealership (I do not like to take apart the interior). The idea is to keep the SS switch pressed for about 8 seconds after switching the ignition on.

    I changed the pinouts, so:
    P2 is now P4
    P3 is now P0

    and P2 is configured (using a third optocoupler) to sense the SS state for disabling purposes (of the module).

    If anyone could verify my circuit before I stuck it into my car and break something since I am an amateur, not an EE and this is my first circuit.

    Golf mk7: Auto Start/Stop disable switch - who wants to help?-flow-png
    (there is an error instead of SS LED is lit? AND <5 pulses sent? it should be: SS LED list? OR <5 pulses sent? also not disable module, but disable or enable module)

    Schematic:
    Golf mk7: Auto Start/Stop disable switch - who wants to help?-ssss-sch-png

    And the final build that still needs to be cleaned up and isolated:
    Golf mk7: Auto Start/Stop disable switch - who wants to help?-fin-jpg

    And the code (take care, since pullups are enabled on the unused pins so do not short them to ground):
    Code:
    #include <avr/power.h>
    #include <avr/sleep.h>
    #include <avr/eeprom.h>
    #include <avr/wdt.h>
    
    const byte MAX_PULSES = 5;
    
    const byte SS_LED_IN = 0; // P3 -> P0
    const byte DBG_LED_OUT = 1;
    const byte SS_SWITCH_IN = 2;
    const byte SS_SWITCH_OUT = 4; // P2 -> P4
    const byte UNUSED_0 = 3;
    const byte UNUSED_1 = 5;
    
    const byte ENABLED_BYTE = 0x55;
    const byte DISABLED_BYTE = 0xAA;
    
    void setup() {
      // I/O modes
      pinMode(SS_SWITCH_OUT, OUTPUT);
      pinMode(DBG_LED_OUT, OUTPUT);
      pinMode(SS_SWITCH_IN, INPUT);
      pinMode(SS_LED_IN, INPUT);
      pinMode(UNUSED_0, INPUT); // unused
      pinMode(UNUSED_1, INPUT); // unused
    
      // I/O states
      digitalWrite(SS_SWITCH_OUT, LOW);
      digitalWrite(DBG_LED_OUT, LOW);
      digitalWrite(SS_SWITCH_IN, LOW);
      digitalWrite(SS_LED_IN, LOW);
      digitalWrite(UNUSED_0, HIGH); // unused
      digitalWrite(UNUSED_1, HIGH); // unused
    
      light(LOW);
    
      // disable unused peripherals (timer1 is required for delay)
      power_timer0_disable();
      power_usi_disable();
      power_adc_disable();
    
      ADCSRA = 0;
    
      // maximum sleep mode
      set_sleep_mode(SLEEP_MODE_PWR_DOWN);
    }
    
    void loop() {
      // boot loader takes ~5s
    
      // read persistend enabled state
      byte enabled = (eeprom_read_byte(0x0000) != DISABLED_BYTE); // treat everything not equal to DISABLED_BYTE as enabled
    
      // read the button state 
      byte ssPressed = digitalRead(SS_SWITCH_IN);
      if (ssPressed) {
        // blinks with led will delay by an additional ~1s each
        blink(1);
        blink(1);
      }
    
      // after waiting reread the button state - if it is still pressed, then swap the disabled info
      if (ssPressed && digitalRead(SS_SWITCH_IN)) {
        blink(2);
    
        enabled = !enabled;
    
        // save to eeprom
        eeprom_write_byte(0x0000, enabled ? ENABLED_BYTE : DISABLED_BYTE);
      } else if (enabled) {
        byte counter = 0;
    
        while (counter++ < MAX_PULSES && digitalRead(SS_LED_IN) == HIGH) {
          blink(1); // blink once for every retry
      
          digitalWrite(SS_SWITCH_OUT, HIGH);
          delay(1024);
          digitalWrite(SS_SWITCH_OUT, LOW);
        }
      }
    
      blink(3); // blink 3 times as a bye bye
    
      // disable everything else, for minimal power consumption
      power_all_disable();
      power_timer1_disable();
      wdt_disable();
      noInterrupts();
    
      sleep_enable();
      while(1) {
        sleep_mode();
    
        // should not happen
      }
    }
    
    volatile byte currentState = LOW;
    
    // blinks n-times, and delays by n*192ms + 832ms, eg. 1 blink = 1024ms, 2 blinks = 1216ms
    // after blinking leaves the LED in the same state it was in (currentState)
    void blink(int times) {
      while(times--) {
        digitalWrite(DBG_LED_OUT, LOW);
        delay(96);
        digitalWrite(DBG_LED_OUT, HIGH);
        delay(96);
        digitalWrite(DBG_LED_OUT, LOW);
      }
    
      delay(832);
      digitalWrite(DBG_LED_OUT, currentState);
    }
    
    // changes the state of the LED
    void light(byte state) {
      currentState = state;
    
      digitalWrite(DBG_LED_OUT, currentState);
    }
    Last edited by psobiech; 29-11-2017 at 06:16 AM. Reason: Minor fixes

  6. #146
    Join Date
    Sep 2013
    Location
    Victoria
    Posts
    1,815
    Users Country Flag Thread Starter
    ^^^ hmm.............. looks liked a very good modification to my original design - well done and congratulations!!!!

    Still trying to understand your design, but it appears that you have stuck-with a Digispark (rather than the Pro). And I do like the "bye bye" pulses as a feedback to the driver!!

    My only concern is the workability of the input pulse to the PB2 ciruit (from the Blue/Black wire). It looks like you have used my original 1K resistor to ballast the current to the LED in the opto-coupler. My original assumption was that the internal circuit in the BCM ( to pin 60, Socket C) was some type of open collector logic signal. But if wookie's later advice is correct, the available voltage to drive the opto-coupler is just 2 Volts on the Blue/Black wire. As I said previously, this wire was designed by VW to be a low current input signal to the BCM, but both our circuits need this wire to drive an LED in an opto-coupler with sufficient current so that the gain in the photo-transistor changes state. Will 2 Volts be sufficient to do this? Again as I said, I suspect that some sort of low voltage, low current ciruit is needed (FET device?), but I'm not sure!!

    But a very good job!!!

    Don
    Please don't PM to ask questions about coding, or vehicle repairs. The better place to deal with these matters is on-line, in the forum proper. That way you get the benefit of the expertise of the wider forum! Thank you.

  7. #147
    ...anybody willing to send/sell a complete / working item (to Italy) ??


  8. #148
    Join Date
    Sep 2013
    Location
    Victoria
    Posts
    1,815
    Users Country Flag Thread Starter
    Quote Originally Posted by halfmillion View Post
    ...anybody willing to send/sell a complete / working item (to Italy) ??

    Arrh.......... connazionale (long ago in a previous generation)!!!

    first, you will need to make sure how the SS disable button on your car is wired. On the RoW mk7s that are sold down here in the deep south, one side of the SS disable button on the center console is earthed. But I'm not sure how the SS disable button on an Italian market "Skoda Octavia Scout 4x4 184cv dsg with Columbus" is wired.

    Don
    Please don't PM to ask questions about coding, or vehicle repairs. The better place to deal with these matters is on-line, in the forum proper. That way you get the benefit of the expertise of the wider forum! Thank you.

  9. #149
    Quote Originally Posted by DV52 View Post
    Arrh.......... connazionale (long ago in a previous generation)!!!
    nice to know! Il mondo è piccolo (...world is small!)

    first, you will need to make sure how the SS disable button on your car is wired. On the RoW mk7s that are sold down here in the deep south, one side of the SS disable button on the center console is earthed. But I'm not sure how the SS disable button on an Italian market "Skoda Octavia Scout 4x4 184cv dsg with Columbus" is wired.

    Don
    Octavia RoW has exactly the same pinout used in Golf (minus version, earthed). I used for a while a copy of this circuit born2bastel >> Start-Stop Automatik deaktivieren mit Memoryfunktion, which stopped working at the beginning of our summer (poor construction quality maybe)

  10. #150
    Join Date
    Jan 2014
    Location
    Queensland
    Posts
    211
    Users Country Flag

    OBDeleven - sorted


Page 15 of 20 FirstFirst ... 51314151617 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
| |