lcd brightness control via arduino - Page 1
Forum section: electronics / beginners

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 04:01:03 pm
content: Hi All,Would it possible to control the brightness of a 20x4 LCD via an arduino PWM pin ?In the schematic attached the pin3 of LCD (VO) goes to a PWM pin on the arduino. Should there be any more components added to this ?Thanks in advance.

author: Benta
author_rank: Super Contributor
timestamp: November 08, 2017, 06:39:25 pm
content: To answer that, we need to know the type of backlight on the LCD.LED? EL? Something else?

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 06:42:31 pm
content: Oops sorry thought that was clear. Here it ishttps://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.com%2Fulk%2Fitm%2F253079231142Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: Mr.B
author_rank: Unknown
timestamp: November 08, 2017, 06:44:23 pm
content: Pin 3 is the contrast control, not the backlight.In that circuit the backlight is being controlled by the transistor connected to pin 16 of the LCD.PWM on P7 of your MCU should control the brightness.Edit to add clarity:You will need to use your arduino to control a FET or BJT to switch pin 16 to ground to control the backlight.Too much current for an arduino output to sink to ground.Also, you will need the variable pot as per the diagram on pin 3 of the LCD otherwise you will have no control over the LCD contrast.

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 06:52:02 pm
content: Quote from: Mr.B on November 08, 2017, 06:44:23 pmAh ok my bad. So I guess controlling the backlight wouldn’t be possible but controlling the contrast and omitting the cost of a pot would be a good idea.Quoteso just connecting p7 to the base of the transistor would do it? Would the transistor be necessary ?Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: Mr.B
author_rank: Unknown
timestamp: November 08, 2017, 06:55:04 pm
content: I edited my reply above to include:You will need to use your arduino to control a FET or BJT to switch pin 16 to ground to control the backlight.Too much current for an arduino output to sink to ground.Also, you will need the variable pot as per the diagram on pin 3 of the LCD otherwise you will have no control over the LCD contrast.I must have updated just before you posted.

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 07:01:28 pm
content: I was actually referring to the contrast and reducing BOM. Would it ok go that way ?Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: Mr.B
author_rank: Unknown
timestamp: November 08, 2017, 07:05:54 pm
content: You will not be able to control the contrast using PWM.You would need a true analogue output to do this. I am pretty sure the arduino does not have a true analogue output.Therefore, from a BOM perspective, a small trim-pot is way cheaper than a separate DAC.

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 07:08:15 pm
content: Cool thanks. Appreciate that.So to understand, how different is the pot from the pwm functional wise. Pot is controlling the voltage rite and pwm sends controlled voltage.Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: Mr.B
author_rank: Unknown
timestamp: November 08, 2017, 07:10:57 pm
content: Trim-pot sets an absolute voltage level.PWM is a square wave going from 0v to 5v with a variable duty cycle. It is not analogue as such.On second thoughts...PWM may work at a pinch using a small capacitor.You would need to experiment with this.Maybe someone else around here has done something like this.

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 08, 2017, 07:13:39 pm
content: Like a resistor and capacitor. I guess it’s called a low pass filter as Dave had explained it in one of his videos while designing a psu where he uses a pwm to control voltage with a resistor and cap to smooth the pwm signal.Www.Georgehobby.wordpress.comEquipments: DSO104z, Hakko FX888D, Brymen BM869s

author: Mr.B
author_rank: Unknown
timestamp: November 08, 2017, 08:35:22 pm
content: Quote from: anishkgt on November 08, 2017, 07:13:39 pmYes.Might work.Values will need to be calculated or experimented with based on the PWM frequency.

author: anishkgt
author_rank: Frequent Contributor
timestamp: November 09, 2017, 11:31:52 am
content: So i got this on LTSpice and it seems to be good. Second one is 80% duty cycle at 10khz.Would this be correct ?