Light Sensor & LCD :: Code & Schematic


Closed Thread
Results 1 to 6 of 6
  1. #1
    munim's Avatar
    munim Guest

    Default Light Sensor & LCD :: Code & Schematic

    Dear All,

    My problem is really simple for you guys but not for me as I am a beginner.

    My problem is:

    I have a light sensor (works as a resistor), a PIC16F84A microcontroller, and LCD like the two of these...

    --
    | |
    --
    | |
    -- .

    If the light in the room increased the value in the LCDs also increases (limit is 0 ~ 99) and vise versa for decrement.

    I want a schematic and picbasic code ...

    Can anyone help me in this respect?

    Thanks in advance,
    Munim

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    It's certainely not something i would do with a F84. There's no ADC, no PWM module etc etc.

    If it was for me, i would choose a better one, 16F88, 16F648,16f676, 16f684 etc etc.

    But begin by understanding some part of your stuff first. You need to multiplex your displays (7 segments), see this one
    http://www.picbasic.co.uk/forum/showthread.php?t=5297

    Have a look in the PBP manual for ADCIN (what you need to read your ambient light) AND HPWM (what you need to play with your display brightness)

    Try something, block by block... and then if there's anything that doesn't work, post your code and schematic here.

    Have fun!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Dec 2006
    Location
    WADSWORTH OHIO USA
    Posts
    37


    Did you find this post helpful? Yes | No

    Thumbs up

    Are We Looking At A Light Meter, I Suspect.

    I have To Agree With Mister_e I'd Use A Pic With Adc

    Perhaps Like A 16f818 - 16f87x, K.I.S.S. METHOD,

    NO OFFENCE INTENDED.
    Last edited by SOMRU; - 11th December 2006 at 20:10.
    Thanks !
    SOMRU
    TWE/TFP/EE

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Or skip the ADC/PWM/PIC stuff but doing it in hardware.... ICL 7106 and pals, TC820cpl... no PIC at all !

    Buy a 5$ multimeter and hack it

    List is endless
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Wink not a so simple design ...

    Hi, Steve

    As a 0-100 scale is expected, ... RCTime function could do it.

    Buuuut, the problem is light scale ... it's a logarithmic scale !!!

    Sooo.... the input scale must be 0 - 10 000 !!! ( which is the A/D to use, Then ???? )

    I think a design around a CA3089 ( or with log response: FM IF systems w/signal stenght indicator make good sonometers ...) could do it easily.

    here, a modular 3 1/2 digit std voltmeter could be enough ... as the CA3161/3162 are ... out of my purse !!!

    Alain
    Last edited by Acetronics2; - 12th December 2006 at 08:37.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    log scale? Could be. Use a VCA (SSM2164 & pals), set a fix voltage at the input, place the LDR at the voltage control... now it's close to be LOG scaled

    OR Lookup tables OR some maths Or maybe there's some Log LDR?... I don't know and we don't have many parameter of this project so... HeeeeHaaa let's shed some tons of different ways
    Last edited by mister_e; - 12th December 2006 at 15:02.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  2. LCD Showes Some Wrong Letters
    By sbobowski in forum General
    Replies: 2
    Last Post: - 23rd September 2008, 19:15
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  5. is there any code bigger lcd than 3310
    By pcbb in forum mel PIC BASIC
    Replies: 0
    Last Post: - 23rd September 2007, 12:09

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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