I have followed the instructions at https://www.arduino.cc/en/Tutorial/HelloWorld and have my LCD displaying some text. I've also connected the LED back light (LCD pins 15&16).

I wanted to replace the potentiometer used to set the contrast, with a connection to the DAC pin. It needs to be about 0.8V.

When I connect the contrast pin from the LCD to my DAC pin on my ESP32 board, it doesn't work, the contrast is too high. Using a volt meter, it measures about 2.5V.

If I disconnect the LCD contrast pin from my DAC pin, the voltage measured is 0.8V.

Any ideas or examples on how to control the LCD contrast using a DAC pin?

I wondered if I need to add a resistor or something.


1 Answer 1


The DAC in the ESP32 is ok for sourcing current but not so good at sinking current, and that is what you need.

A amplifier set up as a voltage follower would work.

enter image description here

  • Could a simple pull-down resistor work as well?
    – Gerben
    Dec 25, 2018 at 19:35
  • 1
    Sure. Much easier :) It would need to be a balance. Low enough to pull down but not too strong for the output.
    – Rudy
    Dec 25, 2018 at 19:42
  • Got more details please? Dec 26, 2018 at 21:33
  • One Ohm would look like a short. 10K would look like it wasn't even there. I would try something like 150-330 Ohms. You could try a resistor by itself. Find one that gives you a reasonable contrast. Then go a little lower in resistance and add the D/A output. The resistance on its own does the pulling down, the D/A just is there to bring it back some.
    – Rudy
    Dec 26, 2018 at 23:46
  • Sorry, I meant where do I connect what? (iI'm a noob) Dec 27, 2018 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.