Author Topic: lcd brightness control via arduino  (Read 1462 times)

0 Members and 1 Guest are viewing this topic.

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
lcd brightness control via arduino
« on: November 08, 2017, 04:01:03 pm »
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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5877
  • Country: de
Re: lcd brightness control via arduino
« Reply #1 on: November 08, 2017, 06:39:25 pm »
To answer that, we need to know the type of backlight on the LCD.
LED? EL? Something else?
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #2 on: November 08, 2017, 06:42:31 pm »
Oops sorry thought that was clear. Here it is https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.com%2Fulk%2Fitm%2F253079231142


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1237
  • Country: nz
Re: lcd brightness control via arduino
« Reply #3 on: November 08, 2017, 06:44:23 pm »
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.
« Last Edit: November 08, 2017, 06:51:11 pm by Mr.B »
I approach the thinking of all of my posts using AI in the first instance. (Awkward Irregularity)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #4 on: November 08, 2017, 06:52:02 pm »
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.
Ah 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.

Quote
PWM on P7 of your MCU should control the brightness.
so just connecting p7 to the base of the transistor would do it? Would the transistor be necessary ?


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1237
  • Country: nz
Re: lcd brightness control via arduino
« Reply #5 on: November 08, 2017, 06:55:04 pm »
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.
I approach the thinking of all of my posts using AI in the first instance. (Awkward Irregularity)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #6 on: November 08, 2017, 07:01:28 pm »
I was actually referring to the contrast and reducing BOM. Would it ok go that way ?


Www.Georgehobby.wordpress.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1237
  • Country: nz
Re: lcd brightness control via arduino
« Reply #7 on: November 08, 2017, 07:05:54 pm »
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.

« Last Edit: November 08, 2017, 07:08:58 pm by Mr.B »
I approach the thinking of all of my posts using AI in the first instance. (Awkward Irregularity)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #8 on: November 08, 2017, 07:08:15 pm »
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.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1237
  • Country: nz
Re: lcd brightness control via arduino
« Reply #9 on: November 08, 2017, 07:10:57 pm »
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.
I approach the thinking of all of my posts using AI in the first instance. (Awkward Irregularity)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #10 on: November 08, 2017, 07:13:39 pm »
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.com

Equipments: DSO104z, Hakko FX888D, Brymen BM869s
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1237
  • Country: nz
Re: lcd brightness control via arduino
« Reply #11 on: November 08, 2017, 08:35:22 pm »
Like a resistor and capacitor...

Yes.
Might work.
Values will need to be calculated or experimented with based on the PWM frequency.
I approach the thinking of all of my posts using AI in the first instance. (Awkward Irregularity)
 

Offline anishkgtTopic starter

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: qa
    • George Hobby
Re: lcd brightness control via arduino
« Reply #12 on: November 09, 2017, 11:31:52 am »
So i got this on LTSpice and it seems to be good. Second one is 80% duty cycle at 10khz.

Would this be correct ?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf