To find 12V I used my trusty multimeter
. Luckily, I found a wire nearly immediately that registered 12V but it was a thin black and gray wire. To be sure this was directly off the battery and not a control wire, I tried to do a continuity test from the positive terminal of the battery to this pin. No good - I didn't get direct continuity. Is it because I am testing the impendance of a rather long wire? I'm not sure. But it's 12V right? I used some nifty automotive quick splice connectors
and tapped the black and gray wire. I just need a few mili-amps, no big deal right?
The iFOB behaved very oddly. Sometimes it would work, sometimes
not at all. I couldn’t figure out what the problem was. I guessed that the power system might be causing the ATmega168 on the Arduino Pro Mini to latchup, so I decided to add a
watch dog timer to my Arduino code. The watch dog timer runs in the background of the chip and if the system code freezes, the watch dog resets the chip, clearing out the locked up variable or code. It worked for the Apollo missions - why not now?
The iFOB wired up and hanging out in foot well
I’m not sure what the black and gray wire is, but every time I plugged
the iFOB into the car, the car would honk. I assumed this was the iFOB
powering up (GPIOs tend to twiddle during power up) and accidentally hitting the lock button twice (causes the car to honk).
Over time I began to realize I found some sort of ‘honk’ wire. I also found out that this wire would turn off after an unknown amount of time, kind of like your dome
light turns off after the car is locked for 15 seconds. It was too difficult to sit in the car for hours on end to find out if in fact the wire was powering down, so instead I just tapped into the big fat red wire that registered 12V. This is a direct line off the battery. And when I plug in the iFOB, the horn doesn’t honk! Hrmm.
After a few more days of testing, frustration continued. The system worked during testing, but during normal, everyday use, it did some very annoying things. Mainly, as I walked up to the car, the doors would lock
! What in the world? More testing, and I found out that the Mazda has a neat security feature built in: if an unlock command is received by the car’s computer, but a door is not opened within 25 seconds, the computer will automatically re-lock the cars.
Ah hah! The iFOB was picking up my footpod some distance away from the car (like in the stair well down to the parking lot). If it took me 28 seconds to get to my car (from the point at which the receiver picked up the footpod) the car would automatically re-lock after 25 seconds, right before I pulled on the handle. A bit more Arduino code and the iFOB now unlocks the doors every 10 seconds while the footpod is heard, and until the car is started. This extra bit of code fixed the relocking problem.
The system now works great! When you’ve got a handful of stuff, it’s great to know the doors will automatically unlock as you approach. However, I still have use a key to start the car. The next step is get a big red button wired up for button start so that I don’t have to carry my key. Someday.