0
\$\begingroup\$

I am using an Arduino to communicate with an OBD car scanner. It uses 2 digital pins for communication (7 and 11 SoftwareSerial.) I connected 12V power to VIN and GND. I also added ON/OFF switch in the middle of the GND wire.

When the switch is off, the Arduino diodes and the 2x16 LCD connected to 5V remain on (but dimmer.)

I expected it to completely turn off

The OBD scanner is always ON.

Pins 7 and 11 are connected to the OBD scanner which has 3.3V and 5V on those pins. Is it possible that the 1.7V difference between those pins is somehow powering the Arduino? If so, why? Any other reasons?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Try to on/off swich VIN wire... \$\endgroup\$
    – Matej
    Commented Feb 2, 2021 at 10:52
  • 1
    \$\begingroup\$ About the worst thing you can do is disconnect the ground connection. Live connections connect up the ground before they connect up any other pins. \$\endgroup\$ Commented Feb 2, 2021 at 17:28

1 Answer 1

8
\$\begingroup\$

Switching GND seems like a very bad idea. You'll have power going in on V+ and probably leaking out all sorts of ways through the GPIO protection diodes onto the bus risking damage. Keeping GND tied to the car's chassis would normally be a priority.


OBD is connected to car. Arduino connects to obd's 12v gnd and two digital pins. If I shouldn't switch GND or 12V (I tried that before - same thing) how can I turn off arduino

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Switching the 12 V supply off (or disconnecting the ground) may power up the microcontroller board through the MCU's input protection diodes.

schematic

simulate this circuit

Figure 2. A rough representation of the microcontroller board with its onboard 5 V regulator and the protection diodes on the GPIO inputs of the MCU.

It should be clear from Figure 2 that if the 12 V power is switched off but the OBD is still powered up and feeding the microcontroller that the protection diodes will pass current out to the CPU's internal V+ "wiring" and power up the chip. The amount of power available will depend on the current sourcing capability of the OBD, the resistance of the diodes and what gets turned on in the MCU and your LCD.

Applying voltage to an un-powered chip is generally to be avoided.

enter image description here

Figure 3. The USB edge connector is designed so that the outer GND and +5 V contacts make before the data lines. This ensures that the USB slave device receives power before the data lines are energised. Image source: Crowd Supply.

You need a three-pole switch to cut the data lines as well as the power.

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Is GND connected to OBD scanner? \$\endgroup\$ Commented Feb 2, 2021 at 9:15
  • 3
    \$\begingroup\$ Do NOT disconnect grounds between any two devices when they have also other connections like serial data connections between them. The return currents DO return via data pins and can damage data pins. The last thing you want is to damage your car. \$\endgroup\$
    – Justme
    Commented Feb 2, 2021 at 9:36
  • \$\begingroup\$ I don't know but I would think it needs it for its own power. \$\endgroup\$
    – Transistor
    Commented Feb 2, 2021 at 9:36
  • \$\begingroup\$ OBD is connected to car. Arduino connects to obd's 12v gnd and two digital pins. If I shouldn't switch GND or 12V (I tried that before - same thing) how can I turn off arduino @Transistor? \$\endgroup\$ Commented Feb 2, 2021 at 15:28
  • \$\begingroup\$ @user3364192. See the update. \$\endgroup\$
    – Transistor
    Commented Feb 2, 2021 at 17:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.