Need a LED switch

I want to use a switch to step through a ten LED string one LED at a time. I also need to bypass a LED (take it out of the sequence) when I want. I'm ginna be using a foot swtich if this matters. Any advice will be greatly appreciated.

Reply to
catdady2k
Loading thread data ...

Use a PIC.

don

PS: Whats a ginna ?

Reply to
don

"Use a PIC" is not allowed as an answer unless accompanied by a full schematic and software listing.

Scriptkiddie (or foreigner) slang for "going to". ;-)

To OP, if you've come back, which googlies seldom do, then look into the

4017 chip.

Good Luck! Rich

Reply to
Rich Grise

Don, I appriciate the help and I'll remember to use the spell checker from now on. Can you help with the programing of the PIC?

Reply to
catdady2k

Thanks Rich, I was thinking about the 4017 as well but I'd still be left trying to bypass an LED so, I'll look into the PIC as Don suggested. If I can't get that to work then I'll look into designing something around the 4017.

Reply to
catdady2k

I
e

Can you explain how and when to bypass an LED? Do you use a second switch?

Reply to
linnix

Use a 10-position switch of some kind[1] to select which one you want to skip, and when that LED gets energized, OR in another clock pulse to advance the counter immediately, or fast enough that you don't see the blip.

And thanks for bothering to come back to look for followups. :-)

Cheers! Rich [1]The 4051 is only 8-position, but I'm sure you get the idea.

Reply to
Rich Grise

I'm guessing that he's got 10 LEDS, the normal sequence being 1-2-3-4-

5-6-7-8-9-10-1-2 etc., and he wants it to go (e.g.) 1-2-4-5-6-etc.

I'm sure catdady2k can clarify that for us.

Thanks, Rich

Reply to
Rich Grise

Well, normally it'd be "gonna", but I don't think even that is an "official" word. :-)

Cheers! Rich

Reply to
Rich Grise

If you are willing to provide complete specifications and purpose, it's not unlikely I'd be willing to do the work including the software. I've got parts, it doesn't sound expensive, nor does it sound like more than a day's work of software and testing. Packaging is another thing, but I figure I can leave that to you.

However, you've written far, far too little about your needs. How do you 'take it [the LED] out of the sequence' for example? What foot switch, exactly, and what kind of connector does it require? What LEDs? Does color matter, or brightness, or size, or view angle? What kind of contrast do you require for the LEDs, will this be used in bright sunlight, etc? How fast are you planning on using the footswitch? How critical is it if, for example, the software mistakenly 'sees' two switch events when you only meant just one? When the power is turned off, do you need to save the state of which LED was last bypassed? What power source?

Are there other specs (like USB connections to a PC, RS-232, RF communications, or other things) that you have left out?

Is this a one-off for personal or business end-use, or are you developing a product for resale?

What in the heck is this supposed to be used for, in other words?

Jon

Reply to
Jon Kirwan

The word is "goanna", a type of large Australian monitor lizard, generally answering to "Phil".

formatting link

Reply to
Spehro Pefhany

--- Interesting task.

I'm assuming that you'll have a switch at each position which will cause the circuit to bypass that position from the sequence in one position and include it in the sequence in the other position.

In other words, if all of the switches are in the, say, 'include' position, the sequence will be 1,2,3,4,5,6,7,8,9,10,1,2... with an increment made every time you push the footswitch.

On the other hand, if you place the '2' and '6' switches in the 'bypass' position, then the sequence will be 1,3,4,5,7,8,9,10,1,3,4..

Is that what you want?

JF

Reply to
John Fields

--
Even you?

Sob...

JF
Reply to
John Fields

If programming the PIC is the sticking point, have a look for PICAXE (a PIC pre-programmed with a BASIC interpreter (very quick to use and very easy)

Reply to
David Eather

Good idea. If he uses a spdt sw on each output from the 4017, he can have the 4017 pulse go either to the LED, or to the extra clock pulse generator circuit.

I think he can do this simply, with a relay circuit, shown below. (He'll need a debounce for his foot switch, regardless.)

Foot Sw +----------------------------------+ __ | | Vcc + ---o o---+---[1K]---+----+-------- -------+ | | | c\\ /e | [47R] N/O |> |

Reply to
ehsjr

Aargh! He won't get the "extra" pulse until he releases the switch. If he keeps his foot on the switch, he won't get a rapid advancement to the next LED - he'll have "dead time" (no LEDs lit) while his foot is on the switch. This one ought to work:

Foot Sw __ +Vcc ---o o---+----+--------+ +---[debounce]---[4017 clock input] | | | | [Rly] [D1] N/C |>| | |a +----+ | N/C |>| \\c | | NPN |---+----+---[1K]----+ +---+ /e | | | | [.1uF] [10K] | | | | | Gnd -----------+-----+----+ | | 4017 | outputs o---LED 0 | / | 0 ---o o-----------+--------------------+ | o---LED 1 | / | 1 ---o o-----------+ | }} }} | o---LED 8 | | 8 ---o o-----------+ NOTE: LED 8 is shown bypassed | o---LED 9 | / | 9----o o-----------+

The rising edge pulse from the foot switch passes through the N/C point of the relay, is debounced, and causes the

4017 to increment by one. The 4017 will stay in that state until the clock drops low and rises again.

If the first increment causes the 4017 to go to an LED that is bypassed, the 4017 output goes to the base of the transistor through the other N/C point and the 1K, charging the .1 uF. There will be a small delay as the cap charges to ~.6v, then the transistor will conduct and the relay will transfer, which takes some time, creating an additional small delay before the N/C points break. When the N/C points open, the input to the debounce circuit (and thus the 4017) drops. The 1uF cap then discharges through the transistor and the 10K resistor, delaying the relay from dropping out for about 2 TC. TC depends upon the transistor gain and relay coil resistance as well as the .1 uF and 10K, but 1 ms is a close enough estimate. When the relay drops out after roughly 1 ms, the foot switch is still pressed, so a second positive pulse is applied to the debounce and thus the 4017 clock, and a second increment occurs. The 4017 advances and the + input from the bypass switch is no longer available, so the relay does not energize.

Ed

Reply to
ehsjr

Aargh again - I forgot to add the connection in switch 8. Here it is:

o---LED 8 | | 8 ---o--o-----------+ ^^

Ed

Reply to
ehsjr

I think it is a boring task. I could implement it in 10 minutes in C for a PIC, or maybe in 30 minutes in PIC assembler. You could use any PIC with the desired number of outputs, and the same number of inputs for DIP-switches for enabling the specified LED and one more input for the switch clock.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

--
Are you _looking_ for a fight, or are you just another rude europeon
with no manners?
Reply to
John Fields

This was just my opinion for this task. I'm sorry if it sounded rude for you.

Nice Olimex board, but please don't post binaries in text newsgroups. Do you have the source for the task? But I think John was thinking of a hardware solution with logic gates and counters instead of a microcontroller.

If you don't have a limit on the number of gates, a simple solution would be to create a ring counter with flip-flops and add some logic for skipping elements, depending on DIP-switches or jumpers. It could be slightly more interesting, if you want to try to minimize the number of ICs.

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.