A camshaft sensor, also known as a camshaft position sensor (CMP), is an electronic device that works in conjunction with the crankshaft position sensor (CKP) to determine the exact position of the crankshaft drive in an internal combustion engine. The camshaft sensor monitors the camshaft's position and sends information to the engine control unit (ECU) about when each valve is open on a particular cylinder. This information is crucial for the ECU to calculate the ignition timing and fuel injection. In engines with variable valve timing, the camshaft sensor is particularly important for monitoring the relationship between the pistons and valves in the engine