Slow progress...
Progress has been slow but I haven't given up!
After I made the last post, I quickly realized that my graph was incorrectly labeled...not that it matters much. The data was taken without the module plugged into the car and I was getting some really weird measurements that didn't make tons of sense.
With the module actually plugged into the car, the measurements looked much more correct and the level of noise is very very low compared to what it was before.
I originally thought that the hard part would be manipulating the headlights to turn on, as compared to detecting unlock signals from the keyless entry module. This turns out to have been backwards. While I thought my hijacking of the keyless entry module using voltage dividers would work perfectly, it turns out that for some reason, when I plugged the module into the car, it immediately triggered all of the doors to lock. And upon unlocking them with the fob, they would immediately re-lock. Locked my main set of keys in the car because of this and had to get the backup key on standby.
After disconnecting the voltage dividers and Arduino from the module, the keyless entry system works fine, so It's not like I damaged something. But I'm going to have to figure out what's happening here and how to resolve it. I have a theory that my voltage dividers might be pulling down the voltage outputs enough that it messes with the module. So I am going to play around with some different resistor values for the dividers.
Headlight Control
The hard part that turned out to be easy!
I started by looking at the diagram in the FSM for the headlights thinking I could trigger the relay to flip and turn the headlights on (and ideally the parking lights too somehow). What I found was a non-trivial diagram of the relays which made me immediately nope outta that. I then went looking at the headlight stalk -
something I've investigated before in relation to my upgraded foglights.
Here's the FSM diagram I was looking at for the headlights. It can be found in section 09-18-13 (BODY)
I took the steering column trim panels off and unplugged the headlight stalk connector, hoping I could probe around and get something to work. I was still confused at the diagram so I decided to do the safest thing and just start jumping pins together with a jumper (sarcasm here, I was making an educated guess). To my delight, I found a combination that worked to turn on the headlights!
As I probed, I also found a pin which will turn the parking lights on (though this will be a little quirky...more on this later). After probing for a bit, what I found is that the pin marked
P is just a ground, and the other pins are logical high pins, sitting at 12v. By shorting those pins to ground (P), the headlights and other things turn on.
There seems to be a combination of things shorted to P that create the functionality we see with the stalk, but I found that jumping P to either (don't quote me on this, need to double check) O or L would turn the headlights on. I don't recall what the pin was for the parking lights but I'll get that in here shortly.
Out of curiosity, I jumped the pins with the meter to see what kind of current I was dealing with and it looks like it's only about 120mA for the headlights. That's a little high but doable.
Arduino Headlight Control
Now I needed to find a way to essentially "short" either the O or L pin to any GND to trigger the headlights to turn on. This took me a good while to figure out. The simple option would have been a relay, but I refused to deal with that. So I rigged something up with a mosfet (two, one for headlights and one for parking lights). Now this is where things get a little muddy. I have the wiring for the mosfets and they do work with the Arduino but it was a process to get the right resistor values and to get everything working.
Testing together
With all the essential components in, I figured I would do a test run to see if I could
technically make the headlights turn on with the key fob, even though the module would immediately trigger a re-lock after unlocking every time. I wrote some sloppy code to detect a voltage change from the module on one of the unlock signal lines, and had it switch on the mosfet controling the headlights (and in turn, the parking lights). Annnnnd it worked! I don't have proof but I was able to turn the headlights on with the fob. So that's progress that I am very happy about.
Quirks
Now onto the quirks...this thing is so far from done. This was just the first itteration.
- The elephant in the room is the module re-locking after any locking operation with the fob. Obviously a no go until this is resolved.
- The quirkiness I mentioned before with the parking lights is not a deal breaker but a little annoying. I wanted to have headlights and parking lights come on during unlock. Headlights are on their own pin, but the pin that controls parking lights also controls the gauge cluster backlighting (fine) but has the effect that when the doors are open, the headlight on buzzer turns on...annoying!
- The solutions for this as I see it are: Don't trigger the parking lights (fine), only trigger the parking lights until a door is open then detect that and immediately turn them off, leaving headlights on (ehh), or disable the headlight buzzer (ehh). Leaning towards the first option but still TBD.
- The hardware on the module is SERIOUSLY JENKY. Don't have pictures right now but the Arduino is zip tied to the side and soldered to a bunch of the wires. It's gross. But it's a prototype for now and it'll get better later.
- I have yet to test idle power draw. I don't want this thing killing my battery so we'll need to address that probably.
Anyways, going to keep working on this and get it wrapped up so I don't have to keep using my key