Shop OBEX P1 Docs P2 Docs Learn Events
Cds sensors and Stamp 1 — Parallax Forums

Cds sensors and Stamp 1

ArchiverArchiver Posts: 46,084
edited 2000-06-18 21:19 in General Discussion
Hope you can help. Ive just discovered the stamp controllers and Im
building my first robot.

Ive got everything working, Servos and switches but want to add some
light detection for light source hunting.

Ive got a couple of Cds sensors from Maplin but cant find an
explanation on how to hook them up to the stamp.

Ive checked all of the documentation and FAQ's but with no success.
I found the Thermistor cuircit in the Stamp PDF document and adapted
that so I have one pin of the Cds to pin0 then a capacitor from the
other pin of the Cds to earth.

I did not have a 0.1uf capacitor but did have a 0.33uf capacitor.

The readings I got back were in the range of 120 - to 255 but
sometimes the reading was 0 if I blocked out all light.
Should I expect to see a range of 0 to 255 from this device if I have
the 0.1uf capacitor ? and where was the reading of 0 coming from when
I blocked out all light.

All Im going to do is compare the values coming back from the devices
and point the robot in the appropriate direction.

Heres the test code:

symbol x = b0
run:
pot 0, 39, x
debug cls,x
pause 15
goto run

I used Alt P to get the range for the ambient light in the room and
came up with 39.

Can anyone give me some pointers or point me to an example ?

Thanks

Gordon Endersby

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-06-17 02:31
    If your using a byte variable the largest value you will get is 255. Read in
    the Stamp manual about the RC time function. It's has all the necessary
    formulas to figure out the reading with different resistors and caps.
    -William


    Original Message
    From: <gordon.endersby@m...>
    To: <basicstamps@egroups.com>
    Sent: Friday, June 16, 2000 7:11 AM
    Subject: [noparse][[/noparse]basicstamps] Cds sensors and Stamp 1


    > Hope you can help. Ive just discovered the stamp controllers and Im
    > building my first robot.
    >
    > Ive got everything working, Servos and switches but want to add some
    > light detection for light source hunting.
    >
    > Ive got a couple of Cds sensors from Maplin but cant find an
    > explanation on how to hook them up to the stamp.
    >
    > Ive checked all of the documentation and FAQ's but with no success.
    > I found the Thermistor cuircit in the Stamp PDF document and adapted
    > that so I have one pin of the Cds to pin0 then a capacitor from the
    > other pin of the Cds to earth.
    >
    > I did not have a 0.1uf capacitor but did have a 0.33uf capacitor.
    >
    > The readings I got back were in the range of 120 - to 255 but
    > sometimes the reading was 0 if I blocked out all light.
    > Should I expect to see a range of 0 to 255 from this device if I have
    > the 0.1uf capacitor ? and where was the reading of 0 coming from when
    > I blocked out all light.
    >
    > All Im going to do is compare the values coming back from the devices
    > and point the robot in the appropriate direction.
    >
    > Heres the test code:
    >
    > symbol x = b0
    > run:
    > pot 0, 39, x
    > debug cls,x
    > pause 15
    > goto run
    >
    > I used Alt P to get the range for the ambient light in the room and
    > came up with 39.
    >
    > Can anyone give me some pointers or point me to an example ?
    >
    > Thanks
    >
    > Gordon Endersby
    >
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-06-18 21:19
    Sorry should have said its all happening with a stamp 1 and I have to
    use the pot command.
    I managed to get a 0.1uf capacitor today from maplins and im getting
    a much better response from the photo resistors.
    So that should sort me out.

    Thanks anyway

    Gordon




    --- In basicstamps@egroups.com, "William Cox" <william@c...> wrote:
    > If your using a byte variable the largest value you will get is
    255. Read in
    > the Stamp manual about the RC time function. It's has all the
    necessary
    > formulas to figure out the reading with different resistors and
    caps.
    > -William
    >
    >
    >
    Original Message
    > From: <gordon.endersby@m...>
    > To: <basicstamps@egroups.com>
    > Sent: Friday, June 16, 2000 7:11 AM
    > Subject: [noparse][[/noparse]basicstamps] Cds sensors and Stamp 1
    >
    >
    > > Hope you can help. Ive just discovered the stamp controllers and
    Im
    > > building my first robot.
    > >
    > > Ive got everything working, Servos and switches but want to add
    some
    > > light detection for light source hunting.
    > >
    > > Ive got a couple of Cds sensors from Maplin but cant find an
    > > explanation on how to hook them up to the stamp.
    > >
    > > Ive checked all of the documentation and FAQ's but with no
    success.
    > > I found the Thermistor cuircit in the Stamp PDF document and
    adapted
    > > that so I have one pin of the Cds to pin0 then a capacitor from
    the
    > > other pin of the Cds to earth.
    > >
    > > I did not have a 0.1uf capacitor but did have a 0.33uf capacitor.
    > >
    > > The readings I got back were in the range of 120 - to 255 but
    > > sometimes the reading was 0 if I blocked out all light.
    > > Should I expect to see a range of 0 to 255 from this device if I
    have
    > > the 0.1uf capacitor ? and where was the reading of 0 coming from
    when
    > > I blocked out all light.
    > >
    > > All Im going to do is compare the values coming back from the
    devices
    > > and point the robot in the appropriate direction.
    > >
    > > Heres the test code:
    > >
    > > symbol x = b0
    > > run:
    > > pot 0, 39, x
    > > debug cls,x
    > > pause 15
    > > goto run
    > >
    > > I used Alt P to get the range for the ambient light in the room
    and
    > > came up with 39.
    > >
    > > Can anyone give me some pointers or point me to an example ?
    > >
    > > Thanks
    > >
    > > Gordon Endersby
    > >
    > >
    > >
    > >
    > >
    > >
Sign In or Register to comment.