Shop OBEX P1 Docs P2 Docs Learn Events
Turning on a Light Bulb — Parallax Forums

Turning on a Light Bulb

bushybushy Posts: 3
edited 2008-11-02 15:16 in BASIC Stamp
Hi,

I'm trying to make an photoresistor turn on a lamp/bulb. I'm working with the BASIC Stamp Activity Kit so the photoresistor shouldn't be a problem, but I don't know how to turn the lamp on and off aside from using a servo to flip the switch. I'm a total newb and I don't know the proper terminology to search for this.

Any help would be much appreciated.

Thanks!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-30 18:54
    Bushy,

    Please provide some details about the lamp…is it AC or DC? How many volts/amps/watts? All of this depends on how you would go about controlling it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • bushybushy Posts: 3
    edited 2008-09-30 19:51
    It recommends a 60 Watt Type A bulb and is 120V 60Hz AC
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-30 19:58
    You can certainly use a servo to turn on and off a conventional switch. You can also get a solid state relay (SSR). For a 60W bulb, something as simple as a Crydom D2W202F would work (Google the model # to find a datasheet). All of these have a + terminal to connect to a Stamp I/O pin and a - terminal that you'd connect to the Stamp's Vss (ground) pin or supply. You'd make the I/O pin HIGH to turn it on and LOW or INPUT to turn it off. The other pins on the SSR switch the AC. There are higher power SSRs with screw terminals that work the same way and may be easier to use. If you don't know how to properly protect yourself and your circuits from the dangers of AC, stick with the servo and ordinary AC switch.
  • JonathanJonathan Posts: 1,023
    edited 2008-09-30 20:01
    Bushy,

    I·would reccomend a solid state relay for switching an AC light.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-09-30 20:31
    The X10 "Firecracker" module is very good for this.
  • bushybushy Posts: 3
    edited 2008-10-02 06:56
    Thanks for the specifics Mike. I won't do this knowing more, but why would the board be in danger if I'm using an SSR?

    Also, what would I use if it was DC power?
  • GeekgirlGeekgirl Posts: 50
    edited 2008-10-02 11:26
    · Solid State Relay is a somewhat generic term. An SSR uses electronic components to do the same thing as the more familliar mechanical relay with it's energizing coil and mechanical contacts.

    · Solid State Relays are made to switch either AC or DC, but the same one won't work interchangably with both AC and DC.· SSRs use different types of internal electronics dependant on whether they are designed to switch AC or DC, so you need to make an appropriate selection based on what you plan to switch.

    · For switching an AC light bulb, an SSR based on "Triac" technology is what you'd need, while for switching a DC load, you'd be using one based on "mosfet" technology. When you look in an electronics catalog for SSRs, you'll see in the description whether it's for AC or DC.


    · As for dangers to the board, there's always danger when you have 120VAC where an errant figer can come in contact, plus the danger of working with unfamilliar components and the inherent·increased possibility of miswiring them.·The basic stamp doesn't respond well to 120vac.

    ·· Darlene

    Post Edited (Geekgirl) : 10/2/2008 11:36:57 AM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-10-02 13:37
    "Not responding well" meaning bursting into flame, popping like a firecracker, and/or other permanent damage if 120vac is put across the module.
  • GICU812GICU812 Posts: 289
    edited 2008-10-31 01:55
    If you mean to do something with it, look into getting some X10 hardware and use the XOUT Pbasic command.

    You can get authentic X10 gear on ebay for cheap, thier website is way over priced
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-10-31 02:52
    I'd use a simple old mechanical relay. The Stamp can't drive directly a relay big enough to switch a 60w bulb, but it can switch it through, for example, a ULN2803A chip (about a buck from Mouser). I'd suggest the following:

    ULN2803A relay driver chip (Darlington array), Mouser 757-ULN2803APG. This is $0.89 from Mouser, and it will drive eight relays from eight Stamp outputs.

    Song Chuan 12v SPNO relay, 12v coil, contacts rated 25A. This will switch a heckuva lot more than 60 watts, can be driven directly from the ULN2803A, and I'm holding one in my hand as I write. Makes it hard to type. Mouser 893-852W1AFC112VDC, $3.16 each. You'll need one for each light.

    You can power all the relays through the ULN2803A from a 12vdc wall wart. The coil current is about 90 ma, so even the wimpiest wall wart can handle several of them, and most will handle as many as you have outputs from a Stamp.

    Pay no attention to the people who urge you to spend big bucks for solid state relays. The cheapest solid state relays are over ten bucks, and are no better. At all! They have their appropriate uses, in explosive atmospheres for example, but your applicatiion is not among the appropriate uses for solid state relays. Mechanical relays are among the most reliable hardware on the planet, right up there with ball-peen hammers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • $WMc%$WMc% Posts: 1,884
    edited 2008-11-01 20:50
    bushy

    I think You have enough Idea's from the other post's on this thread...But like allanlane5 said Be very carefull of Your wireing when working w/ high voltage "120vAC" This can hurt or possiable kill You!!!!!i if You made contact w/ this voltage "120vAC"... If at any instance the "120vAC" makes its way to the $stamp$ it will most certaintly let all of the factory smoke out.And like allanlane5 said "snap crackel pop".....

    ______use caution_________________________$WMc%_______________________fire extinguisher in hand_____
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-02 15:16
    Then of course there's the method I would have suggested in the 1960s.

    "How do you turn on a light bulb?"

    "Stroke it gently, and tell it you love it."

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
Sign In or Register to comment.