Finally started work on my CAN control hub. It'll do a few things eventually (that's the idea anyway) but here's the overview:
Hardware:
Macchina M2 "UTH" (Under the hood) - This is an Arduino based automotive hacking tool. I am using it because it does all the stuff my old CAN hardware I was designing/building does but in a vastly more compact form factor. 2x CAN busses, automotive input voltage, and some basic I/O. I built a "hat" for it that fits in the spot where you'd normally put a wifi/bluetooth board that adds some more ground switched (sink) controls that can act like switches for my Haltech and such. Basically, those will let me mimic an analog switch to something, while actually being a CANbus button on my CAN keypad. Why? Because I can make the CAN keypad smart, and it has lights to indicate state and such and toggle switches are, in fact, not smart.
Plans:
Parking brake -
The parking brake works great with the buttons on the car, but it's dumb (I talked about this before) in that it doesn't know it's state when I restart the car. To fix this, the M2 has an SD card that I can write a status byte to. So it'll listen to CANbus and track what the last thing I did to the brake was (set or released). It can actually find out what the actual brake controlled did because it tells the bus that also. So it stores that on an SD card every time the value changes (that way I'm not just spamming writes to my SD card and wearing it out). It then uses that status to set up the keypad.
The keypad status has two lights/buttons. One for set and one for release. So whichever status it's in is lit up on the keypad, red for set, green for released. So if I set the brake and turn off the car, the next time I start it the M2 sends the CAN message to the keypad to light the red light and set that button to status "1". That means I see, visually, a bright red light to tell me "hey stupid, brake is set". I can hopefully eventually send a message to the Haltech dash that also tells me that. I then press the "release" button, which turns off the red light, and turns on the green light. If I park the car with the brake released (like if I'm working on something or it's on the lift, etc.) it'll know that too, and light the green light when I key on next time and I'll know my brake isn't set.
I could make it do this stuff automatically, but I don't always necessarily want the brake set on key off, etc, so I'd rather just have a smart button.
----------
AC -
This is more simple. The Haltech looks for ground to run AC, and for some cars can use CAN bus. I'm hoping to get a compatible CAN signal and just send that when I press the button on the keypad. If I can't get the CAN to the Haltech going, I'll just use a ground sink output from the M2 to control a digital input on the Haltech (this is how it worked before). The chassis PDU controls the light for this since it's fine if it forgets when I shut off/start the car.
Traction Control Disable -
Same as AC
Scramble Boost -
Same as AC
Cruise Control -
BASICALLY the same again, but there are 4 buttons, so I really, really need to get CANbus for this to the Haltech, as I don't think I have 4x more inputs available. I could do a variable voltage output via PWM to use a single input as multiple buttons and just altering the voltage output when I press different buttons to simulate a resistor array like some stock cars do, but this is half assed vs. CAN. Gotta figure out CAN for this.
Horns already work with CANbus to the chassis PDU, that part was easy. Same with hazards.