2018 Mazda CX-3 Headlight Control Module: AFS Faults and Programming Explained
This guide covers the essential information about diagnosing, replacing, and programming the headlight control module for the 2018 Mazda CX-3, focusing on the critical role of the Adaptive Front-lighting System (AFS).
- Programming is mandatory. A replacement module must be programmed to the vehicle using Mazda-specific diagnostic tools (M-MDS/MDARS) for the adaptive headlights to function.
- The primary symptom of failure is the 'AFS Malfunction' warning light on the dashboard.
- You must match the OEM part number exactly. Use D24H-51-02XB or its predecessor D24H-51-02XA.
- A used OEM module is a good value, but you must budget for professional programming costs to complete the repair.
Symptoms of a Failing Headlight Control Module

A faulty headlight control module in a 2018 Mazda CX-3 will typically cause issues related to the Adaptive Front-lighting System (AFS). While complete headlight failure is possible, it's more common to see specific warning lights and functional problems.
- AFS Warning Light: The most common symptom is an amber headlight warning light on the dashboard, often accompanied by a message about an "Adaptive Front Lighting System (AFS) Malfunction". This indicates the module has detected a fault and has disabled the adaptive features.
- Headlights Don't Swivel: The headlights will no longer turn left or right when you steer into a corner. The auto-leveling feature may also be disabled.
- One or Both Headlights Out: In some cases, the module can fail to send power to one or both headlights, causing them to not turn on at all.
- Flickering or Intermittent Operation: The headlights may flicker, dim, or turn on and off without warning as the module's internal components fail.
- Associated OBD-II Codes: Diagnostic trouble codes (DTCs) are often stored when the AFS light is on. Common codes point to failures in the swivel actuators, which are controlled by the module. These include B10A3:86 (Left Swivel Actuator) and B10A4:86 (Right Swivel Actuator). Another potential code is B1D01:13, indicating an open circuit related to the headlight.
Known Issues, TSBs, and Recalls
As of mid-2026, there are no specific recalls for the 2018 Mazda CX-3 headlight control module. However, Mazda has issued Technical Service Bulletins (TSBs) for similar AFS issues on other models, which can provide insight.
For example, TSB 09-039/24 was released for newer Mazda models where the AFS control module software could falsely detect a headlight malfunction, triggering the warning light and storing DTC B10A3:86. The fix was a software update to the AFS module. While this TSB doesn't officially cover the 2018 CX-3, it highlights that AFS issues can sometimes be software-related rather than a complete hardware failure.
Important: The headlight control module is often confused with the headlight ballast or the entire headlight assembly. On the 2018 CX-3 with adaptive headlights, the control module is a separate, replaceable computer that specifically manages the AFS and leveling functions.
Programming and Calibration: A Critical Step

Yes, this module requires programming after installation. This is the most critical takeaway for anyone replacing this part. Simply swapping the module will not restore full functionality.
The programming process syncs the new module to the vehicle's computer systems and calibrates the Adaptive Front-lighting System. This procedure must be performed using Mazda's specific diagnostic software, such as the Mazda Modular Diagnostic System (M-MDS) or Mazda Diagnostic and Repair Software (MDARS). This is typically done at a Mazda dealership or by an independent repair shop that specializes in Mazda vehicles and has invested in the official diagnostic tools and subscriptions. A standard OBD-II scanner cannot perform this function.
If the module is not programmed, you can expect the AFS warning light to remain on and the adaptive headlight features to be inoperative.
Buying a Used Headlight Control Module for Your 2018 CX-3

A used OEM module is a cost-effective alternative to a new part, but careful purchasing is key. Since programming is required regardless, the savings on the part itself can be significant.
How to Verify Compatibility
The most important step is to match the part number exactly. For the 2018 Mazda CX-3, the primary OEM part numbers are:
- D24H-51-02XB (This is the latest revision)
- D24H-51-02XA (This is an earlier version, replaced by the one above)
Do not install a module from a different Mazda model, even if it looks identical. The internal software is specific to the CX-3's AFS system.
What to Inspect
When buying a used module, perform a close physical inspection:
- Check the Connectors: Look for any signs of corrosion (green or white powder), bent pins, or damage to the plastic housing.
- Inspect the Casing: Check for cracks, burn marks, or any signs of water intrusion. These modules are sensitive electronics and water damage can cause permanent failure.
- Verify the Part Number: Ensure the sticker with the OEM part number is present and legible. Match it to D24H-51-02XB or D24H-51-02XA.
Pro Tip: When budgeting for the repair, factor in the cost of programming. Call your local Mazda dealer or a trusted independent shop beforehand to get a quote for programming a customer-supplied module. This will give you the true total cost of the repair.
Cost Comparison: New vs. Used
Prices can vary, but here is a general estimate of what to expect.
| Part Type | Estimated Cost |
|---|---|
| New OEM (Dealer) | $370 - $470 |
| New Aftermarket | Not commonly available |
| Used OEM (Recycled) | $75 - $150 |
| Shop Labor (Installation & Programming) | $150 - $300 |
Replacement Location and Procedure Overview

The headlight control module on the 2018 Mazda CX-3 is typically mounted directly to the bottom or back of the headlight assembly itself. Accessing it often requires removing the front bumper cover to unbolt and pull out the entire headlight unit. While the physical replacement is straightforward for a DIY mechanic with basic tools, the final programming step is not a DIY task.
Frequently Asked Questions (FAQ)
Can I install a used module myself and drive to the dealer for programming?
Yes. In most cases, the basic headlight functions (low and high beams) may work after installation, allowing you to drive the vehicle. However, the AFS warning light will be on, and the adaptive features will not work until it is professionally programmed.
What happens if I don't program the new module?
If the module is not programmed, the Adaptive Front-lighting System (AFS) will not function. The headlights will not swivel with the steering, and the auto-leveling feature will be disabled. You will also have a persistent warning light on your dashboard.
Is the headlight control module the same as the ballast?
No. While they can be located near each other, they perform different functions. A ballast (or igniter) is a component specific to High-Intensity Discharge (HID/Xenon) headlights that provides the high voltage needed to start the bulb. The headlight control module is a computer that controls functions like AFS and auto-leveling for the LED headlights on the CX-3.
Will a module from a Mazda CX-5 or Mazda3 fit my CX-3?
No. Even if the part looks physically similar, the internal software and calibration data are specific to the vehicle model. You must use a module with the correct part number for a 2018 Mazda CX-3 to ensure proper function.
Technical Specifications
OEM Part Numbers: D24H-51-02XA D24H-51-02XB D24H5102XA D24H5102XB
Controls the Adaptive Front-lighting System (AFS) and automatic headlight leveling for LED headlights. Requires programming with Mazda M-MDS or MDARS software.
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-3:
- 🛍️ Shop This Part
- Symptoms of a Failing Headlight Control Module
- Known Issues, TSBs, and Recalls
- Programming and Calibration: A Critical Step
- Buying a Used Headlight Control Module for Your 2018 CX-3
- How to Verify Compatibility
- What to Inspect
- Cost Comparison: New vs. Used
- Replacement Location and Procedure Overview
- Frequently Asked Questions (FAQ)
- 🎟️ Get 5% Off