Here's what's likely happening:
* Shared Wiring/Ground: The high beam circuit might share a common ground or wire with a sensor or component monitored by the engine control module (ECM). A short circuit, frayed wire, or loose connection in that shared pathway could cause the ECM to detect a fault and illuminate the check engine light. This is the most probable explanation.
* Voltage Drop Affecting Sensor: The sudden increase in electrical load when the high beams turn on could cause a significant voltage drop. This voltage drop might affect a sensor (like the oxygen sensor, mass airflow sensor, or crankshaft position sensor) causing it to malfunction and trigger a check engine code. This is less likely, but possible.
* Faulty ECM: While less common, a failing ECM could misinterpret the electrical load increase from the high beams as a fault in another system.
What to do:
1. Get the Diagnostic Trouble Codes (DTCs) read: This is crucial. A mechanic or auto parts store with an OBD-II scanner can read the codes stored by the ECM. The codes will pinpoint the exact problem the computer detected.
2. Inspect Wiring: Focus on the high beam wiring, paying close attention to any areas where the wiring might be close to other components or exposed to potential damage. Look for chafing, corrosion, or loose connections.
3. Check Ground Connections: Poor grounding can cause all sorts of electrical gremlins. Inspect the ground connections for the high beam circuit and any other systems that might share a common ground.
4. Check fuses and relays: While less likely to directly cause the check engine light, blown fuses or faulty relays associated with the high beams could be part of a larger electrical problem.
In short, the connection between the high beams and the check engine light is indirect. The real problem lies in the underlying electrical system. Getting the DTCs read is the first and most important step towards resolving this.