PWM For my LCD Screen

I am looking to dim my lcd screen. I am using an arduino mini at the moment. I might want to a photo cell or a resistance knob to control brightness. I took a look at this link Arduino PWM : Generate Fix and Variable Frequency Duty Cycle Signal (microcontrollerslab.com) But it blew my mind lol The details I have on the screen are located here. NHD-5.0-HDMI-N-RSXP-CTU.pdf (newhavendisplay.com)

Item Symbol Condition Min. Typical Max. Unit
Backlight PWM Voltage VPWM - 2.5 3.3 5.5 V
Backlight PWM Frequency fPWM VPWM = 3.3V 5 - 100 kHz

I could use the analogWrite(pin, dutyCycle) but I don't think that would work for my solution as I need 5 -100KHz and I think using analogWrite is only at 490hz

Just wanted to see if anyone could help me get my frequency setup.

Details?

490 is in the range "5 to 100kHz"

My 5" lcd screen has a PWM input for dimming the screen. I am looking to us the arduino to dim the screen. Does that make sense?

image

I need 5khz to 100khz is the range

HDMI display on Arduino, ESP32 or ESP8266?

Or only DIM the screen? I think there is no possibility for PWM.

From the datasheet.

R29 open gives 60mA.
R29 to GND gives 90mA.

The display uses a driver. I think you must search for another display or you must be lucky with 60mA/90mA.

All I’m using the Arduino for is to control the backlight. The screen itself is hooked to a raspberry pi. The screenshot shows the PWM pins.

You can easily change the PWM frequency of arduino analogWrite() function. If tutorial on your link is appeared too complicated for you, see another one - i hope it will be easier to understand:

Have you tried it? 490Hz is MUCH more than fast enough to prevent observable flicker.

will work just fine provided you first set the timer frequency like this

// Pins D9 and D10 - 7.8 kHz
TCCR1A = 0b00000001; // 8bit
TCCR1B = 0b00001010; // x8 fast pwm

or

// Pins D9 and D10 - 62.5 kHz
TCCR1A = 0b00000001; // 8bit
TCCR1B = 0b00001001; // x1 fast pwm

or

// Pins D9 and D10 - 31.4 kHz
TCCR1A = 0b00000001; // 8bit
TCCR1B = 0b00000001; // x1 phase correct

Can the RPi not PWM?

I have a ILI9486 OLED and the backlight roll at less then 1kHz.

Aren't those digital Pins? I thought analog write was for analog pins?

I am running android on the pi. I am sure its capable. But the pi will not be right next to the screen. The arduino can fit in the screen case.

Each of the 14 digital pins on the Mini can be used as an input or output. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. Pins 3, 5, 6, 9, 10, and 11 can provide PWM output; for details see the analogWrite() function.

Thank you for all the help. I ended up getting this to work on pin D5 (980). I just used two resistors to make 3.3 volts. Next is to use a photo cell to read brightness

So you still haven’t figured out how to properly set up the PWM (see posts #8 #9 #13 ) and used some kind of workaround. It would be useful for you to read the documentation

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.