I'm currently trying to make an "on-board computer" for my classic car. Basically it would be to measure basic data like speed, engine RPM, voltage... I'll be using a standalone ATMEGA328P.
I would like also to add some kind of circuit to check if the headlights are turned on and if the overheat switch is closed. I was thinking about two circuits :
Legend: BAT+: 10-14V car battery positive voltage / VCC: 5V regulated for the ATMEGA328P (7805) GND: common between the ATMEGA and the car ground 12V_LIGHT_BULB: 12V light bulbs with unknown resistance D0/D1: digital inputs of the ATMEGA
The top one is for the overheat switch. The light bulb is connected to the car battery positive in the dash and the switch connects to ground when reaching about 100°C. The bottom one is for the headlights. The switch is connected to the car battery on one side and the bulbs directly to the ground. If I have chosen this placement for the optocouplers, that's because it's the most convenient way to connect them in the car and because I don't want to cut wires.
My questions are : - Would both circuits work ? It would be perfect but it is where I have a big doubt - If not, is there any alternative not involving cutting the car wires ? - If they do work, can they be improved ? (optional question, but you might have better ideas than me)
Thanks in advance for your help!