Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Gamma control by light sensor

  1. #1
    Newbie kronos's Avatar
    Join Date
    Oct 2004
    Posts
    22

    Gamma control by light sensor

    Being the lazy bastard that I am I decided that it would be too complicated (read too much of an effort) for me to push a button to change frontend gamma from day to night so why not have a sensor to do all the hard work for me? That way when the darkness falls the gamma would be switched on to around half the normal value and when the day breaks it would be switched back on to normal value automagically.

    First the hardware. Pulled out my breadboard and off to work. As usually people do, I started with the most complicated scheme for the purpose i.e. with an op-amp running as a voltage comparator.


    All fine, but I can have the same thing a lot simpler, so I tried with a darlington.


    Fine too, but that left me with a problem: I needed a 12V source for the scheme to work (I know it's not that hard to find one in a computer case , but I like the KISS principle). So I ended up with just the photo-transistor and a diode for added protection since DTR in low state is -12V (I'd rather be on the safe side ). This has a disadvantage though: due to the extreme simplicity you can't adjust the level of light it's gonna respond to, but things are working just fine for me without adjusting anything (I even stayed wake last night to see the level of ambiental light at dawn when it will switch and it switched just fine). The photo-transistor is soldered at the end of two wires, isolated with shrink-wrap tubing and fitted inside a dc jack housing. The transparent head comes from a ball point pen cap which I had around; it needed some step by step cutting to get the exact diameter so I could fit it tight in the jack housing. It connects to pins 4 and 8 (DTR and CTS) of the com port on your computer.




    Now the software. Since the routine is integrated in the frontend I'm writing I decided to make it available to you guys as a standalone program. Remember that the program just sits in the tray and does not accept any user input (except exit command of course) it just monitors the serial port for the CTS line status (sensor connects the DTR line - which is set to high when the program starts - to CTS line when there's light falling on it and disconnects the two when there's no light) so if you run it without the sensor connected it will just darken your screen. You've been warned . Oh and by the way set the com port your sensor will be on in the ini file. Other than that hope somebody will find it useful.
    Attached Files Attached Files
    Why drink and drive when you can smoke and fly ?

  2. #2
    Constant Bitrate blackbravo's Avatar
    Join Date
    Nov 2004
    Location
    Southampton, UK
    Posts
    222
    Looks like a great idea,
    Zip Saved for when i build the comp, Still in the scavenging of parts stage

  3. #3
    Low Bitrate
    Join Date
    Dec 2004
    Location
    Long Island, NY
    Posts
    105
    nice idea there!

    my car has a built in light sensor that turns the lights on/off. How hard would it be to integrate it into your software?

  4. #4
    Maximum Bitrate
    Join Date
    May 2004
    Location
    NJ
    Posts
    558
    I like this, will build it. Now, is this photo-transistor has part number , can I get it from RadioS . Thanks for sharing

  5. #5
    Newbie kronos's Avatar
    Join Date
    Oct 2004
    Posts
    22
    Quote Originally Posted by boostedGT-S
    nice idea there!
    my car has a built in light sensor that turns the lights on/off. How hard would it be to integrate it into your software?
    I can give you the source code so that you can modify it if you connect the sensor in a different way. Alternatively if you provide me with schematics of how is your light sensor connected to your car maybe I can come up with some adapter to connect it to the serial port and use the software as it is.

    Quote Originally Posted by kingtut
    I like this, will build it. Now, is this photo-transistor has part number , can I get it from RadioS . Thanks for sharing
    Basically, because of the extremely low current of the serial port
    any photo-transistor or photo-diode will work. I used a generic (no part number, sorry) photo-transistor which looks exactly like a white transparent LED. Good luck with building.
    Why drink and drive when you can smoke and fly ?

  6. #6
    Maximum Bitrate
    Join Date
    May 2004
    Location
    Denver
    Posts
    487
    I have done the exact same thing... I used the cheapo photocells and am regulating voltage between the 12 down to about 8... I used a 317 instead though, no need for a transistor then... for the "split" resistors that would normally set the output voltage I put a pair of 15 turn 10k pots and with the upper leg I put two cheapo photocells from the "grab bag" at radio shack... about $15 in parts... one big difference is mine is not gonna "switch" over, it will transistion and street lights/headlights aren't going to change the brightness unless you are sitting directly under it...

    for my setup I added a fairly large cap to the control leg, to "slow" the transitions... it takes mine about 10 seconds to go from low to high... I haven't hooked up the Xenarc yet (still waiting on some bigger cohones )... but it is getting closer to the top of the to-do list... I will post pics of the proto board tonight... this rocks, glad to see I am not the only one climbing this hill...

    Kronos, keep this thread alive.. I think people bite once the kinks are worked out...

  7. #7
    Maximum Bitrate
    Join Date
    May 2004
    Location
    Denver
    Posts
    487
    I am skipping the computer connection, no need for serial input... light is all you need... backlight dimming looks way better than gamma settings, don't you think??

    I think it would be easier to hardwire it directly into the screen, than to build circuit and software... I have an in dash DVD player that uses another input on the screen, so I am looking for a total screen solution, not just computer input dimming...

    anyone else think this is a project worth pursuing??

  8. #8
    See me in my wet t-shirt. stevieg's Avatar
    Join Date
    Aug 2003
    Location
    Warwickshire, UK
    Posts
    1,887
    What a great idea!!!

    And of course this would work through tunnels as well (how cool would that look to your passengers as it adjusts automatically!!!)

    boostedGT-S, using a relay connected through your lights you could make a similar circuit that therefore runs off your car's sensor though it would probably need the line high setting reversed to work? (sure someone could correct me on this)

    mgithens, my lilliput is permanently in pieces behind my fascia so I might be up for your version if it truly is simple - how would it work?
    Ford Focus MP3 : www.stevieg.org/carpc Blog Updated 29 January 2009!
    Car PC Status: Complete - Undergoing Software Redevelopment

  9. #9
    Newbie kronos's Avatar
    Join Date
    Oct 2004
    Posts
    22
    Quote Originally Posted by mgithens
    I am skipping the computer connection, no need for serial input... light is all you need... backlight dimming looks way better than gamma settings, don't you think??

    I think it would be easier to hardwire it directly into the screen, than to build circuit and software... I have an in dash DVD player that uses another input on the screen, so I am looking for a total screen solution, not just computer input dimming...

    anyone else think this is a project worth pursuing??
    Actually you're right with hardwiring into the screen, but since I don't have a screen yet (raising funds ) I had nothing to practice on. If you do something in that direction then please post some info. Eventually I will go that route too, once I'll have a screen, but until then... I thought something is better than nothing and besides that some people simply lack the technical skills to modify a screen so a simpler solution might work for them. Let's make this a dual system thread, one approach being interfacing with a computer and the other interfacing directly with the screen so all the info is in one place.

    Quote Originally Posted by stevieg
    What a great idea!!!

    And of course this would work through tunnels as well (how cool would that look to your passengers as it adjusts automatically!!!)
    Quote Originally Posted by mgithens
    ... one big difference is mine is not gonna "switch" over, it will transistion and street lights/headlights aren't going to change the brightness unless you are sitting directly under it...

    for my setup I added a fairly large cap to the control leg, to "slow" the transitions... it takes mine about 10 seconds to go from low to high...
    Tunnels were the main reason I didn't use a capacitor to slow the response, but instead the wait can be implemented in software e.g. only during the night will it slow down the transition cause during the day we don't need it.
    Why drink and drive when you can smoke and fly ?

  10. #10
    Maximum Bitrate
    Join Date
    May 2004
    Location
    Denver
    Posts
    487
    Quote Originally Posted by stevieg
    What a great idea!!!

    And of course this would work through tunnels as well (how cool would that look to your passengers as it adjusts automatically!!!)

    boostedGT-S, using a relay connected through your lights you could make a similar circuit that therefore runs off your car's sensor though it would probably need the line high setting reversed to work? (sure someone could correct me on this)

    mgithens, my lilliput is permanently in pieces behind my fascia so I might be up for your version if it truly is simple - how would it work?
    ok, first let me start off by saying that I am a Mech Engr... electrical crap is for hobbies...


    this is a link to the heart and soul of the idea... simple voltage regulator, can handle MUCH more than we are asking for... the only other thing you need are some 10k-100k photocells and a few 0-10k potentiometers...


    here's the basic diagram... my changes were to replace R1 and R2 with 10k pots, then you can dial in the brightness and range that you want... and the second change is to add the photocells in parallel with R1... you need to find photocells that have a decent range (read - LESS RESISTANCE OVERALL)... some photocells go up into the 1M ohm range, we need the 10k to 100k ranges to be covered... I actually am running two 10k-100k in parallel to get 5k-50k... I found these in a $3 5-pack of photocells...

    the only other change that I would suggest is putting a sizeable electrolytic capacitor in parallel (positive side away from ground) with R2.. this will keep the light from "bouncing" it will stay constant and won't respond immediately to light changes... I used 3300pF and it worked great... more is better - within reason... and also, for reference, I skipped the C1 and C2 caps - those are for line noise and fluctuation... we're working with light, we won't be able to notice the small variations... ok, so here's a proof of concept video on a protoboard...
    video here

    this isn't 100% of the info that you'll need... one thing I am up against is that if you use the regulated 12V supply from your motherboard's p/s then you will have two issues... #1 is 12V... the car's electrical system is typically 14.4V when the alternator is turning, and this voltage regulator will take a hit so you will max out less than the supply voltage... from reading the forums someone mentioned that there was a 1ohm resistor in series with the positive lead to the backlight... so I will definitely be ditching that and just dial in my own equivalent... so if you do manage to bypass the 1ohm the voltage drop might put you right in the butter zone... #2 is that the computer has to be on for lighting...

    ok, feedback time... thoughts?? (I pulled the capacitor out for the video so that you could see it work fast, with the cap it takes about 10 or so seconds from dark to light)

Page 1 of 3 123 LastLast

Similar Threads

  1. light sensor, etc -> game port inputs
    By Alex Pt in forum Input Devices
    Replies: 19
    Last Post: 03-14-2005, 05:47 AM
  2. Gamma Control 3.0 Problem
    By brrman in forum Software & Software Development
    Replies: 2
    Last Post: 02-20-2005, 02:18 AM
  3. Gamma control
    By Bravellir in forum RR Bug Tracker
    Replies: 1
    Last Post: 02-19-2005, 02:38 PM
  4. Light sensor
    By 4u2n in forum General Hardware Discussion
    Replies: 6
    Last Post: 12-10-2004, 05:32 PM
  5. Gamma control in FP?
    By cash_Money in forum FrodoPlayer
    Replies: 6
    Last Post: 12-06-2004, 07:28 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
  •