![]() |
|
|||||||
| Custom Dodge Caliber Exterior Modifications - Body Mods - Body Kits All mods on the outside of your Dodge Caliber. Custom Dodge Caliber Body Kits, Custom Paint, Grilles, Shaving, Debadging, Aftermarket Parts, etc. |
Dodge Caliber Accessories - Vendor News! |
||||||||||||||||||
| Vendor News! Dodge Caliber Parts and Accessories! | ||||||||||||||||||
|
![]() |
|
|
Thread Tools |
|
#41
|
|||
|
|||
|
CODE FINISHED!
Ok, after many hours yesterday, the keypad is wired in. It works fully, and I finished ALL the software for it. But it wasn't easy. You see, I realized that on my board that I have for the car, I can't connect the arduino to the keypad AND the arduino to the PC. The plug connections interfere with each other. This would not be the case with my latest board (that HAS shipped now, but isn't here yet) I really wanted to see what was going on, to make writing and testing new features better, so I made ANOTHER test keypad. This was made strickly with what I could get from Radioshack THAT DAY(expensive) with the exception of those headers already. ![]() http://www.flickr.com/photos/43268066@N00/3625033355/ I really didn't want to pull the real keypad back out of the door anyway. With the help of my new keypad, I have finalized my code. I've tried my best to emulate the Ford Keypads as much as possible. Instructions: To unlock the car, type in the 5-digit 'factory' code. To lock the car, press the last two buttons together. After too many unsuccessful attempts to type in a code, the keypad will flash and ignore input for one minute. Program up to three additional 'user' codes (stored in EEPROM): Type the 'factory' code, then 1, then a new 5-digit code, and finish by pressing one of the first three buttons. Your new user code is now saved to that position. The car will confirm by locking and unlocking the doors. You can overwrite the code by saving another to the same position. Erase all user codes: Type the 'factory' code, then 1, then press 1 again and hold for two seconds. The car will confirm by locking and unlocking the doors. Time out (reset input keys) after programmable time (default 5 seconds). All key presses must be pressed within this time from each other to be considered together. The backlight will turn off after timeout. The finalized code is in the door, fully working. When I get my new board in and fix a problem with my wire mounts in the door I'll post pics of the wiring side. Last edited by neonpolaris; 06-14-2009 at 01:40 PM. |
| Sponsored links |
|
|
|
#42
|
|||
|
|||
|
For those interested, here is the sourcecode:
Code:
// Car Keypad // Version 1.0 // // Michael Casson Rogers (michael.casson@yahoo.com) // June 14th, 2009 // // I designed this program to emulate a Ford keypad as much as possible. I missed the one on my Lincoln. // // To unlock the car, type in the 5-digit 'factory' code. // To lock the car, press the last two buttons together. // // Program up to three additional 'user' codes: // Type the 'factory' code, then 1, then a new 5-digit code, and finish by pressing one of the first three buttons. // Your new user code is now saved to that position. The car will confirm by locking and unlocking the doors. // You can overwrite the code by saving another to the same position. // // Erase all user codes: // Type the 'factory' code, then 1, then press 1 again and hold for two seconds. The car will confirm by locking // and unlocking the doors. // // Input keys are assigned values 1, 3, 5, 7, and 9. // // Time out (reset input keys) after programmable time (default 5 seconds). All key presses must be pressed within // this time from each other to be considered together. The backlight will turn off after timeout. // // Big thanks to Gian Pablo Villamil. I used his Simple Simon 2.0 to get me started. // http://itp.nyu.edu/~gpv206/2006/09/simple_simon_v2.html // // and thanks to the many helpful people at Arduino Forum! // http://www.arduino.cc // For reading and storing user generated codes. #include <EEPROM.h> // Define the pin assignments for the input switches #define KeyPin1 10 #define KeyPin3 9 #define KeyPin7 8 // Define backlight pin. #define BackLight 19 // Define the pins the lock and unlock relays are connected to. #define LockPin 15 #define UnlockPin 16 #define DebounceTime 20 // debounce time in milliseconds #define PulseTime 150 // debounce time in milliseconds #define TimeOutTime 5000 // timeout in milliseconds int CodeArray[5] = {1, 3, 5, 7, 9}; // Enter desired combination code here, must be 5 digits. Use only 1, 3, 5, 7, and 9. int InputArray[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Starts InputArray with all 0's int UserCodeArray1[5] = {EEPROM.read(0), EEPROM.read(1), EEPROM.read(2), EEPROM.read(3), EEPROM.read(4)}; int UserCodeArray2[5] = {EEPROM.read(5), EEPROM.read(6), EEPROM.read(7), EEPROM.read(8), EEPROM.read(9)}; int UserCodeArray3[5] = {EEPROM.read(10), EEPROM.read(11), EEPROM.read(12), EEPROM.read(13), EEPROM.read(14)}; int buttonPressed = 0; int buttonPresses = 0; // Remember when last press was for timeout function. // Also, set lastPress as having just timed out so that the backlight doesn't light for the first few // seconds on initialization because lastPress and millis are both zero. unsigned long lastPress = millis() - (TimeOutTime + 1); // counter for debouncing routine unsigned long SwitchDownTime ; // Define inputScore (used to compare InputArray to CodeArray) int inputScore = 0 ; void setup () { //Serial.begin(9600); // set up Serial library at 9600 bps, used for debugging. pinMode(BackLight, OUTPUT); pinMode(LockPin, OUTPUT); pinMode(UnlockPin, OUTPUT); pinMode(KeyPin1, INPUT); pinMode(KeyPin3, INPUT); pinMode(KeyPin7, INPUT); } // Main loop - should be easy to follow void loop () { // Serial.println("loop"); getInput (); timeOut (); antiScan(); } // Get the user's button presses and store it in InputArray void getInput () { // Serial.println("getInput"); //Button 1 if (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == HIGH) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == HIGH) { // Wait while a button is pressed if (millis() - SwitchDownTime > DebounceTime && buttonPressed == 0) { // If button has been down longer than debounce buttonPress(1); } if (millis() - SwitchDownTime > 2000 && InputArray[5] == CodeArray[0] && InputArray[6] == CodeArray[1] && InputArray[7] == CodeArray[2] && InputArray[8] == CodeArray[3] && InputArray[9] == CodeArray[4] && InputArray[10] == 0 && InputArray[11] == 1 && InputArray[12] == 2 && InputArray[13] == 1) { eraseUserCodes(); } } buttonPressed = 0; lastPress = millis() ; //Needed here also, in case button is held down for more than timeout value } // end if //Button 3 if (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == LOW) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == LOW) { // Wait while a button is pressed if (millis() - SwitchDownTime > DebounceTime && buttonPressed == 0) { // If button has been down longer than debounce buttonPress(3); } } buttonPressed = 0; lastPress = millis() ; //Needed here also, in case button is held down for more than timeout value } // end if //Button 5 if (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == HIGH) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == LOW && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == HIGH) { // Wait while a button is pressed if (millis() - SwitchDownTime > DebounceTime && buttonPressed == 0) { // If button has been down longer than debounce buttonPress(5); } } buttonPressed = 0; lastPress = millis() ; //Needed here also, in case button is held down for more than timeout value } // end if //Button 7 if (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == HIGH) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == HIGH) { // Wait while a button is pressed if (millis() - SwitchDownTime > DebounceTime && buttonPressed == 0) { // If button has been down longer than debounce buttonPress(7); } } buttonPressed = 0; lastPress = millis() ; //Needed here also, in case button is held down for more than timeout value } // end if //Button 9 if (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == LOW) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == HIGH && digitalRead(KeyPin7) == LOW) { // Wait while a button is pressed if (millis() - SwitchDownTime > DebounceTime && buttonPressed == 0) { // If button has been down longer than debounce buttonPress(9); } } buttonPressed = 0; lastPress = millis() ; //Needed here also, in case button is held down for more than timeout value } // end if //Button 7&9 (Lock) if (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == LOW) { SwitchDownTime = millis(); // Record time it went down (for debounce) digitalWrite(BackLight, HIGH); // Light backlight while pressed while (digitalRead(KeyPin1) == HIGH && digitalRead(KeyPin3) == LOW && digitalRead(KeyPin7) == LOW) { digitalWrite(LockPin, HIGH); // Wait while a button is pressed } digitalWrite(LockPin, LOW); lastPress = millis() - (TimeOutTime + 1); timeOut (); delay(200); //For when people let go of lock, it doesn't turn the light back on when one button is pressed longer (milliseconds!) than the other. } // end if } // end GetAnswer // Compare CodeArray with InputArray void checkAnswer () { // Serial.println("checkAnswer"); //// Print current InputArray for debugging // for (int i = 0; i <= 13; i++) { // Serial.print(InputArray[i]); // } // Serial.print(" "); // Serial.print(buttonPresses); // Serial.println(); //// End print current InputArray if (InputArray[7] == CodeArray[0] && InputArray[8] == CodeArray[1] && InputArray[9] == CodeArray[2] && InputArray[10] == CodeArray[3] && InputArray[11] == CodeArray[4] && InputArray[12] == 0 && InputArray[13] == 1) { buttonPress(2); buttonPresses = 0; } if (InputArray[0] == CodeArray[0] && InputArray[1] == CodeArray[1] && InputArray[2] == CodeArray[2] && InputArray[3] == CodeArray[3] && InputArray[4] == CodeArray[4] && InputArray[5] == 0 && InputArray[6] == 1 && InputArray[7] == 2 && InputArray[13] == 1) { // Serial.print("Adding New Code: "); // Serial.print(InputArray[7]); // Serial.print(InputArray[8]); // Serial.print(InputArray[9]); // Serial.print(InputArray[10]); // Serial.println(InputArray[11]); EEPROM.write(0, InputArray[8]); EEPROM.write(1, InputArray[9]); EEPROM.write(2, InputArray[10]); EEPROM.write(3, InputArray[11]); EEPROM.write(4, InputArray[12]); // Serial.println("New Code Added"); UserCodeArray1[0] = EEPROM.read(0); UserCodeArray1[1] = EEPROM.read(1); UserCodeArray1[2] = EEPROM.read(2); UserCodeArray1[3] = EEPROM.read(3); UserCodeArray1[4] = EEPROM.read(4); doorConfirm(); } if (InputArray[0] == CodeArray[0] && InputArray[1] == CodeArray[1] && InputArray[2] == CodeArray[2] && InputArray[3] == CodeArray[3] && InputArray[4] == CodeArray[4] && InputArray[5] == 0 && InputArray[6] == 1 && InputArray[7] == 2 && InputArray[13] == 3) { // Serial.print("Adding New Code: "); // Serial.print(InputArray[7]); // Serial.print(InputArray[8]); // Serial.print(InputArray[9]); // Serial.print(InputArray[10]); // Serial.println(InputArray[11]); EEPROM.write(5, InputArray[8]); EEPROM.write(6, InputArray[9]); EEPROM.write(7, InputArray[10]); EEPROM.write(8, InputArray[11]); EEPROM.write(9, InputArray[12]); // Serial.println("New Code Added"); UserCodeArray2[0] = EEPROM.read(5); UserCodeArray2[1] = EEPROM.read(6); UserCodeArray2[2] = EEPROM.read(7); UserCodeArray2[3] = EEPROM.read(8); UserCodeArray2[4] = EEPROM.read(9); doorConfirm(); } if (InputArray[0] == CodeArray[0] && InputArray[1] == CodeArray[1] && InputArray[2] == CodeArray[2] && InputArray[3] == CodeArray[3] && InputArray[4] == CodeArray[4] && InputArray[5] == 0 && InputArray[6] == 1 && InputArray[7] == 2 && InputArray[13] == 5) { // Serial.print("Adding New Code: "); // Serial.print(InputArray[7]); // Serial.print(InputArray[8]); // Serial.print(InputArray[9]); // Serial.print(InputArray[10]); // Serial.println(InputArray[11]); EEPROM.write(10, InputArray[8]); EEPROM.write(11, InputArray[9]); EEPROM.write(12, InputArray[10]); EEPROM.write(13, InputArray[11]); EEPROM.write(14, InputArray[12]); // Serial.println("New Code Added"); UserCodeArray3[0] = EEPROM.read(10); UserCodeArray3[1] = EEPROM.read(11); UserCodeArray3[2] = EEPROM.read(12); UserCodeArray3[3] = EEPROM.read(13); UserCodeArray3[4] = EEPROM.read(14); doorConfirm(); } //Entered Programming Mode, but tried to store in 7, not an option. if (InputArray[0] == CodeArray[0] && InputArray[1] == CodeArray[1] && InputArray[2] == CodeArray[2] && InputArray[3] == CodeArray[3] && InputArray[4] == CodeArray[4] && InputArray[5] == 0 && InputArray[6] == 1 && InputArray[7] == 2 && InputArray[13] == 7) { clearArray(); } //Entered Programming Mode, but tried to store in 9, not an option. if (InputArray[0] == CodeArray[0] && InputArray[1] == CodeArray[1] && InputArray[2] == CodeArray[2] && InputArray[3] == CodeArray[3] && InputArray[4] == CodeArray[4] && InputArray[5] == 0 && InputArray[6] == 1 && InputArray[7] == 2 && InputArray[13] == 9) { clearArray(); } if (InputArray[8] != 2 && InputArray[9] == CodeArray[0] && InputArray[10] == CodeArray[1] && InputArray[11] == CodeArray[2] && InputArray[12] == CodeArray[3] && InputArray[13] == CodeArray[4]) { success(); } if (InputArray[8] != 2 && InputArray[9] == UserCodeArray1[0] && InputArray[10] == UserCodeArray1[1] && InputArray[11] == UserCodeArray1[2] && InputArray[12] == UserCodeArray1[3] && InputArray[13] == UserCodeArray1[4]) { success(); } if (InputArray[8] != 2 && InputArray[9] == UserCodeArray2[0] && InputArray[10] == UserCodeArray2[1] && InputArray[11] == UserCodeArray2[2] && InputArray[12] == UserCodeArray2[3] && InputArray[13] == UserCodeArray2[4]) { success(); } if (InputArray[8] != 2 && InputArray[9] == UserCodeArray3[0] && InputArray[10] == UserCodeArray3[1] && InputArray[11] == UserCodeArray3[2] && InputArray[12] == UserCodeArray3[3] && InputArray[13] == UserCodeArray3[4]) { success(); } } void success () { // Serial.println("success"); digitalWrite(UnlockPin, HIGH); delay(PulseTime); digitalWrite(UnlockPin, LOW); buttonPress(0); buttonPresses = 0; } void timeOut () { // Serial.println("timeout"); if (millis() - lastPress > TimeOutTime) { clearArray(); digitalWrite(BackLight, LOW); lastPress = millis() - (TimeOutTime + 1); //lastPress follows millis() just outside of timeout, to prevent problems with millis rollover lighting backlight after 50 days buttonPresses = 0; } else { digitalWrite(BackLight, HIGH); } } void clearArray () { // Serial.println("clearArray"); for (int i = 0; i <= 13; i++) { InputArray[i] = 0; } } void buttonPress (int j) { // Serial.println("buttonPress"); if (millis() - SwitchDownTime > DebounceTime) { // If button was down longer than debounce InputArray[0] = InputArray[1]; InputArray[1] = InputArray[2]; InputArray[2] = InputArray[3]; InputArray[3] = InputArray[4]; InputArray[4] = InputArray[5]; InputArray[5] = InputArray[6]; InputArray[6] = InputArray[7]; InputArray[7] = InputArray[8]; InputArray[8] = InputArray[9]; InputArray[9] = InputArray[10]; InputArray[10] = InputArray[11]; InputArray[11] = InputArray[12]; InputArray[12] = InputArray[13]; InputArray[13] = j; lastPress = millis(); buttonPresses++; buttonPressed = 1; checkAnswer (); } // end if } void antiScan () { // Serial.println("antiScan"); if (buttonPresses >= 35) { for (int i = 0; i < 60; i++) { digitalWrite(BackLight, HIGH); // Light backlight while pressed delay(500); digitalWrite(BackLight, LOW); // Light backlight while pressed delay(500); } buttonPresses = 0; } } void doorConfirm () { // Serial.println("doorConfirm"); digitalWrite(LockPin, HIGH); delay(PulseTime); digitalWrite(LockPin, LOW); delay(400); digitalWrite(UnlockPin, HIGH); delay(PulseTime); digitalWrite(UnlockPin, LOW); clearArray(); buttonPresses = 0; // Serial.println("Confirmed"); } void eraseUserCodes () { // Serial.println("eraseUserCodes"); // Serial.println("Erase Mode Started"); EEPROM.write(0, 8); EEPROM.write(1, 8); EEPROM.write(2, 8); EEPROM.write(3, 8); EEPROM.write(4, 8); EEPROM.write(5, 8); EEPROM.write(6, 8); EEPROM.write(7, 8); EEPROM.write(8, 8); EEPROM.write(9, 8); EEPROM.write(10, 8); EEPROM.write(11, 8); EEPROM.write(12, 8); EEPROM.write(13, 8); EEPROM.write(14, 8); // Serial.println("Erase Mode Finished"); UserCodeArray1[0] = 8; UserCodeArray1[1] = 8; UserCodeArray1[2] = 8; UserCodeArray1[3] = 8; UserCodeArray1[4] = 8; UserCodeArray2[0] = 8; UserCodeArray2[1] = 8; UserCodeArray2[2] = 8; UserCodeArray2[3] = 8; UserCodeArray2[4] = 8; UserCodeArray3[0] = 8; UserCodeArray3[1] = 8; UserCodeArray3[2] = 8; UserCodeArray3[3] = 8; UserCodeArray3[4] = 8; doorConfirm(); } |
|
#43
|
|||
|
|||
|
I needed to find something that would hold my wire loom to the door skin, not flopping around and out of the way so the window doesn't rub it when it goes down. I went to Lowes and this was the only thing I found that didn't involve screws:
![]() Unfortunately, they detached from the door when it got hot (summer in Florida). So I replaced the crappy foam tape with some decal tape that I've used alot and has never failed me. ![]() It may be hard to see, but here's my wireloom coming from the keypad, down to the bottom of the door and up the other side. That's the connector on the bottom right. ![]() Here's my box with the hole cut and some tape covering some pins to protect my wires. I used my first board since my new one didn't work out, but I was too impatient to try and troubleshoot it. I'll worry about it if I have any problems with this one (I haven't yet). ![]() The back of the box, ready for mounting: ![]() Here is an example of my splices into the door. Soldered together and double walled heat shrink with adhesive. This is the door lock sense wire, I believe. ![]() Here's the box mounted. I can assure you that it's quite secure. I used just a tiny piece of the decal tape to hold it up temporarily while I was waiting for the other board, and it was harder than I expected to come off. Fully taped will definately hold it. ![]() So it's been in my car for a while now, and I've had no problems from it at all. I'm very pleased with it. I don't used it all the time, most of the time my keys are more convenient, but there has been more than once that I was already outside and wanted something from my car and didn't have my keys on me. So it has already fulfilled its purpose. I'll sure be happy I did it if I ever lock my keys in my car. I should note that I did not run a new power wire from the battery for this. I did in fact use the power wire for the side-view mirrors. It powers the backlight and everything perfectly, and again, I haven't had a single problem with it yet. Edit: I've published the board on BatchPCB, so anyone can have their own made whenever they want: http://www.batchpcb.com/product_info...9156fd6d36dd84 Last edited by neonpolaris; 06-24-2009 at 10:12 AM. Reason: Added BatchPCB Link |
|
#44
|
|||
|
|||
|
I posted a simple video on YouTube. It shows locking, unlocking, and the anti-scan. Don't worry, that combo was just a user-code that I added and have since erased.
![]() |
|
#45
|
||||
|
||||
|
Maddd PROPS for this I would need to pay some one to do this.. looks factory and serves its purpose
__________________
08 CSrt4 *MS1*AGP Wastegate*AGP Solid Mount*BWoody check valve*Solenoid Delete*K&N Filter*Muffler Delete*TurboSmart Vee-Port BOV*NGK Iridium IX*Light Weight Crank Pulley*PTP Inlet Tube*MPx Strut Brace |
|
#47
|
||||
|
||||
|
Damn I would love this on mine! Fly to cali n do it lol =]
__________________
08 CSrt4 *MS1*AGP Wastegate*AGP Solid Mount*BWoody check valve*Solenoid Delete*K&N Filter*Muffler Delete*TurboSmart Vee-Port BOV*NGK Iridium IX*Light Weight Crank Pulley*PTP Inlet Tube*MPx Strut Brace |
|
#49
|
||||
|
||||
|
now i can brother you and enter some random combinations
__________________
Frank______________ www.schusto.de.vu |
|
#50
|
||||
|
||||
|
oh... i forgot .....
__________________
Frank______________ www.schusto.de.vu |
| Sponsored links |
|
|
![]() |
| Tags |
| keyless keypad |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Anyone try adding a EVIC cluster to a non-EVIC equipped vehicle? | dawm | Electrical Problems and Questions | 62 | 12-23-2009 08:32 PM |
| Adding HP for the diesel model | mafrisch | Dodge Caliber Diesel | 25 | 04-06-2009 03:54 PM |
| Adding my Rockford Fosgate Punch | slight22 | Custom Dodge Caliber Interior Modifications - Audio / Video | 5 | 10-25-2008 05:39 PM |
| Adding Aux to a Caliber? | Maverick42 | Custom Dodge Caliber Interior Modifications - Audio / Video | 7 | 09-18-2008 08:06 AM |
| Adding to the R/T and Dodge fleet | Rob | Newbie Checkin! | 7 | 12-04-2007 10:38 PM |