This instructable shows how you can control the backlight of an LCD display by means of an I2C ADC module. The contrast can be controlled in the same way after removing the trimming potentiometer
Step 1: The Existing Situation
The backlight is controlled via P3 of the PCF8574.
P3 is connected to the base of the transistor and this again hangs with a 4.7 Kohm resistor at the 5 volt. Picture 04 and 05.
Step 2: Solution
A DAC, digital analog converter, MPC4725 that can also be controlled via I2C, I now use to control the brightness. Picture 06.
For this we need to unsolder only 4.7 Kohm resistance. Picture 07 red circle.
The module has the same connection as the PIC and could be so soldered to the terminal pins. Picture 07.
Because each module and the arduino have pullup resistors I have disabled them from the DAC. This can be done by scratching through the connections. Picture 08. This causes the resistors to come loose from the 5 volt. Picture 09.
I have attached the module with double-sided tape to the PCF8574 chip, Picture 10, and the connections made. Pic 11 and 12. A new 4.7 Kohm resistor, which is very large in relation, connect the DAC output with the P3-base connection.
Now you can control the brightness by controlling the DAC over I2C.
In my case of 0, almost out to 700, maximum. A simple program to demonstrate the operation has been added.
You can implement this in your own code so that you can adjust the brightness to your own needs.
The on / off control via the interface module continues to work.
The DAC holds the set value, so even after restarting the last set value is maintained.
Step 3: Software
The I2C addresses must be configured correctly.
I had 0x3F for the LCD display and 0x62 for the DAC as the address. The DAC is a 12 bit, so 4096 possibilities. This is then for 0 to 5 volts. This is therefore almost 1 mV per bit. What we now regulate is the base emitter voltage of the transistor and this is 0.6 to 0.7 volts. In this way there is only a small part that has an effect on the light control, but it is more than enough. We send through the 4.7 Kohm resistor which normally hangs at 5 volts, so maximum output of the DAC is no problem. Because the circuit is not essentially changed, the existing on / off control can continue to work. Managing the DAC is software-based and you need to include it in the code and adjust it to your own needs.
The ino file is a simple test file.
Step 4: Result
It is not easy to capture the light change because the camere adjusts.
But still a number of photos.
The meter indicates the mA of the backlight.