Shop OBEX P1 Docs P2 Docs Learn Events
Problem with photoresistors — Parallax Forums

Problem with photoresistors

pcrobotpcrobot Posts: 103
edited 2005-11-01 04:53 in Robotics
Hello all,
My friend and I decided to advance our BOE-bot, from tactile navigation, to light sensing.
We hooked everything up according to the manual, and then we ran the first program in the chapeter, TestPhotoresisterDividers.bs2. It didn't work! freaked.gif
We had the sensors directly facing a 60W bulb, and they still registered 0, and then suddenly one value would change randomly, (and correctly) then it would all go to 0.
The manual said if there is low lighting, upgrade the resistors from 2k ohm to 4.7k ohm. We did... and still the same erratic behavior. confused.gif
Any ideas?
Thanks! burger.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Robotics
ro-bot-ics (noun)
the science or technology of robots, their design, manufacture, application, use, etc.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-30 03:24
    How, exactly are these sensors connected, for confirmation?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • pcrobotpcrobot Posts: 103
    edited 2005-10-30 04:13
    Like the diagram showed us for the Board of Education.
    Thanks! smilewinkgrin.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-30 04:41
    I can probably go find the schematic you are referring to, but I was hoping you'd follow your lines and detail the connections, that may or may not have helped one of us find a missed connection.· Guess you'll have to find another way to work this out.· Perhaps tear it all down and start over.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-10-30 10:27
    Something like 75% of all electrical problems are connection related.
    Obviously, a breadboard is only a good temporary solution as a trial.
    Sometime the 'trial run' becomes a real chore.

    I took my photocells and soldered the whole configuration to a small piece of circuit board. In this way, I have two little modules that not only work correctly, but can be pluged and unpluged. It also has adequate structural support so that the photocell stays pointed in the right direction.

    I also came across Jon William's circuit that suggested how to make the photocell's photo adjustible in software. While this does add a bit of software overhead, it opens you to having the software sample and determine useful levels of light. I think it is a Nuts & Volts article.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • bulkheadbulkhead Posts: 405
    edited 2005-10-31 00:05
    I don't know if this is already part of the circuit, but what about adding a potionmeter to adjust for different levels of ambient light?
  • pcrobotpcrobot Posts: 103
    edited 2005-10-31 01:00
    Chris Savage (Parallax) said...
    I can probably go find the schematic you are referring to, but I was hoping you'd follow your lines and detail the connections, that may or may not have helped one of us find a missed connection. Guess you'll have to find another way to work this out. Perhaps tear it all down and start over.
    OK, just click on the pic below to see a bigger pic of the page in the book with the schematic.

    30218530232-thumb.jpg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-31 04:07
    I think you missed the point of what I was getting at.· I can see the wiring diagram in the picture, but that doesn't necessarily mean that's how your system is wired.· You may have missed something and following through it might reveal that.· My best advice is to pull everything off the board and start over from that diagram.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-10-31 16:32
    You could make the 2K resistor adjustible, but Jon's suggestions allow you to do all the adjustment in software. Fooling with small adjustible resistors can be tricky. [noparse][[/noparse]if you get them turned to zero resistance, they often burn up the circuit and potentiometer]

    It is much safer to calculate a circuit and swap the 2k resistor with another value.

    If you are having trouble with the 3 component circuit, you need to start by measuring the Photocell's resistance in your ambient light condition and then figure out if that resistance which 'tops out' or 'bottoms out' the voltage divider. If it 'bottoms out', change the 2k to an appropriate value.

    The 220 ohm resistor is to protect the BasicStamp if the photocell goes to Zero resistance. It is there to limit the amount of current. Zero resistance would be your 'tops out' condition. You might try limiting the amount of light by a tube or filter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • pcrobotpcrobot Posts: 103
    edited 2005-11-01 04:53
    Chris Savage (Parallax) said...
    I think you missed the point of what I was getting at. I can see the wiring diagram in the picture, but that doesn't necessarily mean that's how your system is wired. You may have missed something and following through it might reveal that. My best advice is to pull everything off the board and start over from that diagram.
    Hint taken! smilewinkgrin.gif
    I took everything out, and re-wired the circuit.... and it worked! jumpin.gif
    What a great idea, thanks! idea.gif (I think I'll try this next time a circuit doesn't work wink.gif )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Robotics
    ro-bot-ics (noun)
    the science or technology of robots, their design, manufacture, application, use, etc.
Sign In or Register to comment.