Shop OBEX P1 Docs P2 Docs Learn Events
Light timer — Parallax Forums

Light timer

AustiniteAustinite Posts: 3
edited 2008-09-13 21:26 in BASIC Stamp
I have the Basic Discovery kit but have not gotten anywhere near through the book. What I need to do is be able to have two small clusters of DC powered LED's (call one blue and one white) that can be triggered with a momentary switch to stay on for 30 minutes to one hour and then stay off. I would like two switches - one for blue and one for white and be able to control the times differently. I have seen circuits using 555 chips but this seems a better way. I am certain I will need a relay to control the power to the lights (suggestions?). Is there a simple program like this already? I searched to no avail. Thanks in advance.

Comments

  • metron9metron9 Posts: 1,100
    edited 2008-09-12 02:22
    A little more information on the number and type of LED's in each cluster and how accurate of time you would like to keep. Is the time on for both clusters a fixed time or do you want it adjustable using a POT for example.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • ercoerco Posts: 20,256
    edited 2008-09-12 02:25
    You won't need relays to drive LEDs. All you need is two switches, two LEDs, four resistors, and... some quality time to read that book. Parallax makes it so easy with great material. This problem is a perfect intro to the Stamp, and many people here could show you how to wire & code it, but you wouldn't learn anything that way. Try to do it yourself, then please come back for help, but you have to take the first step. Good luck, and let us know how it goes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • ercoerco Posts: 20,256
    edited 2008-09-12 20:17
    BTW, everything you need is in WAM (What's a Microcontroller), chapters 1-3.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • AustiniteAustinite Posts: 3
    edited 2008-09-13 17:27
    I agree with you. I find myself long on needs and short on time. I need to hook up two groups of LED's - about ten per group. As such this will pull around 200mA per group.

    From what I have read this is too much. Before I get too involved I want to make sure I have all the parts a reasonable person would need. Do I need to trigger a relay?

    Thanks

    SJL
  • AustiniteAustinite Posts: 3
    edited 2008-09-13 17:28
    Also - 10% accuracy is fine and I do not need to adjust the time.

    thanks
  • ercoerco Posts: 20,256
    edited 2008-09-13 21:26
    Adjusting the time (calibrating) is simple, just experimenting with numbers in your program. Once you get it to run, adjusting is very easy.
    For 200 mA, definitely use a relay. Radio Shack's reed relay at http://www.radioshack.com/product/index.jsp?productId=2062478 will work well here, just be sure to put a flyback diode across the coil (almost any silicon rectifier diode like a 1N4001) to protect your stamp, like the sketch shows.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
Sign In or Register to comment.