My car has a key with a built-in keyfob. The plastic housing broke, but the keyfob inside the key still worked.
I disassembled the keyfob and extracted the circuit board.
On the board were three buttons. Lock, Unlock and Panic. On the back of the circuit board is a place for the 3V coin-cell battery. Also on the circuit board were pads that looked like they would be easy to solder a small wire onto. Using a multi-meter on the continuity setting, and looking at the circuit board, I figured out which of those little pads were connected to the 3V line and each of the three buttons. I learned that by connecting 3V to the pads for each of the buttons, I could control the keyfob without physically pressing the buttons.
Then I soldered wires to each of the pads that I had found.
Then to make sure the wires didn't snap off the fragile solder points, I used hotglue to hold everything in place.
Once the keyfob has easy to access wires attached to it, I connected the wires to a set of opto-isolators and then connected the opto-isolators to a Particle Electron. The opto-isolators protect the keyfob and the electron from each other. They are electrically isolated and can't interfere with each other in the event there is a problem.
I wrote a very simple program for the electron so that I could send commands to it over the Particle Electron REST api. I made three functions, Lock, Unlock and Panic. When the Electron receives these commands over it's cellular data connection, it will run the appropriate function and activate a 'button press' on the keyfob.
void setup() {
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D4, OUTPUT);
Particle.function("lock", lock);
Particle.function("unlock", unlock);
Particle.function("panic", panic);
}
int lock(String command) {
digitalWrite(D2, HIGH);
delay(100);
digitalWrite(D2, LOW);
}
int unlock(String command) {
digitalWrite(D3, HIGH);
delay(100);
digitalWrite(D3, LOW);
}
int panic(String command) {
digitalWrite(D4, HIGH);
delay(1000);
digitalWrite(D4, LOW);
}
void loop() {
}
By having the device inside the car and connected to the Internet via a cellular data connection, I can lock and unlock my car doors from any other internet-enabled device such as my cellphone.
Comments