Reading an a switched earth with Arduino and another device

Hi there,

This might be a silly question, but I have a switch in my car that I’d like to read, and it pulls to earth when closed.

I have both my Arduino, and another controller that need to read this switch position, and the other controller can use a 10k input pullup. Can I do the same thing on the same wire with the Arduino without causing either device any upset? I guess yes…? Do I need any circuit protection in this case or simply wire both to the switch?

If I understand your convoluted question with no wiring diagram to refer to, then I think the answer is probably, maybe yes.

If you want a definite response, then post a wiring diagram and identify the mysterious "other controller".

SteveMann:
If I understand your convoluted question with no wiring diagram to refer to, then I think the answer is probably, maybe yes.

If you want a definite response, then post a wiring diagram and identify the mysterious "other controller".

Sorry its been a very long day..! Not at my computer right now so can't make a wiring diagram but this is the mysterious other controller:

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.ecumaster.com/files/PMU/PMU_Manual.pdf&ved=2ahUKEwjm3Iu0j_TlAhXXzTgGHR62CFsQFjAFegQIBBAB&usg=AOvVaw3tQNEWbV9yjFvAeeH_Z2Hv

Your question sounds like you have a ground rod connected to your car. The battery - which is typically connected to the chassis is ground not earth. Try using a 21K resistor from the switch to the arduino, it should work. At this point I am assuming the switch is pulled up to the battery + level, the resistor will protect the arduino. Be sure to connect the arduino to the car ground.
Good Luck & Have Fun!
Gil

Hi,
What in the car is this switch connected to?
If you put a DMM on the load side of the switch what voltage do you read with respect to car chassis when the switch is OPEN then CLOSED.

You will possibly find when the switch is open, the voltage will be close to the battery positive voltage due to the load.

Thanks.. Tom... :slight_smile:

TomGeorge:
Hi,
What in the car is this switch connected to?
If you put a DMM on the load side of the switch what voltage do you read with respect to car chassis when the switch is OPEN then CLOSED.

You will possibly find when the switch is open, the voltage will be close to the battery positive voltage due to the load.

Thanks.. Tom... :slight_smile:

Sorry Tom I'm not sure I understand your question? The switch would have the PMU and Arduino upstream, and chassis ground on the other, so when the switch was open, only the PMU and Arduino would be connected to each other but both in input pullup mode so no current should flow and nothing should be read... right??

Hi,
The Arduino is connected to the switch, the terminal that is connected to the load that goes to 12V.
When the switch is closed, that point will be connected to the vehicle gnd.
When open, you still have a connection at that point, to the vehicle 12V line through the load.

Put a DMM, across the switch contacts.
Measure the voltage with the switch closed.
Measure the voltage with the switch open.

This may help.


What is the load you are switching?
Tom.. :slight_smile:

Does it matter that there is no load? So the function of the switch will be handled by the solid state power distribution unit. All this switch is doing is connecting the arduino pin, and the PDU input pin to ground. They should detect that current can then flow, then the arduino will switch on an LED to tell the driver the switch is closed, and the PDU will switch one of its outputs to turn on some lights or other load.

Hi,
If you have INPUT_PULLUP and the PMU pulls high when the switch is open, then okay.
BUT you haven't confirmed it.
Measure the voltage across the switch, OPEN and CLOSED.
That will tell you what the input voltage to the Arduino will be and if you need a potential divider or not.

We don't know, because we don't know what the load is.
What model Arduino are you using, this is also important as there are 5V and 3v3 type controllers.

Tom... :slight_smile:

I'm using a teensy 3.5 for this bit so 5v capable, and the pdu does also pull high. You can set the channels to pull high or low depending on the switch type you're reading

I do not believe that you want to
put 12V on your 5V pin!

Place a diode between pin and 12V, pointing towards the 12V side.
Now the switch can only pull low the pin, so enable the internal pull-up and share grounds.

So this is what I'm thinking, the diode is a good idea...