I'm currently working on creating a custom PCB for my instrument cluster in my car. And because I want to do it "properly", I'd figure I'd make the circuits first with a breadboard, make sure everything functions before creating the actual PCB.
My car is quite a bit older, and does not have fancy CAN-bus, or anything similar. It has 'regular' old fashioned warning lights, 12 volt on means light must be on type of things. I also want to have a speedometer function, which is powered by a 12 volt transducer and the RPM I'd be able to calculate using the - contact on the ignition coil.
I have then, passed a problem. There are approximately 15 warning lights, which all function as mentioned above on 12 volts. I'd want to read them and turn on and off the correct lights (which are controlled by the arduino).
From my research, the best way would be optocouplers (or opto-isolators) with multiplexers in order to reduce the amount of GPIOs required and not having to deal with reducing every 12 volt input separately (for example with voltage dividers). Would that indeed be the best way? And what would you recommend from the Speedo/RPM, since I'd need that more continuously than the lights (which wouldn't be a absolute disaster if there is a small delay on them)?
I am not sure where you are but check the local and national laws. Here the OEM odometer must remain connected. Here is some reading you need to do before going very far into your project. Your older vehicle is a much more nasty and dirty on the electrical system then newer models. Check this out.
Is the speedometer 0-12V analog? Or is it a pulse?
If it's an analog voltage you can use a voltage divider into an Arduino input. The output to a display or meter depends on what you want to do...
On the Arduino digital inputs, you can use an over-voltage protection circuit. (I would increase the resistor to between 1K and 10K). Or you can add a "protection diode" to a voltage divider.
An optical isolator (AKA opto-coupler) is also a good solution.
Sometimes a voltage divider alone doesn't work well because the "12V" in a car varies.
For Arduino outputs, the Arduino can't directly power much more than a regular little LED. If you want to control incandescent light bulbs with the Arduino, you'll need MOSFET Drivers (you can leave-out the diode which is for motors and other inductive loads) ,or transistor drivers, or relays.
Electromechanical relays need a driver circuit for the relay coil but there are solid state relays that can be directly controlled with the Arduino. If you get solid state relays, make sure they are designed to switch DC. (AC & DC solid state relays are not generally interchangeable.)
Thank you for your information, but TLDR it's adding TVS protection to the PCB? That's doable I think. As for the legal advice, I'm certain it's legal in my country.
As for the speedometer, it's a pulse sensor. So either opto-coupler would be the best option I understand from you?
As for the arduino driving leds, maybe I wasn't clear, but it's just meant to light some LEDs in the instrument clusters. Not the actual headlamps or anything similar.