Shop OBEX P1 Docs P2 Docs Learn Events
Nubie question — Parallax Forums

Nubie question

Mike WMike W Posts: 105
edited 2007-08-08 20:57 in General Discussion
I am using a SX 28 and the circuit below along with RC Time to monitor light. This circuit works with direct sunlight only.· How could I make it more sensitive to dimmer light.
·
Main:
· HIGH RC_Pin································· ······················ ·' center sensor
· PAUSEUS 250································· ····················· ·' charge the capacitorfor 250 us
· RCTIME Rc_Pin, 1, CT_Sensor, 5·············· ··········· ·' measure in·10 us (2 x 5) units
· PAUSE 100
GOTO Main



Post Edited (Mike W) : 7/19/2007 8:18:53 PM GMT
992 x 573 - 13K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-19 23:45
    Your problem is somewhat independent of what processor you're using, so I'd suggest you have a look at the tutorials in the Stamps in Class series for a discussion of light sensing with a photoresistor.

    Basically, in low light levels, the sensor's resistance is relatively high and the processor has a fixed voltage threshold.· The capacitor charges and discharges slowly so the RCTIME counts are high and probably overflow at times.· The trick is to use a smaller capacitor.· It won't work though when the light levels are high again.

    On the SX, you can use larger time units with the same value capacitor at the lower light levels.· The Stamps don't allow you to adjust that.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-07-20 00:03
    As Mike was saying in his last two statements, you may find that you can adjust the value of the PAUSEUS command down (thus charging the capacitor for a shorter time period) and/or the last value of the RCTIME command up (thus causing the command to wait longer for the pin to change but also decreasing its time resolution) until you find a combination that works for your light levels.

    If you like to challenge yourself, figure out how to have your software detect when it has not obtained a valid reading (probably when CT_Sensor = 0), then adjust one or more of the values and repeat the process. This would be a great learning exercise and should allow your program to adjust to a much wider range of light levels.

    Let us know how it goes.

    - Sparks
  • HenrymouHenrymou Posts: 128
    edited 2007-08-08 20:15
    Make sure all of yo projects for the SX chip are in SX/B at first, It's similar to Basic, and is easier than the assembly language fo the SX CHip. After you master SX/B move up to assembly language.

    peace newbie
    -Henry
  • Mike WMike W Posts: 105
    edited 2007-08-08 20:57
    I believe that this last response is for another post “ newbie on SX chip”
    ·
    But to get back to my post. After experimenting a while I have come to the conclusion that a phototransistor will not suit my needs. I can change it’s sensitivity but only to make it less sensitive. It became saturated with light well before it reached full sunlight. But it did work well on cloudy days.
    ·
    Thanks to everyone for their input.
    ·
    Mike
Sign In or Register to comment.