LCD Proximity sensor not working, very high fan RPM
My late 2012 27" iMac has been suffering from a weird issue for the last months. The fan would start making noise, the Mac being all laggy and slow, and my screen would turn black for 1 minute or so. After this, all at once, the fan reverted to normal speed, the screen displayed as normal and the Mac was working again as usual.
After checking lots of guides and web sites, I have finally downloaded a very simple app (Macs Fan Control 1.3.2) that lets my check the fan speed and the temperature sensors of my iMac.
In the last week, I often turned on the iMac in the morning (after several hours of night inactivity) and the fan immediately started to reach very high RPMs, even up to 3600. At the same time, the LCD proximity sensor showed an unbeliavably high temperature: 125°C. This was obviously false, as the iMac had just been turned on and the display temperature was absolutely normal if I touched it. I could force the fan to slow down by customizing its speed to 1500 or so, but the iMac was still laggy and slow.
The LCD proximity sensor is apparently not working, then, but sometimes it reads normal temperatures (it is at 29°C right now as I am writing), and sometimes it gets to 125°C again, then everything is back to normal for hours... Any suggestions on how to fix this issue, possibly without sending the iMac to assistance? For instance, is there any way to manually control the LCD proximity sensor? Or maybe a way to replace it by myself, considering the iMac EMC is 2546?
iMac (27-inch, Late 2012), OS X El Capitan (10.11)