Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp help CDS — Parallax Forums

Basic Stamp help CDS

Seven71neSeven71ne Posts: 4
edited 2008-12-11 12:09 in BASIC Stamp
Hey everybody, well in my electronics class were working on the Basic Stamp (2)
ive been playing around with it lately, and i have messed around with bargraph LED's and the (9?) segment display.

what i want to do now is use a CDS cell with a led. Now i tried it using output 15, it lit up and worked, but its extremely dim, what do you guys think i should do? (running on 5vdd) i also have ULN2803's

thanks for the help guys!

Comments

  • UghaUgha Posts: 543
    edited 2008-12-10 01:25
    Can we see your code and can you explain/show how you have it wired up?
  • Seven71neSeven71ne Posts: 4
    edited 2008-12-10 03:35
    there is no code, and i have it just coming from output 15, its just 1 CDS and 1 LED, that eventually goes to ground, i tried doing this:

    {BS2 blabla} 'indecating that its a bs2
    OUTPUT 15 'output

    topp:
    out15 = 1
    goto topp

    but i dont know. any help would be great!
    if you can find a project with a photocell bs2 and a LED thatd be perfect!
  • Emir TeljigovicEmir Teljigovic Posts: 2
    edited 2008-12-10 04:55
    Seven71ne said...
    Hey everybody, well in my electronics class were working on the Basic Stamp (2)
    ive been playing around with it lately, and i have messed around with bargraph LED's and the (9?) segment display.

    what i want to do now is use a CDS cell with a led. Now i tried it using output 15, it lit up and worked, but its extremely dim, what do you guys think i should do? (running on 5vdd) i also have ULN2803's

    thanks for the help guys!
    ····· I am also new in basic stamp programming...
    ····· But before you go with your code you should make sure that any of your PINS do not send or receive more than safe amperage...
    ····· About 20 mA...
    ····· Go back to formula E = I * R

    ·
  • Emir TeljigovicEmir Teljigovic Posts: 2
    edited 2008-12-10 05:10
    Seven71ne said...
    there is no code, and i have it just coming from output 15, its just 1 CDS and 1 LED, that eventually goes to ground, i tried doing this:

    {BS2 blabla} 'indecating that its a bs2
    OUTPUT 15 'output

    topp:
    out15 = 1
    goto topp

    but i dont know. any help would be great!
    if you can find a project with a photocell bs2 and a LED thatd be perfect!
    ····· man...
    ····· call it a photocell...or thermistor or icecream...
    ····· that's a resistor...
    ····· go read about resistors...
  • Seven71neSeven71ne Posts: 4
    edited 2008-12-10 05:21
    i realise its a resister lol, im just trying to figure out why its so dim.
  • UghaUgha Posts: 543
    edited 2008-12-10 12:39
    We need to know how you have it hooked up.

    Usually when you use a CDS photo resistor you use a capacitor and the RCTIME command to measure the resistance
    of the CDS cell.

    Do you have it wired with a capacitor? Or do you have it like this:
    Stamp pin 15 -> CDS -> LED -> VSS/Ground

    If you have it like the above, then the CDS cell is acting like a current limiting resistor which means, the light level in the
    room will affect how bright the LED is. A bright room will make the LED glow brightly, a dark room will make it go dark.

    This is usually not the result you want so you have to either use something called a Voltage divider (kinda complex and
    requires a lot of math to get exact results) or you have to use RCTIME like I said above.

    If you've got it wired right using a capacitor, then you simply need to write the correct code.

    NOTE: If you have it wired incorrectly like I've described, and hold it up to an EXTREMELY bright light, you may burn out
    both the LED and the stamp pin due to too much current flow. This is another reason why this configuration isn't desired.

    If you need help wiring it up with a capacitor then let us know [noparse]:)[/noparse]
  • Seven71neSeven71ne Posts: 4
    edited 2008-12-11 04:24
    this project = done for, lol sorry for all the confusion, im currently looking on how to get switches working on it.
  • UghaUgha Posts: 543
    edited 2008-12-11 12:09
    If you only need to use one or two switches, the BUTTON command should help.
Sign In or Register to comment.