VinGear VIN decoder VinGearVIN decoder, VIN lookup & history check Check a VIN

B0540 code meaning

Driver Door Ajar Switch Circuit

Body system Generic code B05xx codes

What B0540 means

Neither the public J2012 lists nor any accessible maker document define B0540, so the code is unverified. The title concerns the circuit of the switch that signals the driver door is not fully shut. The GM-era Saab 9-3 tracks this input in the body control module as B2976: subtype 02 when the line sits below 2.9 V (short to ground), 05 above 10.2 V (open or short to battery), checked with ignition on or while the alarm is armed, and the driver gets a display message. In Ford's US6133827A each ajar switch is open with the door closed and grounds the input when it opens; a failed switch can keep the courtesy lamp burning. The door-open switch itself is B0510.

B0540 at a glance

  • Check engine lightUsually not
  • Emissions testNot an emissions code
  • Limp modeNot expected
  • Repair difficultyEasy, DIY possible
  • Typical labor0.4 to 1.5 hours
  • Clears after repairWhen cleared with a scanner

Symptoms of B0540

  • Door-open warning shown although the driver door is shut
  • Interior light stays on and may drain the battery
  • Alarm or auto-lock behaves erratically

Common causes of B0540

  • Most likelyAjar switch in the latch or door frame stuck or corroded
  • PossibleSwitch wire chafed to ground in the door hinge passage
  • PossibleOpen wire or loose pin at the latch connector
  • Less likelyBody control module input faulty

Check the most likely causes first. Replacing parts by guesswork is the most expensive way to clear a code.

Parts involved

Driver door ajar switchBody control module

What each part of B0540 means

BBody system: airbags, seat belts, power seats, lights and climate control.
0Generic code: it means the same on every make (SAE standard).
40The exact fault in that area.

What to do next

  • Note B0540 and any other codes stored with it: several codes together often point to one cause.
  • Check for loose connectors and damaged wiring around the parts the code names.
  • Check open recalls for your car: some faults are fixed for free by the dealer. Enter your VIN.
  • Clear the code only after the repair. If it comes back, the fault is still there.

Buying a used car? Scan it for stored codes before you pay. A recently cleared memory can hide a problem.

Questions about B0540

What does B0540 mean?

B0540 means "Driver Door Ajar Switch Circuit". Neither the public J2012 lists nor any accessible maker document define B0540, so the code is unverified. It is a generic code, so it means the same on every make.

Is it safe to drive with B0540?

B0540 does not normally turn on the check engine light by itself. Watch for the symptoms above and have it checked soon.

Will B0540 fail an emissions test?

B0540 is not an emissions code, so on its own it usually does not fail an emissions test. Other stored codes or a lit check engine light still can.

How hard is B0540 to fix?

Difficulty: easy. A typical repair takes 0.4 to 1.5 hours of work. A careful DIY repair is possible with basic tools and a scanner.

Will B0540 clear itself after the repair?

Clear the code with a scanner after the repair. If the fault is fixed, it does not come back.

Look up another code

Technical content: OBDex open OBD-II database (public domain, CC0), checked 6 Nov 2026, edited for US drivers by the VinGear team.
Technical sources for B0540