Shop OBEX P1 Docs P2 Docs Learn Events
BS2 controlled roving lights circuit — Parallax Forums

BS2 controlled roving lights circuit

MorrolanMorrolan Posts: 98
edited 2007-11-08 19:35 in General Discussion
Hi guys, I need to make a circuit which "roves" up a scale of 10 LED's. I can do this easily with a stamp, as only 1 LED is ever lit at a time, but it consumes 10 I/O pins in doing so!

What I want to create is a circuit (probably going to involve an NE555 or two) which, when turned on by a single I/O pin (i.e. it receives 5V) I want it to rove through the LED's one at a time.

The code to do it with a stamp is simply:

LOW 0
PAUSE 100
HIGH 0
PAUSE 100
LOW 0

LOW 1
PAUSE 100
HIGH 1
PAUSE 100
LOW 1



etc, for each pin.

The thing is, I don't know how I can switch between each LED in turn without using a stamp?

Any help would be greatly appreciated.

Kind Regards,
Morrolan



edit: I've attached a simply circuit diagram of the stamp method, just in case.

confused.gif

Post Edited (Morrolan) : 9/12/2007 10:55:07 AM GMT
683 x 832 - 50K

Comments

  • Tim-MTim-M Posts: 522
    edited 2007-09-12 13:50
    Morrolan,

    A 4017 decade counter IC will do exactly what you're looking for. Do a Google search for 4017 circuits and you'll have what you want. The IC has ten outputs and you can use any or all of them... as the chip receives clock pulses, it steps through each of the outputs one at a time. Your circuit can either be stand alone, using a 555 timer to generate the clock pulses, or you can use a Basic Stamp for that purpose and have more control and fun... the choice is yours.

    Tim

    Edit: Here is a link for some·more information to help·get you started:

    http://members.shaw.ca/roma/thirty-four.html

    You can also use transistors or relays·on the 4017 outputs to drive larger loads if needed as shown in the 10 Channel LED Sequencer on this page:

    http://ourworld.compuserve.com/homepages/Bill_Bowden/page5.htm

    I should have mentioned that you can cascade these IC's too, if you·want more than 10 outputs.· 4017's are very versatile and fun!

    Post Edited (Tim-M) : 9/12/2007 2:39:56 PM GMT
  • MorrolanMorrolan Posts: 98
    edited 2007-09-12 14:57
    I found this after searching for 4017:

    www.electronics-lab.com/projects/motor_light/028/

    This looks perfect and cheap, (Maplin in the UK are cheap enough for most things, plus they have a new shop is around the corner so no postage costs).

    I'm reading up on my electronics again, but whereabouts (and how) in that circuit would I incorporate a STAMP I/O pin?



    Many Thanks,
    Morrolan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Flying is simple. You just throw yourself at the ground and miss.
  • Tim-MTim-M Posts: 522
    edited 2007-09-12 15:08
    Your Basic Stamp would take the place of the logic circuit on the left and the I/O pin would connect to the 4017 at its pin 14, as shown in the link you posted. Each time you toggled the I/O pin high and low, the 4017 would take another step through its outputs. By 'step through the outputs' I mean that at the first high/low pulse from the Stamp the 4017 would turn on LED 1, at the next pulse from the Stamp it would light LED 2 (while turning LED 1 off) and so on... Does this make sense?

    Tim
  • MorrolanMorrolan Posts: 98
    edited 2007-09-13 08:43
    Yeah that makes greate sense, thanks for that.

    The thing is though, this is saying that I want to use the stamp to control the logic and the steps, but the stamp will be busy doing other things mostly, and I don't want to tie up half of the stamps instruction cycles with a few status LED's.

    What I'm more interested in, is somehow using the I/O pin on the stamp as a switch via a relay - i.e. at the beginning of the program when certain criteria are met, the stamp can simply "switch on" this pre-existing circuit and then forget about it until it is time to turn it off, giving me more processing instructions (and simpler code) to play with.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Flying is simple. You just throw yourself at the ground and miss.
  • Tim-MTim-M Posts: 522
    edited 2007-09-13 16:32
    Oh, I see. Then I would use a 555 to generate the pulse train to the 4017 circuit and the Basic Stamp can either turn the whole thing on and off, or start and stop the 555 pulses. Either way you will have start and stop control for your LED sequence.

    Tim
  • al-botal-bot Posts: 1
    edited 2007-11-08 19:35
    Hi

    This is my first post to the forums. I'm new to both electronics in general and the BOE-BOT/BASIC STAMP.

    I have been trying to do something like this myself. I've successful connected the LEDs to the 4017 and successfully run the trigger from both a SPDT switch (alternates between V+ and gnd) and a 555 timer.

    My problems comes when I connect the trigger on the 4017 to the BASIC STAMP. No matter what programming I use I get the same result. The LEDs rapidly cycle thourth continously (just over 1 second to cycle sequenially through all 10 LEDs)

    I have pin 14 on the 4017 connected to pin 10 on the BASIC STAMP, using the code below.

    do
    high 10
    pause 5000
    low 10
    pause 5000
    loop

    I figure I've missed something so simple that anyone with experience wouldn't mention it. In previous posts to this thread connecting to 4017 to the BASIC STAMP has been mentioned, but is it really as straight forward as one wire between the 4017 and BASIC STAMP?

    PS. I'm a newbie, forgive me if adding this to this pre existing thread was inappropraite. It was the closest I could find.
Sign In or Register to comment.