-
Installed and working
05/31/2018 at 11:50 • 0 commentsgetting the pro micro installed in the DICE module was rather straight forward with power and signals all coming straight of the multiplexer. The microcontroler board is just stuck to the top of the mux with double sided tape.
-
DICE connections
05/29/2018 at 12:33 • 0 commentsI just hooked the DICE up without its case and made some measurements and to confirm I had the right pins.
Yep it all looks good - Ive updated the image with markings for the pick up points for the blinkers and the power supply.
Ill hopefully get a chance later today to solder the Arduino in and give it a go.
The multiplexer (74HC151) second from the left is the chip we need to attach to.
Pin 1 Left blinker input
Pin 2 Right blinker input
Pin 16 +5V
Pin 8 0V
-
Firtst Attempt
05/29/2018 at 12:30 • 0 commentsAfter the blinker has been held on for while when it turns off if there is a bit of contact bounce it will latch the blinker for 3 seconds. its not a show stopper but Id like to rectify it. In reality it may rarely occur as the blinker switch contacts are a bit more robust than my dodgey piece of wire. Ive been playing around with some techniques to debounce it but nothing is really working out.
It may be that I rewrite without using interrupts and poll the input but ill leave it like it is at the moment if you want to have a play here is what I have so far.
/* Implementation of 3 second "auto" blinkers for SAAB9-5 by SAABAus Sept 2017 * uses pins 2 and 3 as inputs untill required than change to outputs to hold the blinker on. */ int Blink_left = 2; // Left Blinker switch on pin 2 int Blink_right = 3; // Right Blinker Switch on Pin 3 int debounceTime = 200; // debounce lock out time bool Blink_left_status = 0; // Store for the current status of the Left blinker bool Blink_right_status = 0; // Store for the Current Status of the Right Blinker unsigned long debounce = 0; // unsigned long trigger = 0; unsigned long Time_start = 0; unsigned long OnTime = 3000; // Time blinkers stay on for in ms void Right_Blink () { if (millis()- debounce > debounceTime) { if (Blink_left_status == 1) //check to see if the left blinker is on { Blink_left_status = 0; // if it is turn it off digitalWrite(Blink_left, LOW); pinMode (Blink_left, INPUT); } else { Blink_right_status = 1; // if the left blinker wasnt on turn on the right blinker pinMode (Blink_right, OUTPUT); // set the right pin to an output digitalWrite (Blink_right, HIGH); // turn on the right blinker Time_start = millis(); // Starts the 3 second timer } debounce = millis(); } } void Left_Blink () { if (millis() - debounce > debounceTime) { if (Blink_right_status == 1) //check to see if the right blinker is on { Blink_right_status = 0; // if it is turn it off digitalWrite(Blink_right, LOW); pinMode(Blink_right, INPUT); } else { Blink_left_status = 1; // if the right blinker wasnt on turn on the left blinker pinMode (Blink_left, OUTPUT); // set the left pin to an output digitalWrite (Blink_left, HIGH); // turn on the left blinker Time_start = millis(); // Starts the 3 second timer } debounce = millis(); } } void Blinker_reset() // checks to see which blinker is on and turns it off { if (Blink_right_status != 0) { Blink_right_status = 0; // Sets status to off digitalWrite (Blink_right, LOW); // Turns off blinker pinMode (Blink_right, INPUT); // Returns to listening to blinker switch } if (Blink_left_status !=0) { Blink_left_status = 0; // Sets status to off digitalWrite (Blink_left, LOW); // Turns off blinker pinMode (Blink_left, INPUT); // Returns to listening to blinker switch } } void setup() { // put your setup code here, to run once: pinMode (13, OUTPUT); attachInterrupt (digitalPinToInterrupt (Blink_left), Left_Blink, RISING); //when the left blinker switch goes high call the left blinker ISR attachInterrupt (digitalPinToInterrupt (Blink_right), Right_Blink, RISING); //when the right blinker switch goes high call the right blinker ISR } void loop() { if (Blink_left_status == 1) //this little section is for working out how to deal with the bouncing switch on release after the blinker has been on for a while { digitalWrite(13, HIGH); // built in LED dipsplays the what the arduino thinks is the status the left hand blinker } else { digitalWrite(13, LOW); } if (millis() > (Time_start + OnTime)) { // if more than the alloted time has elapsed check to to see which blinke ris on and turn it off Blinker_reset(); } }
-
Basic parameters
05/29/2018 at 12:27 • 0 commentsThe basic parameters Im going to work on (additional functions can be added later) are.
A tap on the blinker stalk will latch the blinker input for 3 seconds.
subsequent taps on the same direction during the 3 second period will have no effect.
A tap from the other direction during the 3 second period will cancel the blinking.
-
oops
05/29/2018 at 12:26 • 0 commentsoops its not the fat 1Ks that need soldering too but the little 47Ks but there is a bit of space there
-
Repeatability
05/29/2018 at 12:25 • 0 commentsWhen I was writing that I was thinking about that very possibility of others wanting to duplicate it - so I will do the Arduino version.
An arduino version would connect to exactly the same points in the DICE, the coating scrapes off pretty easy with a knife or even a screwdriver. and you could solder onto the 1k resistor terminals pretty easy, just need to find a suitable point to pick up power.
the 1K resistors are the big fat ones near the top of the image Im on the road for work this week and dont have all my notes with me but ill post exactly where to connect when I get back home.
-
How do the blinkers work?
05/29/2018 at 12:23 • 0 commentsI traced out the blinker inputs to the DICE my premise was that the 12v signal from the blinker switch had to be down converted to 5V for the microprocessor and I intend on using a 5v micro to implement the mod.
The 12V Blinker Activation signal from the stalk comes into the DICE on pins 20 and 44. When 12V is applied to pin 20 the left blinker activates and 12V on pin 44 activates the right blinker.
Inside the DICE pin 44 connects to ground via a 1K resistor. This makes sure the input is off when the blinker is not activated.
Pins 20 and 44 also connect via a 47K resistor to a couple of pins of an 8 input Multiplexer chip (74HC151). This 47K resistor basically handles the level shifting from 12 to 5V it just limits the current sufficiently to prevent any damage to the multiplexer and this provides the ideal spot to detect the blinker activation and inject the 3 second latching signal.
As I dont need to worry about level shifting, current limiting or input protection as its already been done in the DICE i can go for a minimum component count solution. This is still early days in the development but I believe I can do it with one component.
I could use an Arduino board or similar, there is tons of room in the DICE but I can do better than that. For no other reason than I can and its cheap Im planing to use a PIC10F200T E/OT this is only a 6 pin package and has built in oscillator so 2 pins for power and ground 2 pins for left and right and i have spare pins, hmm what else can I do ??
These things are freakin tiny 3.1mm x 1.8mm thats like the size of a grain of rice. Drop it on the floor and its gone .....
Ill glue it to the top of the multiplexer and solder wires directly from the legs of the micro down to the corresponding legs of the multiplexer.
I expect to be able to set the pin as an input which "listens" for the blinker activation. If the blinker activation is only brief say 100ms then the pin will switch from and input to an output and go high for 3 seconds then revert back to an input.
If the other pin detects a signal during the 3 second period that will cancel the timer and revert it all back to listening again.