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 2014-2018 Mazda 3: Brake Switch Failure Causes and Fixes

On a 2014-2018 Mazda 3, code C0040 almost always means the brake light switch has failed. This is a small, inexpensive part located above the brake pedal. Expect to pay $20-$35 for a new switch and either replace it yourself in under 30 minutes or pay a shop around $60-$160 for the total repair.

18 minutes to read 2014-2018 Mazda 3
Most Likely Cause
Faulty Brake Light Switch
Difficulty
2/5
Est. Time
0.8 hrs
DIY Doable?
🔧 Shop
Shop Labor
$61 – $161
Parts Price
$20 – $35
⚠️ Drivable, but... — You can likely drive the vehicle, but do so with extreme caution. Your brake lights may not be working, and critical safety systems like ABS and stability control will be disabled, which is dangerous for you and other drivers.
Key Takeaways
  • C0040 on your Mazda 3 means you have a faulty brake light switch, not a wheel speed sensor.
  • It is a very common, inexpensive fix that can be done DIY if care is taken during installation.
  • This fault will disable safety systems like ABS and DSC and may prevent your brake lights from working.
  • Always check for the companion code P0504, as they almost always appear together for this issue.
  • Proper installation of the new switch (with the pedal released) is critical to actually fixing the problem.
DTC C0040 on a 2014-2018 Mazda 3 indicates that the Anti-lock Brake System (ABS) or Dynamic Stability Control (DSC) module has detected a circuit malfunction or an illogical signal from the brake pedal switch. The system sets this code when the switch's signal doesn't match what's expected. Specific detection conditions include the switch signal remaining 'ON' for 6 minutes or more while driving over 12 mph, or the switch signal not appearing when the brake fluid pressure sensor detects that the brakes have been applied. This code specifically points to the brake switch circuit, not a wheel speed sensor, which is a common point of confusion with generic code definitions.

What's Unique About the 2014-2018 Mazda 3

Unlike many other manufacturers that might use C0040 to indicate a wheel speed sensor fault, Mazda dedicates this code within the ABS/DSC system specifically to the brake switch's logic and performance. The system is sensitive to signal correlation, meaning it compares the brake switch input with other data like vehicle speed and brake fluid pressure to ensure everything makes sense. When the inexpensive plastic switch begins to wear, its signal becomes intermittent or delayed, quickly triggering this fault and often bringing up a related powertrain code, P0504 (Brake Switch A/B Correlation).

Professional service recommended: While replacing the switch is physically simple, it is a critical safety component. Incorrect installation or adjustment can lead to non-functional brake lights, disabled stability control, or an intermittent no-start condition, increasing the risk of an accident.

Symptoms You May Notice

  • ABS, DSC, or Traction Control (TCS) warning lights illuminated on the dashboard.
  • Brake lights do not turn on when the pedal is pressed.
  • Brake lights stay on continuously.
  • Inability to start the car (for models with push-button start, as the system doesn't detect the brake being pressed).
  • Cruise control is inoperative.
  • Difficulty shifting out of Park.
  • A general warning light (triangle icon) may appear.
  • Sluggish or hesitant acceleration, as the engine computer may reduce power if it thinks the brake is being applied (brake override).
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the right front wheel speed sensor. Many generic OBD-II code websites incorrectly define C0040 as a wheel speed sensor issue, which is not correct for Mazda vehicles.

Most Likely Causes

  1. Faulty Brake Light Switch 🔴 High Probability The brake light switch is a high-use component with a plastic plunger that wears out over time, leading to intermittent or failed signals. It is a known failure point across many Mazda models.
    How to confirm: With a scan tool, monitor the brake switch status (PID) while pressing and releasing the pedal; if the status is erratic or doesn't change, the switch is likely bad. You can also test the switch's continuity with a multimeter as you depress its plunger.
    Typical fix: Replace the brake light switch. It is located on the bracket above the brake pedal arm. CRITICAL: The new switch must be installed and twisted into place with the brake pedal fully released to ensure the self-adjusting plunger is set correctly. Incorrect installation can cause the code to return immediately.
    Est. part cost: $20-$35
  2. Wiring or Connector Issue ⚪ Low Probability
    How to confirm: Visually inspect the wiring harness and connector at the brake light switch for any signs of damage, corrosion, or loose pins. Use a multimeter to check for proper voltage and ground at the connector per the service manual.
    Typical fix: Repair the damaged section of the wiring harness or clean/replace the connector.
    Est. part cost: $5-$50
  3. Blown Fuse ⚪ Low Probability
    How to confirm: Locate and inspect the fuse related to the stop lamp or brake circuit in the vehicle's fuse box.
    Typical fix: Replace the blown fuse. If it blows again, a short circuit is present that requires further diagnosis.
    Est. part cost: $1-$5

Rare But Worth Checking

  • Faulty ABS/DSC Control Module: This is very unlikely and should only be considered after all other possibilities, including the switch and wiring, have been thoroughly ruled out. This is an expensive component and rarely the cause for an isolated C0040 code.

Diagnosis Steps

  1. Scan for Codes: Use an OBD-II scanner capable of reading ABS/chassis codes. Confirm C0040 is present, and check for other codes like P0504.
  2. Check Brake Lights: Have a helper observe the brake lights as you press and release the pedal. Note if they are inoperative, delayed, flickering, or stuck on.
  3. Inspect the Fuse: Check the fuse for the stop lamps. If it's blown, replace it and re-test. If it blows again, investigate for a short circuit.
  4. Inspect the Switch and Connector: Visually inspect the brake light switch, located above the brake pedal. Look for physical damage to the switch, its connector, and nearby wiring.
  5. Test the Switch: The most definitive test is to use a scan tool to watch the live data for the brake switch PID. It should cleanly switch between 'On' and 'Off' as you press and release the pedal. If the signal is erratic or absent, the switch is bad.
  6. Test the Circuit: If the switch seems okay, use a multimeter to verify that the switch's electrical connector is receiving power and has a good ground connection, following the procedure in the Mazda service manual.
  7. Replace the Brake Light Switch: If the switch is confirmed to be faulty, replace it. It removes with a simple clockwise twist and pull motion.
  8. Critical Installation Step: When installing the new switch, ensure the brake pedal is in its fully released, resting position. Insert the new switch and twist it counter-clockwise to lock it. This allows the switch's internal plunger to self-adjust to the correct depth. Installing it with the pedal depressed will cause incorrect readings and a return of the C0040/P0504 codes.

Parts You'll Likely Need

  • Brake Light Switch (OEM #BN7N-66-490A) — This is the component that fails in the vast majority of cases for this code. Its internal contacts wear out from repeated use. This part supersedes the older BN7N-66-490.
    Trusted brands: Mazda (OEM), Standard Motor Products, Dorman, Beck/Arnley
    OEM price range: $25-$40
    Aftermarket price range: $15-$30

Related Codes That Often Appear With This One

  • P0504 — This code means 'Brake Switch A/B Correlation'. The Powertrain Control Module (PCM) and ABS module both monitor the brake switch. When they see conflicting signals, they set codes P0504 and C0040 together. This is the most common companion code.

Technical Service Bulletins (TSBs) & Recalls

  • SA-062-23: While for a different Mazda model (CX-90), this TSB confirms that Mazda associates DTC C0040 with a 'Brake switch (No.1 signal) circuit malfunction', often paired with P0504.

Platform-Specific Known Issues

  • A symptom specific to push-button start models is an intermittent no-start condition, where the green light on the start button does not illuminate because the car fails to recognize that the brake pedal is depressed.

Mechanic-Grade Diagnostic Values

  • Brake Switch Continuity Test — expected: With the connector disconnected and switch installed, there should be continuity between specified terminals when the brake pedal is depressed, and no continuity when it is released. The exact terminals vary by switch design but follow a simple on/off logic.. Failure: Continuity does not change when the pedal is pressed/released, or continuity is intermittent.
  • Voltage at Brake Switch Connector (Terminal D to Start Stop Unit) — expected: With the ignition ON and the switch disconnected, the voltage should be 0 V.. Failure: If voltage is present (B+), it indicates a short to power supply in the wiring harness between the brake switch and the Start Stop Unit.

Hidden / Shadow Codes Worth Checking

  • C0040:24: Brake switch (No.1 signal) circuit malfunction. This specific sub-code is set by the Start Stop Unit when it detects the brake switch No. 1 signal is 'on' for 3 seconds or more for 5 consecutive times, while the No. 2 signal changes state, indicating a stuck or faulty primary switch signal. (see via This sub-code is visible with a dealer-level scanner like the Mazda M-MDS or advanced aftermarket scanners with manufacturer-specific software (e.g., FORScan).)

Scan Tool Commands That Help

  • Mazda M-MDS / FORScan: Live Data PID Monitoring (e.g., 'BOO', 'STOP_LAMP_SW') — This is the primary diagnostic step to confirm a faulty switch. The PID value for the brake switch should change cleanly from 'Off' to 'On' the instant the brake pedal is depressed and vice-versa upon release. A lagging, erratic, or non-responsive PID points directly to a failing switch.
  • Mazda M-MDS: Clear DTCs [START STOP UNIT] — After replacing the brake switch or repairing a circuit fault, this command must be used to clear the C0040:24 code from the Start Stop Unit module to extinguish related warning lights and restore normal function.

Wiring & Ground Locations

  • G08 — At the lower side of the left A-pillar harness fixer, behind the driver's side kick panel.. This is a primary grounding point for the instrument panel harness, which includes circuits related to the brake switch and various control modules. A poor connection here can cause intermittent electrical issues, including faults like C0040.
  • G02 / G03 — At the upper side of the right A-pillar harness fixer.. These ground points serve the engine and instrument panel harnesses. The ABS/DSC module and PCM rely on clean grounds, and issues at G02/G03 could contribute to communication errors or false readings that might accompany a C0040 code.
  • Brake Switch Connector — Directly on the brake switch, located on a bracket above the brake pedal arm.. This 4-pin connector is the direct interface for the switch. The pins supply power, ground, and send two separate signals (one for brake lights/PCM, one for ABS/DSC/start-stop). Corrosion or loose pins in this connector are a common point of failure.

Real Owner Repair Stories

  • Reddit user on r/mazda3 (2011 Mazda 3 2.5 GT Manual) — Brake light on the dash, ABS code C0040 (Brake Pedal Switch 'A': Signal Plausibility Failure), and PCM code P0571 (Brake Switch 'A' Circuit).
    ❌ Tried (didn't work) Searching online, which gave conflicting information, with many sources incorrectly pointing to a wheel speed sensor.
    ✅ What actually fixed it Replacing the brake light switch resolved all codes and symptoms. The user confirmed it was an easy DIY fix.
  • YouTube video by Bob Kovacs (2014 Mazda 3 (Push-button start)) — Intermittent no-start condition. The green light on the start button would not illuminate when the brake pedal was pressed, preventing the car from starting.
    ❌ Tried (didn't work) Repeatedly pressing the brake pedal until the car would eventually recognize the input and allow a start.
    ✅ What actually fixed it Replacing the brake light switch located above the brake pedal. The video demonstrates the simple 'twist and pull' removal and 'insert and twist' installation.

OEM Part Supersession History

  • BN7N-66-490BN7N-66-490A — Revision to improve durability and reliability of the internal contacts.
    Heads up: The parts are interchangeable, but it is highly recommended to use the latest 'A' revision (BN7N-66-490A) as the original part is more prone to the failure that causes code C0040.

Model Year Variations Within This Range

  • 2017-2018: For the 2017 model year refresh, Mazda introduced some styling changes and made more safety systems standard or available. While the fundamental brake switch and its function remained the same, these later models may have more systems (like Smart Brake Support) that rely on the switch's signal, making a failure more immediately noticeable through various system warnings.

Diagnostic Flowchart

Start by confirming if C0040 is paired with P0504 and observing the behavior of the brake lights, as this platform uses a specific self-adjusting switch (BN7N-66-490A) prone to plunger failure.
Have a helper watch the rear of the car. Do the brake lights illuminate, stay stuck on, or fail to trigger?
Inspect the 'STOP' lamp fuse in the cabin fuse block. Is the fuse blown?
→ Replace the fuse ($1-$5). If it blows again immediately, inspect the wiring harness for a short circuit, particularly near the brake pedal bracket or rear light assemblies.
Locate the switch above the brake pedal. Is there visible damage to the plastic plunger or the electrical connector?
→ Clean the connector or replace the switch. Ensure the harness isn't being pinched by the pedal arm during travel.
Using a scan tool, monitor the Brake Switch PID. Does the status toggle cleanly between 'On' and 'Off' when the pedal is pressed?
The switch (BN7N-66-490A) is faulty. Are you ready to install the replacement?
→ CRITICAL INSTALLATION: Ensure the brake pedal is in the fully released (resting) position. Insert the new switch and twist counter-clockwise to lock. This allows the internal plunger to self-adjust. If you install it with the pedal pressed, the C0040 code will return immediately.
→ The issue may be a rare fault in the ABS/DSC module or a communication error. Re-verify wiring continuity between the switch and the PCM/ABS module per the Mazda service manual.
Using a scan tool, monitor the Brake Switch PID. Does the status toggle cleanly between 'On' and 'Off' when the pedal is pressed?
The switch (BN7N-66-490A) is faulty. Are you ready to install the replacement?
→ CRITICAL INSTALLATION: Ensure the brake pedal is in the fully released (resting) position. Insert the new switch and twist counter-clockwise to lock. This allows the internal plunger to self-adjust. If you install it with the pedal pressed, the C0040 code will return immediately.
→ The issue may be a rare fault in the ABS/DSC module or a communication error. Re-verify wiring continuity between the switch and the PCM/ABS module per the Mazda service manual.
→ Address engine or drivetrain codes first. If experiencing 'Ghost Touch' on the screen, refer to TSB 09-037/21, but this is unrelated to the C0040 brake circuit code.

Other Known Issues on This Vehicle

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

  • Infotainment Screen Delamination / Ghost Touch 🟠 Medium — Very common, often appearing after 3-5 years. The screen surface peels, cracks, or registers 'ghost' touches on its own. (Ref: Mazda issued TSBs (e.g., SSPB6, 09-037/21) and a warranty extension program to address this. The fix involves replacing the touchscreen layer, not the whole unit.)
  • Premature Rear Brake Wear 🟡 Low — Some owners report needing to replace rear brake pads and rotors more frequently than expected, sometimes before 50,000 miles.
  • Leaking Hydraulic Belt Tensioner 🟠 Medium — The accessory belt tensioner is known to leak its hydraulic fluid and fail, causing rattling noises from the engine bay. This is a common failure item.
  • Failing Motor Mounts 🟡 Low — The factory motor mounts, particularly the passenger-side one, can wear out prematurely, leading to increased vibration at idle or a clunking noise on acceleration.

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: Never. A used brake light switch is not recommended for this repair.

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

  • Brake Light Switch

Aftermarket brands forum-validated for this vehicle:

  • Standard Motor Products
  • Beck/Arnley

Brands owners have reported issues with on this vehicle:

  • Ultra-cheap, no-name brands from online marketplaces should be avoided due to inconsistent quality and 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.

2020 Mazda 2

Symptoms: Recurring P0504 codes even after a dealer replaced the switch; the owner had previously installed a replacement switch with the pedal held down.

What fixed it: Re-installing the switch with the pedal fully released to allow for proper internal plunger self-adjustment.

Source hint: Mazdas247.com: P0504 Issue – Brake Switch Signals A/B Correlation

2011 Mazda 3

Symptoms: Conflicting information regarding C0040 and P0571 codes; confusion whether the issue was the brake switch or a wheel speed sensor.

What fixed it: Replacing the brake switch, ensuring the two little black nubs lined up with the blue nubs to rotate and lock the switch into place.

Source hint: Reddit r/mazda3: My Mazda 3 is throwing OBD code C0040. Is this related to the brake switch or to the wheel speed sensor?

2018 Mazda 3

Symptoms: Intermittent failure to accelerate and sluggish performance accompanied by a P0504 code.

What fixed it: Replacing the worn-out brake switch located behind the brake pedal.

Source hint: Reddit r/AskMechanics: 2018 Mazda 3 P0504 Sluggish Acceleration

Frequently Asked Questions

Why won't my push-button start Mazda 3 turn on when the C0040 code is present?
On push-button start models, the system may fail to recognize that the brake pedal is being depressed. If the brake light switch is faulty, the green light on the start button will not illuminate, resulting in an intermittent no-start condition.
Can a faulty brake switch cause my 2018 Mazda 3 to feel sluggish during acceleration?
Yes. A faulty brake switch can trigger the brake override system. If the engine computer incorrectly thinks the brake is being applied while you are pressing the gas, it may reduce power, causing hesitant or sluggish acceleration.
Is there a specific TSB for the C0040 code on Mazda vehicles?
Yes, TSB SA-062-23 associates DTC C0040 with a 'Brake switch (No.1 signal) circuit malfunction.' While the TSB specifically mentions the CX-90, it confirms Mazda's diagnostic path for this code, which often appears alongside P0504.
What is the correct way to install the brake light switch (Part BN7N-66-490A) to prevent the code from returning?
The switch must be installed and twisted into place with the brake pedal in its fully released, resting position. This allows the internal plunger to self-adjust. Installing it while the pedal is pressed will cause incorrect readings and the code will return.
Are there other common issues for the 2014-2018 Mazda 3 I should look out for while fixing this?
Common issues for this generation include infotainment screen delamination (Ghost Touch), premature rear brake wear, leaking hydraulic belt tensioners, and failing passenger-side motor mounts.
Mazda 3 Review | 2014-2018 | 3rd Gen
Mazda 3 Review | 2014-2018 | 3rd Gen
2014 - 2018 Mazda3 Front Brake Change Tutorial | Pads and Rotors
2014 - 2018 Mazda3 Front Brake Change Tutorial | Pads and Rotors
Mazda Brake Switch Installed WRONG = $1000 Mistake!
Mazda Brake Switch Installed WRONG = $1000 Mistake!
ABS Code C0040, Circuit issue, Wiring Issue, ABS Fixed, Anti Lock Brake
ABS Code C0040, Circuit issue, Wiring Issue, ABS Fixed, Anti Lock Brake
Causes and Fixes C0040 Code: Right Front Wheel Speed Circuit Malfunction
Causes and Fixes C0040 Code: Right Front Wheel Speed Circuit Malfunction
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
Mazda3 2014-2018 Brake Light Switch Replacement
Mazda3 2014-2018 Brake Light Switch 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 3: 20142015201620172018
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