Hi, for my distributor test rig I am using an IR obstacle avoidance module, that detects an obstacle 1x per rev. This is used for calculating RPM, and mechanical advance.
The test rig works as follows: The code measures the time between an interrupt from the IR module and an interrupt from the distributor. It is then converted to angle using RPM and displayed onto an LCD. When RPM increases, this angle value decreases. The amount it decreases by is my mechanical advance.
Simple.
The issue is with my IR obstacle avoidance module. When accidently moving the emitter and receiver or when the potentiometer is slightly altered, the values printed do not make any sense anymore, and become inconsistent, even though it is calibrated so that the LED flashes every time the obstacle is in front of the module. I find myself fiddling randomly with the potentiometer or the emitter or receivers until the values are as should.
Why does the position of the diodes matter? Shouldn't the only thing that matters be the fact that the LED turns on when the obstacle is in front and off when it isn't?
I should probably start by replacing the IR obstacle avoidance module for a new one, but I want to understand why this might happen.