Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« on: March 15, 2010, 06:28:30 pm » |
Hi -.^
I'm asking myself if there's a solution to eliminate backlight flickering when adjusting the brightness under full power on a SparkFun serial LCD (16x2)? This flickering is not very strong, but in some conditions (neon lights for ex.) it's a clearly visible.
If I'm not wrong it's cause the backlight LED is drive by PWM. So, is someone had trying to place a capacitor somewhere to "smooth" the PWM?
Or the best way is to use another power source, without PWM?
|
|
|
|
|
Logged
|
|
|
|
|
MD, USA
Offline
God Member
Karma: 2
Posts: 663
A jack of all trades and a master of none!
|
 |
« Reply #1 on: March 15, 2010, 06:31:46 pm » |
Is there a need to adjust the back light brightness? Personally i use a pot not a PWM pin to adjust the brightness of the display but leave the back light on a switch. I think a pot would be a better option for adjusting the back light.
|
|
|
|
« Last Edit: March 15, 2010, 06:32:24 pm by digimike »
|
Logged
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #2 on: March 15, 2010, 08:02:34 pm » |
I find the backlight very powerfull (very well to use by daylight), but in most of case what I'm making will be use by night (power supply for astro-photo applications) so it's a real need (we try to hide a maximum of lighting). During tests I set the backlight at a very low value (130, BYTE), in regard of possible parameters; it's quite fine, but not too much ^.^
Else, I asked to find a way with the PWM (capacitor?) cause I wouldlike to keep control of brightness by software; it's a good meaning to send visual alerts, by night :o
Anyway, I'll see for a hack of the LCD PCB, and if it's too hazardous (schematic is cheap for the serLCD-v2.. ^.^) I'll do as you say with another circuit to set the backlight. -.^
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #3 on: March 16, 2010, 04:42:07 am » |
You can't use a capacitor to smooth PWM for an LED as you need the voltage pulses to turn on the LED. If you put a capacitor on you will not have enough voltage to turn on the LED when you want it dim.
The way to stop it flickering is to incr4ase the PWM frequency. Lots of info on that just do a search.
|
|
|
|
|
Logged
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #4 on: March 16, 2010, 09:32:15 am » |
Exact Grumpy_Mike, as the voltage is always the same with PWM, if I filtering it, it'll be impossible to change dimming of the LED... -.-
I thought to change the PWM frequency, but as it drive by the PIC on my serial LCD, it may be not easy. I'll see that -.^
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #5 on: March 16, 2010, 01:32:17 pm » |
as the voltage is always the same with PWM, if I filtering it, it'll be impossible to change dimming of the LED NO, see how PWM works:- http://www.thebox.myzen.co.uk/Tutorial/PWM.htmlbut as it drive by the PIC on my serial LCD, No the PWM frequency is controlled by the arduino, you just need to alter some values stored in registers.
|
|
|
|
|
Logged
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #6 on: March 16, 2010, 02:13:54 pm » |
Hum, yes, I had to say "voltage is always the same at high level", I spoke about filtering the signal, in our case. Of course, in PWM, voltage is low or high; not always the same ^.^ No the PWM frequency is controlled by the arduino, you just need to alter some values stored in registers. :-? I did not understood that in the serLCD docs.. Could you tell me the process to alter those values?
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #7 on: March 16, 2010, 02:34:59 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #8 on: March 16, 2010, 05:28:31 pm » |
Thank you to help me, but... I'm not sure to understand what you want to tel me. :-/ In the datasheet of the LCD board I see how changing the duty cycle of the PWM to adjust backlight by sending a cmd to the PIC to change the PWM frequency (0x7C + 128<157). So I think the backlight PWM is driving by the PIC, not by the Arduino (?). :-? I imagine I have to send a cmd to the PIC to change the PWM frequency like in your example, but I don't see how. Sorry for all my questions but I like to know what I do and not just copy some code parts ^.^
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #9 on: March 17, 2010, 03:25:40 am » |
So can you post a link to the data sheet of the device you are using?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #11 on: March 17, 2010, 10:38:37 am » |
Woho... I just understand something.. In: http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDFWe can see: "By sending the special command character 0x7C followed by a number 128-157, the backlight PWM value will be set." But in fact, we don't know if it's frequency or duty cycle that will be changed... In regard of results (flickering) at half values it's possible that the command is on frequency and not on duty cycle (?). I don't have scope to see the signal shape. Well, it does not solve the problem... :-/
|
|
|
|
« Last Edit: March 17, 2010, 10:48:47 am by ekaki »
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #12 on: March 17, 2010, 11:09:23 am » |
Ok having looked at the data sheet it looks like you are stuck with the flicker problem unless you want to hack the LCD and control the back light with the arduino's PWM.
|
|
|
|
|
Logged
|
|
|
|
|
Celtic Kingdom
Offline
Sr. Member
Karma: 2
Posts: 455
hard oui no!!!
|
 |
« Reply #13 on: March 17, 2010, 11:36:32 am » |
Yes, it's why I ask in my first post if the most simply solution will be by using an auxiliary way to control the backlight. A way where I could have fine tune possibilities.
I will see.. Cause I will have to make a complete power system, use a I/O output on the Arduino, etc. It's a bit a pity to get a component like this pretty serLCD but to have to hack it at end.
However, thank you for your help Grumpy_Mike -.^
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 299
Posts: 26031
Solder is electric glue
|
 |
« Reply #14 on: March 17, 2010, 11:53:55 am » |
It's only a matter of connecting the base of that transistor to the arduino. You should be able to lift off the resistor from the base to the PIC and solder a wire on. Then put it through a resistor before you connect it to an arduino PWM.
|
|
|
|
|
Logged
|
|
|
|
|
|