Super Upgrade Apple iMac Mid 2011 21.5 A1311 - Brightness Control Using ESP32 (Part 7)
As I mentioned earlier, up until this point we had lost control of the brightness of the screen. However, we already have the necessary hardware to recover it: an ESP32. What we need now is to establish permanent communication between the ESP32, the motherboard and the software in charge of controlling it.
Luckily, we have an internal USB port on the motherboard. This port is used by the infrared sensor located behind the front logo of the iMac, so we have two alternatives:
- Definitively dispense with the front infrared sensor.
- Install a USB hub that allows us to keep the sensor and also connect the ESP32 inside the equipment.
In my case, I opted for the second alternative. Although I don't usually use the infrared sensor, I'm too fond of my machine to take away one of its original functionalities.
To do this, I needed to get a USB hub that would take up as little space as possible. I was lucky enough to find the following model:
Its interior is quite practical for this type of modification, as it uses a small circuit board with a drop-shaped chip. This allows it to be very thin and take up practically no space.
In my case, I kept the hub's input cable and two of its outputs: one for the IR sensor and one for the ESP32. I desoldered the other two ports, as I wasn't going to use them.
To continue with this modification, it is necessary to intervene the infrared sensor cable and use it as a connection to the USB hub.
Once the cable is identified, we need to recognize its power and data connections. In my case, I used a multimeter to identify the +5V and GND pins. Identifying the data pins required some additional testing: on the first attempt I connected the data cables in the wrong order, but by reversing them I got the USB device working properly.
The distribution of the connections was as follows:
- Input: Connection to the motherboard.
- Output 1: Connection to ESP32.
- Output 2: connection to the infrared sensor.
It would have been interesting to prepare a diagram with the distribution of the pins, but unfortunately I didn't have time to do it. However, with the right tools I was able to identify the necessary connections.
USB Hub, ESP32 and IR Sensor Mounting Test
Once the connections are complete, we can verify that both devices are working properly. In my case, I started the computer connected to an external display using the DisplayPort port.
When you start OS X, you can run the imac-esp32-pwm-brightness tool. When you start for the first time, the program will ask you to enable some system permissions in order to access the brightness control keys on your keyboard.
It will also be necessary to select the serial port through which the software will communicate with the ESP32.
Once the program has been configured and USB communication with the ESP32 has been established, we can check its operation using the brightness keys on the keyboard.
When pressed, we will see that both the imac-esp32-pwm-brightness application bar and the blue LED of the ESP32 modify their status. The bar moves according to the selected brightness level, while the blue LED increases or decreases its intensity according to the value sent to the microcontroller.
Replace the PWM signal from the display power supply with the signal from the ESP32
This step may seem a little intimidating, but it's the last change needed to regain control of brightness.
The program installed on the ESP32 generates a PWM signal on pin D23, with a variable voltage of 0 to 3.25 V and a frequency of 13 kHz.
This signal must replace the one originally received by the display's power supply from the motherboard. To do this, it is necessary to intervene the cable connected to pin 3 (DIM) of the 21.5-inch iMac's display power board and connect it to the ESP32's D23 output.
Once this modification has been made, we can reinstall the screen and connect its cables to check the result.
Finally, the iMac's original brightness control is back to work!

Previous article
Super Upgrade Apple iMac 2011 - Upgrade the heatsink (Part 6)
I modified the iMac's cooling system to improve heat dissipation from the new NVIDIA GTX 765M graphics card. I added two heatpipes from Lenovo heatsinks and modified several internal components to fit them, while trying to preserve the original airflow.
|

Next article
Super Upgrade Apple iMac 2011 - Fan Configuration and Final Testing (Part 8)
In this last part, I performed the final checks on the iMac, checked the operation of its sensors and internal devices, and adjusted the fan speed to improve cooling. Finally, I present the performance results and conclusions of an upgrade that took a lot of work, but allowed me to breathe new life into this machine.
|
Comments (0)
No comments yet.