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.
- 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.
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).
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).
- 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
- 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 - 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 - 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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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-490→BN7N-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
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
Related OBD-II Codes
Frequently Asked Questions
Why won't my push-button start Mazda 3 turn on when the C0040 code is present?
Can a faulty brake switch cause my 2018 Mazda 3 to feel sluggish during acceleration?
Is there a specific TSB for the C0040 code on Mazda vehicles?
What is the correct way to install the brake light switch (Part BN7N-66-490A) to prevent the code from returning?
Are there other common issues for the 2014-2018 Mazda 3 I should look out for while fixing this?
Helpful Videos
We Have This Part in Stock
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.
- Mazda 3:
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2014-2018 Mazda 3
- Symptoms You May Notice
- Most Likely Causes
- Rare But Worth Checking
- Diagnosis Steps
- Parts You'll Likely Need
- Related Codes That Often Appear With This One
- Technical Service Bulletins (TSBs) & Recalls
- Platform-Specific Known Issues
- Mechanic-Grade Diagnostic Values
- Hidden / Shadow Codes Worth Checking
- Scan Tool Commands That Help
- Wiring & Ground Locations
- Real Owner Repair Stories
- OEM Part Supersession History
- Model Year Variations Within This Range
- Diagnostic Flowchart
- Other Known Issues on This Vehicle
- Used vs. New Parts: Buying Guide for This Vehicle
- Real Owner Stories
- 2020 Mazda 2
- 2011 Mazda 3
- 2018 Mazda 3
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off