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.
- 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.
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.
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
- 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
- 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 - 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 - 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 - 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
- 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.
- 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.
- 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.
- Visually inspect the brake light switch located above the brake pedal. Ensure it is securely mounted and the electrical connector is fully seated.
- 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.
- 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.
- Inspect the related fuses in the interior and under-hood fuse panels.
- 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
bn7n66490→BN7N-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
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
Related OBD-II Codes
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?
Can I just adjust the brake light switch on my CX-5 instead of replacing it?
Is there a TSB for code C0040 on the CX-5?
My CX-5 won't turn off its accessory power (radio stays on) after I park. Is this related to C0040?
I have C0040 and my traction control light is on. Could it be a wheel speed sensor?
Is the LED daytime running light failure on my 2016 CX-5 related to this brake code?
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 CX-5:
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2013-2016 Mazda CX-5
- 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
- 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
- 2013 Mazda CX-5
- 2016 Mazda CX-5
- Mazda3 (Platform Mate)
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off