SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By emaayan
#168161
hi..

i was wondering , assuming i have around 20 leds strips (3 leds each strip) , and i would like that each strip to light up and remain lit up until a signal from a magnet is received and then the next strip is lit up .

i'm pretty sure you don't require an entire MicroController, but rather a few microchips to achieves this, but naturally since there's an entire huge catalog of such items, i wouldn't know where to begin to start looking, or how to use them, (it's not a class in java i can look in packages, right ? :) ).

the target project is to wrap the tubes of a e-bike frame with several of these strips (toptube, downtube, seat tube) so each one would light differently but the alternating speed would be tried to the speed sensor.
something that looks like this: http://www.youtube.com/watch?v=TBx2Djkvib4#t=43
but in reality is this: http://www.youtube.com/watch?v=sUV0dQn4Qy8 (only instead of single leds, led strips).
By Mee_n_Mac
#168168
Some form of ring counter w/it's clock being a reed switch+pullup. The ring counter will need a driver of some sort to light up 3 LEDs. A 'B595 shift register (or 3) might do (as a ring counter+driver), if you could initialize it properly.

What LED strips are you thing of using ? Their current draw will drive the choice of "driver" needed.

http://en.wikipedia.org/wiki/Ring_counter
https://www.sparkfun.com/products/734


You might also look at this.
https://www.sparkfun.com/products/11365
It's a slightly different effect and could also be done w/a shift register (or 2), if you could initialize it properly.

That's the tricky part w/o using an MCU. The only way I know of is to use a (chain of) parallel-in or serial-in, serial-out shift register(s). That way a preload/initialization could happen at power up. You'll definitely need a 'driver' of some sort.
http://www.ti.com/lit/ds/symlink/sn74als166.pdf
By emaayan
#168203
really? what's the difference for the other components (won't i still need ring counter or what not?) ? if you google "led strips" this is sort of thing you'll get , so i thought it was a universal term, this is also the reason i said groups of 3 leds, because led strips are divided in groups of 3 leds you cut out the solder joints between.
By Kamiquasi
#168204
There really wouldn't be much difference in the circuit, other than driving considerations (those strips typically require 12V and whatever amps is in their spec for a single 'segment'). However, it's best to provide as much information as you can about the components you have to work with so that those considerations can be taken into account from the get-go :)
By emaayan
#168207
but the real question is how many will i need, if for example i plan to use 20-30 strips like that? (i'm newbie in electronics) but i'm assuming that a one chip can control 8 of them. unless there's a 32 bit one.

what do you mean by driver?
By emaayan
#168211
sigh there goes my minimalist approach :) ,i have thought about using addressable leds and i assume with http://www.dfrobot.com/index.php?route= ... vaIPxCSyZc (which i have) and a http://em3ev.com/store/index.php?route= ... uct_id=163 (without the magnet ring) or something similar i could write a small code, but it seems such an over kill. if my calculations are correct and riding at around 40 kph roughly translates to 5 rounds per second, then each round would light a different group led. that way i wouldn't need to apply more logic to translate into a slower rate.

now i know the "correct" way to do it de-la star trek way, is to actually measure the pwm signal in 3 phases between the motor controller and the motor, that way i should translate directly the power the motor uses on the lights, but that's waaaya to complex for me (actually i'm trying to find an article on getting started with shift registers,but the closest thing i could come up with is still http://arduino.cc/en/tutorial/ShiftOut)
By Mee_n_Mac
#168212
emaayan wrote:what do you mean by driver?
A 'driver' is a generic term for a device that provides the voltage and current needed to run the part to be run. An LED typically needs 20 mA to achieve full brightness. The voltage varies w/the color. You might have a logic level (0 - 5v) control signal and while it might have enough voltage, it can't supply the necessary current, so it needs a driver to go btw it and the LED to run the LED. In your case a driver might be a transistor that acts as an on/off switch to ground. It appears that your strip (there are many types) has 3 LEDs in series, connected to Vcc via a resistor. This circuit is repeated every so many inches, putting many such triads in parallel. A driver for your LEDs would switch either 12v or ground to the strip, the latter being more common. If each of your sub-strips is only a single triad, it only needs to handle 20 mA (perhaps only 13 mA per some of the specs @ your link). That's a trivial task for the B595 I linked to above (which can be both the ring counter and driver).

Of course if you go that route you'll have to initialize the chain of B595's somehow. I'm sure that a way using some other logic chips could be found but it becomes trivial w/even a simple MCU, an 8 pin PIC or ATtiny. Perhaps an Adafruit Trinket.
http://www.adafruit.com/products/1501

And I'm only aware of the 8 bit device.
By Mee_n_Mac
#168279
One of the links is to a "low power" shift register and the other to a high power SR. The 1'st could drive a typical LED, it has enough current capability but is limited to 5v on it's output. The other will sink even more current and allow higher voltages. The current capability isn't an issue w/your 3 LED sub-strips but the voltage is. You need to run at ~12v. So you need to use the "high power" SR or add a "driver, like the following, btw a normal SR and your sub-strips.
https://www.sparkfun.com/products/312
The last part is obsolete, which is too bad as it was a 16 bit version of the "high power" SR.

Be aware that if using a normal SR + driver above, you need to preset all the bits to a logic 0, except for 1 bit at a logic 1 ... to get your effect. If using the B595 SR, the compliment is the case, all 1's except for one 0. This is because it's providing a switch to ground (logic 0) to turn on the sub-strip. That logic inversion is done by that driver in the former case.

As for the B595 signals ... I'd have to check but IIRC you want both clocks tied together and clocked by your magnet signal. Output enabled can be tied to enable, whatever (5v or gnd) that is. Of course the serial out is tied to the next SR's serial in, w/the last serial out looped back to the 1'st SR's serial in to make the ring.