Hello,
I am working on an Atmega328P-based car alarm system at the moment, and I am trying to tie it as neatly into the car's "hardware" as possible. One idea that I am working on right now is that I am going to use two LEDs inside the car's fog light switches, one yellow and one green, to visually confirm when the system has been armed/disarmed. The LEDs are powered by the car's 12-volt circuit (with 800-ohm resistors right in front of the LEDs) while the fog light switches are on, and alternatively with 5 volts and 150-ohm resistors from the Arduino which is supposed to run completely parallel to the 12V power supply.
I've assembled a mock-up circuit at home and bought identical switches to the ones in my car from a junkyard, and at the moment everything seems fine; the LEDs inside the switches light up just as they should when I switch the Arduino's I/O pins high.
I've already put in adequate diodes to ensure that the 12 volts won't hit the Arduino's I/O pins, but now I am wondering, the LEDs need to be grounded of course, but if I just connect the LEDs to one of the Arduino's ground pins, doesn't that mean that it also grounds the 12 volts from the car? And is that not a very bad thing? Should I maybe ground the LEDS directly to the car altogether once the alarm system is installed?