Checking only ground from 2-state pin (12V-14,2V and GND)

Hi all.
I created a whole relay control system depending on the state on 3 limit switches. However, I have a problem with one of these limit switches. The signal comes from the car module and has two states - GND and +12V. All the time I thought it would be 5V, but I was surprised. Now I'm thinking how to implement it so that the arduino sees the states of this limit switch. 12V will fry the digital pins, so I was thinking about a voltage divider - but I'm worried about the current consumption (I don't want the car battery to die after a week...) I was also thinking of a pull-up pin and a diode on the signal input, but I think that might not work.

So I would like to know what would be the best solution for this project. The most important thing for me is that the system consumes as little power as possible, because there must be 4 such systems in my car ...

Regards.

A car's 12 V is never quite 12 V, but most of the time higher. So careful if you go for a voltage divider, you need to take into account that you might get more than 12V...

I would use and optocoupler for galvanic isolation between the two circuits. Voltage variation on the car side will illuminate the optocoupler's led a bit more or a bit less when the voltage changes (use an appropriate resistor) but you should still get the right signal on the other side

Welcome! We will need more information, here is part of it. Does this run in key off mode? If so why? Is the signal active High or Low? Take some time and read this: ST AN2689 Application note
Protection of automotive electronics from electrical hazards, guidelines for design and component selection.

This starts to cover the basics. Cars are different just like people, different modules, manufactures, years, etc these can vary and so do the requirements. Without all the needed information I will not take a guess as the odds are extremely I will be wrong. As for the "best solution" that would be a subjective rather then a definitive answer.

Conventional wisdom would call for an opto coupler as already stated however a
5.1 volt zener with a current limiting resistor (1380 ohms probably ok: (12V-5.1V)/0.005A = 1380 ohms)
This will limit the voltage difference between 12V and Vzener to about 5mA. SOP is to check the zener datasheet which shows a Izener of 5mA. (closest standard value is 1.5k I think)

Thank you for your response. I have already posted a detailed description.
I need a signal from the lock - is it closed or open. The lock has two states LOW - Open and HIGH - closed. I thought the HIGH signal would be logically high (3.3V or 5V) but I was wrong. After connecting the multimeter to the wire responsible for the state of the lock, I noticed that the high state corresponds to the voltage value from 10.5-11.5V! The battery voltage is 12.3V (14V when the engine is running), but after about 20 minutes after closing the car (modules sleep time), the voltage from lock drops to ~1V.
So my problem is what is the most efficient way to change the lock to high (assume max is 14V), to high signal from arduino (5V or 3.3V). I only need 2 states for my design to finally work - I don't need to measure the exact voltage values on these pins, a logical 0 or 1 is enough. And the mere fact that the lockout signal is dormant makes the matter of current consumption much easier. So will a voltage divider be the right solution in this case? Adjust it to the maximum voltage value so that it will process within 3.3V-5V.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.