Page 1 of 6 123456 LastLast
Results 1 to 10 of 53

Thread: Auto brightness with PIC (PWM) and LDR for Lilliput 701 LED Backlit

  1. #1
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266

    Auto brightness with PIC (PWM) and LDR for Lilliput 701 LED Backlit

    Has anyone tried using a microcontroller to control the brightness of the LED backlight in a Lilliput? To my understanding, the monitor isn't actually controlling the brightness of the backlight, it's just simply controlling the contrast and so on. I'm measuring the voltage to the LED backlights and it's pretty much staying a constant 9.4V while adjusting contrast and brightness through the menu function.

    Just curious to see if anyone else has done this before I try it. I know I can do it but if someone else has already experimented with it would be nice
    Love

  2. #2
    Raw Wave
    Join Date
    Nov 2009
    Posts
    2,118
    Geez, I don't know whether I should even comment....
    LOL!

    Yes, it has been done. By others.
    But I lost track - I was dealing with a self professed expert with 20 years experience that couldn't apply Ohms Law and reckoned a PWM would need a capacitor to filter out the PWM!

    You should be able to search on here...
    Or if curiosity doesn't kill the cat, I could suggest a name or nine.

  3. #3
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    I searched but nothing I got really applied. I feel like the search function got worse with the new upgrade.

    ---------- Post added at 11:41 AM ---------- Previous post was at 11:34 AM ----------

    Just did a search using different keywords and found some stuff so nevermind! Thanks
    Love

  4. #4
    Maximum Bitrate
    Join Date
    May 2005
    Posts
    725
    Quote Originally Posted by rEegLer View Post
    Has anyone tried using a microcontroller to control the brightness of the LED backlight in a Lilliput? To my understanding, the monitor isn't actually controlling the brightness of the backlight, it's just simply controlling the contrast and so on. I'm measuring the voltage to the LED backlights and it's pretty much staying a constant 9.4V while adjusting contrast and brightness through the menu function.

    Just curious to see if anyone else has done this before I try it. I know I can do it but if someone else has already experimented with it would be nice
    I'd be interested in this. I bought a Lilliput with "5 way adjustable LED backlight" as an advertised feature. Well, big surprise, there's no backlight adjustment (it just alters the brightness/contrast of the displayed image).

  5. #5
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    I got it to work with a PICAXE mcu and Darlington Transistor array. Works really well actually. Now I just need to perfect the code and adjust some hardware. I'm powering the backlight off a 12v linear regulator but need an LDO regulator as it needs Vin to be above 14V which isn't always the case for my car. I'll post of some pictures when I finish everything.
    Love

  6. #6
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Finished everything and it works pretty well. My only issue is where to put the LDR. Below is my code and some pictures of the circuit. I'm a novice at programming (and with PICAXE basic) so if you see a more efficient way to do it please comment! And this is for instantaneous fading whereas delayed fading might be more appropriate.

    Code:
    ;LED Backlight PWM program V3 with instantaneous fading
    ;Written for Mazda3 CarPC by Tim Stocker
    ;
    ;Output 2 - LED Backlight
    ;Input 4 - LDR with 10kOhm Resistor
    ;Input 0 - Power-on V+ from monitor (9.45V = 65 w/100kOhm & 33.3kOhm voltage divider)
    
    
    symbol LED = 2
    symbol LDR = 4
    symbol PWR = 0
    
    setfreq m8								;overclock to 8MHz
    
    Startup:					
    	readadc PWR,b3		
    	if b3<50 then Standby				
    	readadc LDR,b1						
    	if b1>=160 then Sunny					
    	if b1>80 and b1<160 then Dusk
    	if b1<=80 then Night
    	goto startup
    
    Sunny:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	pwmout LED, 86, 275
    	readadc LDR,b1
    	if b1<=160 then DES_Sunny_to_Dusk
    	goto Sunny
    
    
    DES_Sunny_to_Dusk:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	b2=254
    	for b2 = 254 to 100 step -1
    	   pwmout LED, 88, b2
    	   pause 5	   			
    	next b2
    	goto Dusk
    	
    
    ASC_Dusk_to_Sunny:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	b2=100
    	for b2 = 100 to 254
    	   pwmout LED, 88, b2
    	   pause 5	   			
    	next b2
    	goto Sunny
    
    Dusk:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	pwmout LED, 90, 100
    	readadc LDR,b1
    	if b1>=180 then ASC_Dusk_to_Sunny
    	if b1<=80 then DES_Dusk_to_Night
    	goto Dusk
    		
    ASC_Night_to_Dusk: 
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	b2=20
    	for b2 = 20 to 100
    	   pwmout LED, 92, b2
    	   pause 5	   			
    	next b2
    	goto Dusk
    
    DES_Dusk_to_Night:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	b2=100
    	for b2 = 100 to 20 step -1
    	   pwmout LED, 92, b2
    	   pause 5	   			
    	next b2
    	goto Night
    	
    Night:
    
    	readadc PWR,b3
    	if b3<50 then Standby
    	pwmout LED, 94, 20
    	readadc LDR,b1
    	if b1>=100 then ASC_Night_to_Dusk
    	goto Night
    	
    Standby:
    
    	pwmout LED, off
    	readadc PWR,b3
    	if b3<50 then Standby
    	goto Startup




    Pretty simple program and circuit. The circuit is just the PICAXE controller, Darlington transistor array, a 12V regulator (soon to be a LDO 10V regulator since 12V is not necessary as the max voltage to the LED is 9.5V), and a 5V regulator for the PIC and LDR.
    Last edited by rEegLer; 03-22-2011 at 08:32 AM.
    Love

  7. #7
    Constant Bitrate
    Join Date
    Mar 2010
    Posts
    160
    That's cool!
    I've been mulling over how to do this on my setup.
    What are you reading to determine when it's sunny, night or dusk?

    I've never worked with PIC's but the rest of the electronics look doable. Any chance you could post or pm the schematic? Even better would be if I could buy a programed PIC from you with the schematic?

    Great job!
    Thanks
    davidk

  8. #8
    Newbie
    Join Date
    Oct 2010
    Location
    Perth, Western Australia
    Posts
    33
    Quote Originally Posted by davekra View Post
    What are you reading to determine when it's sunny, night or dusk?
    Looking at the code

    ;Input 4 - LDR with 10kOhm Resistor
    .....
    .....
    readadc LDR,b1
    if b1>=160 then Sunny
    if b1>80 and b1<160 then Dusk
    if b1<=80 then Night

  9. #9
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Quote Originally Posted by davekra View Post
    That's cool!
    I've been mulling over how to do this on my setup.
    What are you reading to determine when it's sunny, night or dusk?

    I've never worked with PIC's but the rest of the electronics look doable. Any chance you could post or pm the schematic? Even better would be if I could buy a programed PIC from you with the schematic?

    Great job!
    Thanks
    davidk
    PICAXE controllers are really easy to program so I would just recommend buying a couple and playing around with them. Their website has a lot of information on them. Each chip varies from $3 to 10 depending on the number of I/O's. I buy mine from SparkFun.com. I bought the PICAXE -14 project board to get started.

    I'm using an LDR (light dependent resistor) along with a 10kOhm resistor (to act as a voltage divider) to get an analog readout for the brightness. My circuit is a bit overkill because the Darlington transistor array has 8 channels but I'm only using 1 pulling only ~400mA. A smaller PICAXE controller might be able to be used (like the 08M) as I'm using the 14 pin one and only using 3 I/O's.

    ---------- Post added at 11:12 AM ---------- Previous post was at 11:05 AM ----------

    Quote Originally Posted by davekra View Post
    Any chance you could post or pm the schematic?
    Yea I'll post the schematic at somepoint. It's not that complicated.
    Love

  10. #10
    Constant Bitrate
    Join Date
    Mar 2010
    Posts
    160
    Cool, thanks.
    davidk

Page 1 of 6 123456 LastLast

Similar Threads

  1. Replies: 53
    Last Post: 05-13-2010, 04:57 AM
  2. Replies: 4
    Last Post: 03-21-2010, 06:20 AM
  3. Lilliput 629 or 702? - 2008 model LED backlit?
    By FastRX8 in forum LCD/Display
    Replies: 5
    Last Post: 09-05-2008, 10:15 AM
  4. lilliput auto-on mod and changing brightness
    By warnockm in forum LCD/Display
    Replies: 5
    Last Post: 01-28-2005, 05:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •