Page 3 of 6 FirstFirst 123456 LastLast
Results 21 to 30 of 53

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

  1. #21
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Would anybody be interested in a production board? Priced out it would be about $20 per board including PIC (pre-programmed). The user would be required to interface the board with their monitor and make the necessary power connections as well as wire the LDR (The actual LDR or Photocell would be included). The user could reprogram the board to fit their setup if needed.

    Just curious to see if anyone would rather buy a board then build it themselves. You can PM me if you're interested!
    Love

  2. #22
    Variable Bitrate
    Join Date
    May 2010
    Location
    Australia
    Posts
    378
    I might be interested.
    I am still trying to settle on a monitor to go in my ute but the eventual aim is to connect to the wire that goes to the current head unit that allows it to dim with the rest of my dash lights. It can go from nice and bright to nothing.
    Seeing as I already adjust this I think it would be a great way to also adjust the monitor.
    So for me I would be interested in A) could I wire up the input from the headunit in place of the LDR and B) I assume using the code I could put a curve on the brightness to suit the dimmer I have. For example if I find at night that the ratio of screen to dash lights is not right I can adjust the code so that lower in the range on the input it dims the screen at a larger ratio.

    Hope that all makes sense.

    Cheers

  3. #23
    Constant Bitrate
    Join Date
    Mar 2010
    Posts
    160
    How quickly does it transition between modes?

    thanks.
    davidk

  4. #24
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Hey stretch4x4,

    I could do the same thing with my car but my issue is that I always turn my lights on regardless of the time/sunny-ness. So the LDR gives me automation.

    A) Yes this is very easy to do. But there would just be two modes (Bright - Dark) assuming your car works like mine in that it's linked to your headlights. The code would actually be very short and easy to write because your simply just looking at the dimming voltage coming from your car. In my car its just simply ON or OFF (13.8V supplied or 0V).

    B) Yes you could change the output values to suit your needs. You could also add a potentiometer to manually adjust the brightness.

    Tim
    Love

  5. #25
    Variable Bitrate
    Join Date
    May 2010
    Location
    Australia
    Posts
    378
    Awesome,
    Not quite sure I explained my situation correctly but you answered my queries anyway
    I also drive with my lights on all the time for safety, hence my dash lights are always on.
    So I would like it so that when my dash lights are at or near full brightness the screen is the same.
    When my dash lights are really dim for driving in the middle of the night the backlight on the screen is also really dim.

    Basically I want whatever my dash lights to do the screen to mimic, with a pot or code to tweak the brightness on the screen to suit exactly the dash controls.
    You have said that this would easily be possible so I am quite excited

    I shall have to have a closer look at my screen options now.

  6. #26
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Do your dash lights automatically dim based on the outside brightness? So during the day they're at full brightness and at night they're dimmed?
    Love

  7. #27
    Variable Bitrate
    Join Date
    May 2010
    Location
    Australia
    Posts
    378
    Nope there is a pot that I adjust to suit the conditions
    I like manual things.

  8. #28
    Variable Bitrate rEegLer's Avatar
    Join Date
    Jul 2008
    Location
    Mechanicsburg, PA
    Posts
    266
    Yea very easy. Just wire the pot into voltage divider and have the PIC monitor the voltage. You could even use the value the PIC is receiving from the pot to enter directly into the PWMout command. This would be a direct relation between the two. You could do this with an LDR but it would be fluctuating too much to make it practical.

    Obviously just make sure you get an LED backlit monitor as everything would be different with a fluorescent model. Also, this has only been tested with the EBY701 lilliput monitor so it might take some adaptations to make it work other models.
    Love

  9. #29
    Variable Bitrate
    Join Date
    May 2010
    Location
    Australia
    Posts
    378
    Awesome.
    Must up my research into anti reflective displays. I have heard there is a wire on the xenarc monitors that make this easier to do but I think they are probably going to be outside my budget..

    Cheers for the help.

  10. #30
    Constant Bitrate
    Join Date
    Mar 2010
    Posts
    160
    Hey guys,
    I've been having fun learning how to program these things.
    Not wanting to work while at work I was going over the code. I came up with this...
    Code:
    symbol LED=2        'Output 2 - LED Backlight
    symbol LDR=4                  'Input 4 - LDR with 10Kohm resistor
    symbol PWR=1	             'Power-on V+ from monitor (9.45V = 65 w/100kOhm & 33.3kOhm voltage divider)	
    setfreq m8                       'overclock to 8mhz
    start:
        readadc PWR,b10	         'read power switch into b10
        if b10<50 then standby
        readadc LDR,b0                'read light sensor into b0
        if b0>=160 then sun           
        if b0>80 and b0<160 then dusk
        if b0<=80 then night
        goto start
        sun:
        w1=800                          'set pwm level into w1
        goto pwmset			'NOTE - use even OR odd numbers for w1
        dusk:				'or change lines 32 and 33 to + and - 1 instead of 2
        w1=400
        goto pwmset
        night:
        w1=160
        goto pwmset
        standby:
        w1=2
        goto pwmset
       
       
    pwmset:
        if w1=w2 then goto start                          'if at same brightness goto start
        if w2<=0 then:w2=w1:endif                       'set starting brightness
        do
            pwmout LED,199,w2                              'light the led
            if w1<w2 then:let w2=w2-2:endif            'decrease brightness
            if w1>w2 then:let w2=w2+2:endif            'increase brightness
        loop while w1!=w2                                    'loop untill brightness = desired level
        if w2=2 then:pwmout LED,off:endif              'when brightness at 2 turn off
        goto start
    I think it accomplishes the same things. This is my first attempt at programming anything so if you see a glaring error please let me know.
    The numbers used for PWMOUT have not been tested in the real world. I just used the wizard to give me 100%, 50% and 20%. I bet they will have to be adjusted when I hook things up.

    Thanks for inspiring me to do this.
    davidk

Page 3 of 6 FirstFirst 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
  •