Go-Parts
Cart 0
Your cart is empty
Add an item to see it appear here.
Wrenchy
Go-Parts Garage
Expert guides for diagnosing, troubleshooting, and replacing auto parts Expert guides for diagnosing and replacing auto parts
Browse All →
🎬 Helpful Videos 🛍️ Shop This Part

C0040 on 2013-2016 Mazda CX-5: Brake Switch Malfunction Causes and Fixes

On a 2013-2016 Mazda CX-5, code C0040 almost always points to a faulty brake light switch (OEM Part No. BN7N-66-490A). This is a cheap part (around $25-$50) and a relatively easy DIY fix located above the brake pedal, often resolving a no-start condition and multiple dashboard warning lights.

21 minutes to read 2013-2016 Mazda CX-5
Most Likely Cause
Faulty Brake Light Switch
Difficulty
2/5
Est. Time
0.8 hrs
DIY Doable?
🔧 Shop
Shop Labor
$100 – $200
Parts Price
$15 – $50
⚠️ Drivable, but... — The main hydraulic brakes should still work, but safety systems like ABS and traction control will be disabled. Your brake lights may also be stuck on or off, which is a major safety hazard. The vehicle may also fail to start or shift out of park.
Key Takeaways
  • C0040 on a 2013-2016 Mazda CX-5 means there is a problem with the brake light switch circuit.
  • Symptoms include ABS/Traction Control lights, non-functional brake lights, and potentially a no-start condition.
  • The most likely cause is a failed brake light switch, which is an inexpensive and easy part to replace yourself.
  • Do not confuse this with a wheel speed sensor fault; on Mazdas, C0040 points to the brake switch.
  • Always check the switch, its adjustment, and the fuse before considering more complex issues like wiring or control modules.
Code C0040 on a Mazda indicates a circuit malfunction with the Brake Pedal Switch 'A'. This switch, also known as the brake light switch, sends a signal to the vehicle's computers—including the ABS module (DSC), Engine Control Module (ECM), and Transmission Control Module (TCM)—when you press the brake pedal. Mazda's diagnostic system can set different suffixes for this code, such as C0040:64, which is triggered if the switch signal is stuck 'ON' for over 6 minutes while driving, or if no 'ON' signal is received during deceleration. Another suffix, C0040:24, can be set by the start-stop unit if the switch appears stuck on. A fault in this circuit means the car's various systems may not know when the brakes are being applied, leading to several related issues.

What's Unique About the 2013-2016 Mazda CX-5

The first-generation Mazda CX-5 (2013-2016) integrates the brake switch signal into numerous safety and convenience systems like the push-button start, stability control (DSC), and cruise control. While a failing brake switch is common across many car brands, on the CX-5 it can cause a cascade of seemingly unrelated warning lights (TCS, ABS, Master Warning) and may even prevent the engine from starting, which can be confusing for owners. This exact issue is also common on platform mates like the 2014-2018 Mazda3 and 2014+ Mazda6.

Professional service recommended: This is an ABS/chassis system code. While replacing the switch is straightforward, incorrect installation or a misdiagnosis of a more complex wiring or module issue could compromise the functionality of the anti-lock brakes and stability control systems. Mazda's service manual even cautions that if the switch is removed from the pedal, it should be replaced with a new one to ensure proper operation.

Symptoms You May Notice

  • ABS, Traction Control (TCS/DSC), or 'skidding car' warning light on the dashboard
  • Master warning light on
  • Brake lights do not work or are stuck on continuously
  • Inability to start the engine (on models with push-button start) because the car doesn't detect the brake pedal is pressed
  • Ignition button on push-start models turns red or yellow instead of green
  • Inability to shift the transmission out of Park
  • Cruise control will not engage
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing an ABS wheel speed sensor. Many generic code readers incorrectly define C0040 as a 'Right Front Wheel Speed Sensor Circuit Malfunction'. However, for Mazda vehicles of this era, C0040 consistently refers to the brake switch circuit.
  • Replacing the ABS control module before thoroughly testing the inexpensive brake light switch and its wiring.

Most Likely Causes

  1. Faulty Brake Light Switch 🔴 High Probability The brake light switch is a high-use electromechanical part that wears out over time from repeated use. It is the most common point of failure for this code.
    How to confirm: Use a multimeter to test the switch for continuity as the plunger is depressed and released. Alternatively, observe the 'Brake Pedal Switch' status in a capable OBD-II scanner's live data stream while pressing the pedal. A failed switch will often prevent the green light on the start button from illuminating when the brake is pressed.
    Typical fix: Replace the brake light switch. It is located on a bracket above the brake pedal arm and is removed with a simple clockwise twist and pull motion. The electrical connector has a release tab that may require a small flathead screwdriver to disengage.
    Est. part cost: $20-$50
  2. Misadjusted Brake Light Switch 🟡 Medium Probability The switch's position relative to the brake pedal can shift over time, or it may be installed incorrectly, causing it to send an inaccurate signal. Some forum users on related models have resolved issues with adjustment.
    How to confirm: Visually inspect the switch to ensure its plunger is fully released when the pedal is at rest and fully depressed when the pedal is pressed. There should be no significant gap or pre-loading. Mazda's official service manual cautions against re-using a switch once it has been removed from the pedal bracket, suggesting replacement is the standard procedure.
    Typical fix: Loosen the switch's locknut, adjust its position until it actuates correctly with the pedal movement, and then retighten the locknut. However, due to the low cost of the part and official guidance, replacement is often recommended over adjustment.
    Est. part cost: $0
  3. Damaged Wiring or Connector ⚪ Low Probability The wiring is in the driver's footwell and can be susceptible to damage from kicking, moisture, or chafing against the pedal assembly.
    How to confirm: Visually inspect the wiring harness and connector leading to the brake light switch for any signs of damage, corrosion, or loose pins. Check for voltage at the connector with a multimeter per the factory service manual diagnostic steps.
    Typical fix: Repair the damaged section of wire or replace the connector pigtail.
    Est. part cost: $5-$25
  4. Blown Fuse ⚪ Low Probability
    How to confirm: Check the vehicle's fuse box (both in the cabin and engine bay) for any fuses related to the brake system, stop lamps, or ABS.
    Typical fix: Replace the blown fuse. If it blows again, this indicates a short circuit that needs to be diagnosed.
    Est. part cost: $1-$5

Rare But Worth Checking

  • ABS/DSC Control Module Failure: This is very rare. Before suspecting the module, all other possibilities like the switch, wiring, and adjustment must be thoroughly ruled out. This fault usually appears with other communication codes. One owner on a forum mistook a C0040 code for a failed 'brake fluid pressure sensor', which is integral to the DSC module, before the more common switch was likely diagnosed.

Diagnosis Steps

  1. Scan the ABS and PCM modules for all stored trouble codes. Note if C0040 is present with a suffix like :24 or :64, and if it is accompanied by P0504 or P0571.
  2. Check the function of the brake lights. Do they illuminate when the pedal is pressed? Are they stuck on? If only one light is out, the problem is likely a bulb, not the switch.
  3. Test the push-button start. Press the brake pedal and observe the start button. If it does not turn green, this strongly suggests the car is not receiving the brake pedal 'on' signal.
  4. Visually inspect the brake light switch located above the brake pedal. Ensure it is securely mounted and the electrical connector is fully seated.
  5. Using a capable scan tool, monitor the live data for the 'Brake Pedal Switch' PID. It should change state from 'Off' to 'On' (or similar) the instant the pedal is pressed.
  6. If a scan tool is unavailable, disconnect the switch and use a multimeter to test for continuity across the appropriate terminals as the plunger is depressed and released.
  7. Inspect the related fuses in the interior and under-hood fuse panels.
  8. If the switch and fuses are good, inspect the wiring harness between the switch and the control module for shorts or open circuits, following the diagnostic tree in the Mazda service manual.

Parts You'll Likely Need

  • Brake Light Switch / Stop Lamp Switch (OEM #BN7N-66-490A) — This is the most common failure point for code C0040. It is a simple mechanical switch that wears out over time. The OEM part supersedes part number bn7n66490.
    Trusted brands: Mazda OE, Intermotor, Standard Motor Products, Dorman
    OEM price range: $30-$50
    Aftermarket price range: $15-$30

Related Codes That Often Appear With This One

  • P0504 — This code specifically relates to a 'Brake Switch 'A'/'B' Correlation' fault. The NHTSA TSB SA-062-23 for a newer Mazda model shows C0040 and P0504 appearing together for the same fault, indicating the modules are seeing conflicting signals from the switch. [TSB SA-062-23]
  • P0571 — This is another code for 'Brake Switch 'A' Circuit'. A Reddit user with a Mazda reported seeing C0040 and P0571 together, which were both resolved by replacing the brake switch.
  • C0023:62 — A Reddit user on a 2014 CX-5 reported this code, 'Stop Lamp Control 2 Signal Compare Failure', appearing alongside C0040 after a brake service. This points to a failure in the brake switch, which was the ultimate fix.

Technical Service Bulletins (TSBs) & Recalls

  • SA-062-23: While for a newer CX-90, this TSB confirms Mazda's use of C0040:24 for a 'Brake switch (No.1 signal) circuit malfunction', often paired with P0504:00.
  • Mazda Service Manual for C0040:64 / C0040:24: Official Mazda diagnostic documents outline the specific conditions under which the code is set by the DSC (ABS) and Start Stop modules, confirming it relates to an illogical signal from the brake switch.

Platform-Specific Known Issues

  • source — A user on Mazdas247 described a classic failure scenario on their girlfriend's 2013 CX-5: difficulty starting with a red or yellow ignition light, intermittent TCS, master warning, check engine, and TPMS lights, and inability to shift. Other forum members correctly identified the likely cause as a bad brake switch.
  • source — A video from 'Marcus Fixes Stuff' details the symptoms on a 2016 CX-5, including check engine and traction control lights and a no-start condition. The video provides a step-by-step DIY replacement of the switch, confirming the ease of the repair and the resolution of the issues.

Mechanic-Grade Diagnostic Values

  • Voltage at PCM connector terminal 1U (or 2G for SKYACTIV) to body ground — expected: B+ (approx. 12V) when brake pedal is depressed, 1V or less when released.. Failure: If voltage is always B+ or always 1V or less, it indicates a short or open in the circuit or a faulty switch.
  • Voltage at brake switch connector terminal D (harness side) to body ground, with switch disconnected — expected: Should be 1V or less.. Failure: If voltage is B+ (approx. 12V), it indicates a short to power in the wiring harness between the PCM and the switch.
  • Continuity between PCM connector terminal 1U/2G and brake switch connector terminal D — expected: Continuity should exist.. Failure: No continuity indicates an open circuit in the wiring harness.

Scan Tool Commands That Help

  • FORScan / Mazda IDS: Live Data PID Monitoring for 'BOO' (Brake On/Off) or 'Brake Pedal Switch' — This is the fastest way to confirm if the PCM is receiving the signal from the brake switch. The status should toggle instantly from Off/Inactive to On/Active when the pedal is pressed.

Wiring & Ground Locations

  • Brake Switch Connector — Located at the top of the brake pedal assembly in the driver's footwell.. This is the primary connection point for the switch. The signal wire to the PCM is at Terminal D.
  • G09 / G12 — Located behind the instrument cluster.. These are primary ground points for various components in the dashboard area. A poor ground here could potentially cause erratic behavior in modules that read the brake switch signal, although it is not a direct cause of C0040.
  • Engine/Transmission Ground — A main ground cable runs from the negative battery terminal to a bracket on top of the transmission.. While not directly related to the brake switch circuit, a poor main ground can cause a wide range of unpredictable electrical issues and codes throughout the vehicle.

Real Owner Repair Stories

  • Reddit user /u/BlueCheeseSmellsGood (2014 Mazda CX-5 (with manual handbrake)) — After replacing front/rear brake pads and rotors, 'TPMS require inspection' and 'SCBS require inspection' warnings appeared. Codes C0023-62 and C0040 were present. Initially could not shift out of park.
    ❌ Tried (didn't work) Initially confused by online videos about electronic parking brake maintenance mode, which did not apply to their vehicle.
    ✅ What actually fixed it Replacing the brake pedal switch. After replacement, the gear shift issue was resolved immediately.
  • Reddit user /u/roonedit (2014 Mazda CX-5) — Push-to-start was having trouble, car could not be shifted out of park, and brake lights did not illuminate when the pedal was pressed.
    ✅ What actually fixed it The problem was identified as a faulty brake switch. The user noted the switch had multiple wires, for redundancy and communication with multiple systems (ECU, cruise control, etc.), which is why a failure can cause widespread symptoms.

OEM Part Supersession History

  • bn7n66490BN7N-66-490A — Standard part revision by the manufacturer.
    Heads up: The new part number (BN7N-66-490A) is the correct replacement for the original and is fully compatible.

Model Year Variations Within This Range

  • 2016: The 2016 model year marked a mid-cycle refresh (sometimes called 2016.5) which introduced an electronic parking brake (EPB). While this does not change the C0040 code's cause (the brake pedal switch), it adds a required 'maintenance mode' procedure for servicing the rear brakes, which can be entered without a scan tool. Failure to use this mode can damage the rear caliper motors.

Diagnostic Flowchart

Start by checking for secondary codes like P0504 or P0571 and observing the behavior of the push-button start indicator, as this code typically points to a logic failure in the brake switch circuit.
Check the fuse boxes in the cabin and engine bay. Are any fuses for 'STOP' or 'ABS' blown?
→ Replace the fuse ($1-$5). If it blows again immediately, inspect the wiring harness in the driver's footwell for shorts caused by chafing against the pedal assembly.
Using a scan tool, monitor the 'Brake Pedal Switch' PID in the ABS/DSC module. Does it toggle 'On/Off' with pedal movement?
→ Replace the brake light switch. This is a high-wear electromechanical part common to the CX-5 and Mazda3 platform. Ensure the connector release tab is fully disengaged during removal.
Inspect the wiring harness and connector for the brake switch. Any signs of corrosion or loose pins?
→ Repair the damaged wire or replace the connector pigtail. Ensure the harness is routed away from moving parts of the brake pedal arm.
→ If the switch, fuses, and wiring pass all tests, the fault may lie within the DSC (ABS) control module logic. Consult a professional to perform a module software update or replacement per Mazda service manual C0040:64 / C0040:24 protocols.
Check the rear of the vehicle. Are the brake lights working correctly when the pedal is pressed?
Inspect the brake light switch above the pedal arm. Is it securely mounted and is the plunger moving freely?
→ Attempt to adjust the switch position so the plunger is fully released when the pedal is at rest. Note: Mazda service manuals recommend replacing the switch (Part BN7N-66-490A) once removed rather than re-adjusting.
Disconnect the switch. Does a multimeter show continuity across the terminals when the plunger is actuated?
→ The internal contacts of the switch have failed. Replace the switch. This is the most common cause for C0040 on 2013-2016 models as documented in forum cases and TSB SA-062-23.
Inspect the wiring harness and connector for the brake switch. Any signs of corrosion or loose pins?
→ Repair the damaged wire or replace the connector pigtail. Ensure the harness is routed away from moving parts of the brake pedal arm.
→ If the switch, fuses, and wiring pass all tests, the fault may lie within the DSC (ABS) control module logic. Consult a professional to perform a module software update or replacement per Mazda service manual C0040:64 / C0040:24 protocols.
Using a scan tool, monitor the 'Brake Pedal Switch' PID in the ABS/DSC module. Does it toggle 'On/Off' with pedal movement?
→ Replace the brake light switch. This is a high-wear electromechanical part common to the CX-5 and Mazda3 platform. Ensure the connector release tab is fully disengaged during removal.
Inspect the wiring harness and connector for the brake switch. Any signs of corrosion or loose pins?
→ Repair the damaged wire or replace the connector pigtail. Ensure the harness is routed away from moving parts of the brake pedal arm.
→ If the switch, fuses, and wiring pass all tests, the fault may lie within the DSC (ABS) control module logic. Consult a professional to perform a module software update or replacement per Mazda service manual C0040:64 / C0040:24 protocols.

Other Known Issues on This Vehicle

Issues unrelated to this code that are worth knowing about as an owner of this generation:

  • Accessory Power Won't Turn Off 🟠 Medium — Common on 2013-2014 models. The engine shuts off, but the radio/infotainment stays on, leading to a dead battery. (Ref: No TSB, but a widely known issue caused by a faulty park position sensor in the shifter assembly (Part No. KDY0-46-040).)
  • Daytime Running Light (DRL) Failure 🟠 Medium — Very common on 2016 models. The LED DRL strip flickers or fails completely. (Ref: Mazda Safety Recall 4320A. The fix requires replacing the entire headlight assembly.)
  • Rear Brake Dragging / Squealing 🟡 Low — Frequently reported across the generation. Can cause noise and premature wear of rear pads. (Ref: TSB 04-004/19 (squeak noise from guide plate); TSB 04-005-16-3217 (2016 models, EPB logic failure causing drag).)
  • Easily Cracked Windshield 🟡 Low — Common owner complaint. Cracks reportedly form spontaneously without obvious impact. (Ref: null)
  • Failing Rear Liftgate Supports 🟡 Low — Common on 2013-2016 models. The gas struts for the power liftgate weaken and fail to hold the gate open. (Ref: null)

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: A used brake light switch is not recommended. The part is inexpensive to buy new (typically $20-$50), is a high-wear item, and failure can cause significant safety and operational issues, including a no-start condition or non-functional brake lights.

What to inspect on the donor part:

  • Not applicable as a used part is not advised.

OEM-only on this vehicle (don't cheap out):

  • While not strictly 'OEM-only', using a genuine Mazda or a reputable OEM-equivalent brand (like Standard Motor Products) for the brake light switch is highly recommended. Some modern switches contain redundant circuits for safety systems, and cheap aftermarket versions may lack the required reliability or internal configuration.

Aftermarket brands forum-validated for this vehicle:

  • Standard Motor Products (Intermotor)
  • Dorman

Brands owners have reported issues with on this vehicle:

  • Generic, unbranded switches from online marketplaces should be avoided due to the critical safety function of this part.

Real Owner Stories

Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.

2013 Mazda CX-5

Symptoms: Difficulty starting with a red or yellow ignition light, intermittent TCS, master warning, check engine, and TPMS lights, and inability to shift the transmission out of Park.

What fixed it: Replacement of the brake light switch.

Source hint: Mazdas247 Forum: 2013 CX-5 Electrical Issues

2016 Mazda CX-5

Symptoms: Check engine and traction control lights illuminated along with a no-start condition.

What fixed it: DIY replacement of the stoplight switch located on a bracket above the brake pedal arm.

Source hint: YouTube Repair: 2016 Mazda CX-5 Stoplight Switch Replacement ('Marcus Fixes Stuff')

Mazda3 (Platform Mate)

Symptoms: Conflicting information regarding wheel speed sensors, but presented with C0040 and P0571 codes.

What fixed it: Replacing the brake switch.

Source hint: Reddit r/mazda3

Frequently Asked Questions

Why is my 2013-2016 CX-5 push-button start turning red or yellow instead of green when I press the brake?
This is a classic symptom of a faulty brake light switch. The car does not detect that the brake pedal is pressed, which is a safety requirement for the engine to start. Replacing the switch (Part No. BN7N-66-490A) usually resolves this.
Can I just adjust the brake light switch on my CX-5 instead of replacing it?
While you can loosen the locknut and adjust the position, Mazda's official service manual cautions against re-using a switch once it has been removed from the bracket. Given the low part cost of $20-$50, replacement is the standard recommended procedure.
Is there a TSB for code C0040 on the CX-5?
While TSB SA-062-23 specifically addresses the newer CX-90, it confirms Mazda's diagnostic logic for C0040:24 as a 'Brake switch (No.1 signal) circuit malfunction.' For the 2013-2016 CX-5, the Mazda Service Manual for C0040:64 / C0040:24 provides the official diagnostic steps for illogical brake switch signals.
My CX-5 won't turn off its accessory power (radio stays on) after I park. Is this related to C0040?
No, that is a separate known issue on 2013-2014 models caused by a faulty park position sensor in the shifter assembly (Part No. KDY0-46-040), rather than the brake light switch associated with C0040.
I have C0040 and my traction control light is on. Could it be a wheel speed sensor?
There is conflicting information online, but for this specific Mazda generation, C0040 paired with symptoms like a no-start condition or brake lights stuck on typically points to the brake light switch rather than a wheel speed sensor.
Is the LED daytime running light failure on my 2016 CX-5 related to this brake code?
No. The LED DRL flickering or failure is a known issue covered under Mazda Safety Recall 4320A and requires replacing the entire headlight assembly; it is unrelated to the C0040 brake switch circuit.
Mazda3 2014-2018 Brake Light Switch Replacement
Mazda3 2014-2018 Brake Light Switch Replacement
HOW TO TEST BRAKE LIGHT SWITCH ON MAZDA 2 3 5 6 CX-3 CX-5 CX-7 MIATA. BRAKE LIGHTS NOT WORKING
HOW TO TEST BRAKE LIGHT SWITCH ON MAZDA 2 3 5 6 CX-3 CX-5 CX-7 MIATA. BRAKE LIGHTS NOT WORKING
Causes and Fixes C0040 Code: Right Front Wheel Speed Circuit Malfunction
Causes and Fixes C0040 Code: Right Front Wheel Speed Circuit Malfunction
2016-2019 Mazda CX5 Parking Brake Service Mode Tutorial (No Scan Tool) and Rear Brake Replacement
2016-2019 Mazda CX5 Parking Brake Service Mode Tutorial (No Scan Tool) and Rear Brake Replacement
Wrenchy
Article researched & written by
Go-Parts' AI research assistant. Every article is backed by live web research, verified OEM data, and real technician knowledge — so you get accurate, up-to-date information you can trust.
Meet Wrenchy → Updated Jul 21, 2026

The information in this article is provided for general reference and educational purposes only. Vehicle specifications, procedures, and part compatibility can vary by production date, trim level, and region. Always consult your vehicle's factory service manual and verify part numbers before purchasing or performing repairs. Safety-critical components such as airbags, seat belts, and braking systems should be installed by a qualified professional.

Year Coverage
This article covers the OBD-II Code C0040 for:
  • Mazda CX-5: 2013201420152016
In this article
🎬 Helpful Videos
Jump to ▴

Email This Guide

We'll send you a link to this article so you can read it later or share it.

Added to cart · Part