lowpassfilter-300x150

Hi guys,   I’m interfacing with a LCD 2×16 display for my Final Degree Project and I need a way to control the contrast voltage of the LCD. Contrast voltage range of a typical LCD 2×16 display is  between 5V and GND. A typical voltage value for the contrast is 0.5V so… how can we achieve this value ? Simply, always there are two ways, the “easy” way and the “pro” way !

pot_out-300x260

 

The “easy” way usually consists in a potentiometer connected to 5V and GND with the middle pin as the output variable voltage.

lowpassfilter-300x150

 

 

The “pro” way consists in a low pass filter connected to a microcontroller pin pwm. The contrast voltage value is selected changing the duty cicle of the pwm. With a 50KHz frequency output we can select a resistor of 15k and a capacitor of 100nF and check it with a LTspice simulation.

To obtain 0.5V output we have to set a duty cicle of 10%, Because 5V*0.1 = 0.5V. The output with this duty cicle is:

simulation

 

In this simulation we can see that the output is approximately 0.5V . We cam see that the output waveform takes 4.5 ms to get the desired value, this time is aproximately 3*R*C . To calculate the RC filter cutoff is necessary to do the next formula:

Freq = 1/(2*pi*R*C)  = 1/(2*pi*15k*100n) = 106 Hz.

This formula say to us that at 106 Hz the AC signal will be reduced by 3dB. We can check it in the bode diagram:

Bode

 

We can see that for small frequencies we get the same value at the output ( DC frequency value is 0 ) and for high frequencies we get smaller values from input to output, when this happens we can say that this is a RC Low pass filter. To obtain a DC output from pwm we have just to change the duty cicle of the 50Khz signal. For example .. with 90% duty cicle we get 5V*0.9 = 4.5V DC at output.

Comment ! see you in the next post !

Leave a Reply

Your email address will not be published. Required fields are marked *