### Breadth-First Search for troubleshooting my car battery failure

I recently fixed my car by myself again. And the troubleshooting strategy is very like how I locate bugs in software: using Breadth-First Serach (BFS) and prioritizing testing points at each level.

My car's battery has been having drain problem since last winter. Sometimes the voltage is just zero. After several times, I speculated that the cause was not the battery but some circuit not completely off.

Now, let's start our "algorithm" and "data structure."

Most gasoline cars' electric system is organized in a tree structure. The root node is the battery. Then fuses partition the circuit into many divisions, each of which has a big fuse. In each partition, there are many sub-divisions, each of which has a minifuse. All fuses and minifuses are in fuse boxes in your car. For my car, there are two fuse boxes, one under the hood and the other under the dash board.

A lot of the videos and tutorials online tell people to measure the current flowing out of the battery. If the current is under 20mA, then the circuit is fine. But I didn't do this. Since my battery, a DC source, leaked current when the car was off (of course, there should be a very small current to keep some background circuit working), I assumed the drain was caused by something resistive. Hence, I just needed to treat the rest of the circuit as a network and measure its resistance. The resistance was 90 Ohm and hence the drain current was 12V/90Ohm = 0.13A, which was pretty big.

Then I begin to disconnect fuses one by one and measure the resistance each time. I did Breadth-First Search (BFS): I disconnect big fuses first. I found out that after I disconnected the 30A fuse for IP BATT (Instrument Panel Battery), the resistance increased to 2,000 Ohm which is reasonable because 12V/2kOhm = 6mA. In order to do BFS in the next level, I put the fuse back.

The next step was to know which minifuses were children of the IP BATT fuse. Sadly, after 10 minutes of googling, I still couldn't know which minifuse(s) was(were) causing the drain. So I had to disconnect every minifuse to test. The resistance went to 2kOhm again after I disconnect the BODY minifuse.

Then Googling showed that the BODY minifuse controled the power door lock switch, the trunk light, trunk closure sensor and the dome light. I recalled weird behaviors of my power door lock switch, and decided to test it first. Oh, I put the Body minifuse back before I check the switch.

Bingo! After I disconnected it, the resistance went back to 2kOhm. So, I just left the switch disconnected - I don't use it anyway.

Note: Removing my door lock switch was very easy. Some mechanics used to tell me that he needed hours to open the door. No, it's just one pinch.

Saving time is a big reason I always try my best to fix problems on my car.

References about auto electronics mentioned in this blog post:
1. Battery Drain (BODY Fuse) 98 SL2
2. How to find a parasitic battery drain
3. Diagrams of the fuse box of a Saturn SC2