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 →
🛍️ Shop This Part

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).

6 minutes to read 2018-2018 Mazda CX-3
Difficulty
3/5
Est. Time
2.5 hrs
DIY Doable?
🔧 Shop
Shop Labor
$150 - $300
Used OEM Price
$75 - $150
⚠️ Drivable, but... — Yes, but your adaptive headlights will not function, reducing visibility on curves at night. Driving without fully functional headlights may also be illegal in some areas.
Key Takeaways
  • 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.
The Headlight Control Module in the 2018 Mazda CX-3 is a small computer that manages the vehicle's advanced lighting functions. It receives signals from the headlight switch and various sensors to control the LED headlights. Its most important job is managing the Adaptive Front-lighting System (AFS), which swivels the headlight beams left or right as you turn the steering wheel to better illuminate curves in the road. This module also controls the automatic headlight leveling, ensuring the beams are aimed correctly regardless of passenger or cargo load, preventing glare for oncoming drivers. Without a properly functioning module, critical safety features like the adaptive and auto-leveling headlights will fail.

Symptoms of a Failing Headlight Control Module

The dashboard of a 2018 Mazda CX-3 showing the amber AFS OFF warning light indicating a system fault.
The most common sign of a module failure is the AFS warning light or 'Adaptive Front Lighting System Malfunction' message on the CX-3 dashboard.

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

A professional diagnostic tablet running Mazda-specific software for module programming and AFS calibration.
Replacing the module requires specialized Mazda diagnostic software (M-MDS or MDARS) to calibrate the swivel actuators and sync the module to the vehicle.

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 close-up of the Mazda CX-3 headlight control module showing the OEM part number D24H-51-02XB on the label.
When buying a used module, ensure the part number matches D24H-51-02XB or D24H-51-02XA to guarantee compatibility with the CX-3's AFS system.

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

A side-by-side comparison showing clean, healthy electrical connector pins versus green, corroded pins caused by moisture intrusion.
Before installing a new module, compare your harness connector to these: ensure pins are clean (left) and free of the green corrosion (right) that often causes AFS module failure.

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.

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 31, 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 Headlight Control Module for:
  • Mazda CX-3: 2018
In this article
🛍️ Shop This Part
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