LED dimming affects sensor data

Please post your schematic so we can see how everything is wired up.