How do I select the proper photo resistor for using the pot command


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default I got it to show scale but I had to a 10 mf cap, is that a little high?

    Hello Again Sougata,

    I got it to work with the code below. Using a 10 microfarad capacitor I get a value for scale of 204 and the B0 variable shows 255. I haven't tried in my program yet and I'm not familiar with the usual values used for the POT command but 10 microfarads seems a little high and I would think it would really slow down the read. Maybe if I get a different LDR closer to the 50K maximum value I might be able to get away with using a smaller value capacitor? Anyways I'll try it in my program to see how it works, in the meantime what do you think about having to use a 10 microfarad cap for the LDR?

    For scale = 1 To 255
    POT PORTD.0,scale,B0
    If (B0 > 253) Then calibrated
    Next scale
    LCDOut $fe, 1,"S = ",DEC scale," B0 = ",DEC B0
    Stop
    calibrated:
    LCDOut $fe, $c0,"S = ",DEC scale , " B0 = ", DEC B0
    Stop

    Thanks
    jessey

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default 10 and 13 are linefeed and carraige return

    Hi,

    I am sorry you got confused with the 10 and 13. They just instruct your hyperterminal to make a new line so that you get the next reading on a next line. Good that you found out the solution to your LCDOUT and your code is okay. Now the calibration part :

    Well try it out with a 0.22uF. And run the program. Your B0=255 means that the program has calibrated the scale value for your circuit. Notedown the scale value and use it in your program without using anymore calibration. It is a one time process to get the full range out of the pot command. Actually the pot command charges and discharges your capacitor through this resistor (in your case the LDR) and finds the time constant. It makes the Input/Output to get a tristated sort of logic. The PICs have an inbuilt schmiddt trigger which allows the software to sense the discharge slope.

    Hope this helps

    Regards

    Sougata

  3. #3
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Thanks Sougata

    Thanks Sougata,

    I managed to find a 0.22uF and it works great. Thanks for your much appreciated help.

    jessey

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 21:31
  2. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 21:23
  3. PBP2.50b and POT command problem ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 18:14
  4. Replies: 4
    Last Post: - 24th January 2007, 23:20
  5. pot command
    By lerameur in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 25th November 2006, 05:12

Members who have read this thread : 0

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