LED dimming affects sensor data

dialsc:
Here's my question: What's going on? :wink: I have no glue why the settings on the PWM port affects the readings from the sensor. Could somebody please help me figuring out what's happening and how to prevent this? I would be highly thankfull.

Most likely a decoupling problem.

Try putting a big ceramic capacitor across the wires that power the sensor (+5V and GND). Maybe another one between the screen LED's anode and ground.