3
\$\begingroup\$

This may seem like a nooby question, but I have a cycle light with 5 LEDs:

* * * * *

And it has a button, which when pressed hase different modes:

  • 1st press: all LEDs blink together
  • 2nd press: all LEDs stay lit
  • 3rd press: 1st LED goes on, then it goes of and 2nd LED goes on, so on till 5th, then 4th LED again...
  • 4th press: it turns off.

I was wondering how to make this. I can make a simple circuit so that all are on. I was thinking, that something like an 8-pin microcontroller can be used to make them blink together, but for them to blink independently, I guess I will have to use a microcontroller with enough pins so that each LED has it's own?

But my bike light is pretty small and I don't think it is running an AtMega32 or something. How does it work?

\$\endgroup\$
3
  • \$\begingroup\$ It uses a very small MCU. \$\endgroup\$ Commented Aug 16, 2015 at 19:53
  • \$\begingroup\$ There are smaller and cheaper microcontrollers than ATmega32. Also there are chips specifically made for bike lights, the number of devices produced is so large that is more efficient to have an application specific IC (or ASIC). \$\endgroup\$
    – jippie
    Commented Aug 16, 2015 at 19:53
  • \$\begingroup\$ An 8 bit shift register with a slow clock and a handful of diodes could be used to achieve this - no need for a whole microcontroller. It would be a more interesting project to see if you can build this from "discrete" components rather than throwing a micro controller at it. Especially if you are a "noob" by your own admission. Challenge yourself a bit... \$\endgroup\$
    – Floris
    Commented Aug 17, 2015 at 0:45

2 Answers 2

5
\$\begingroup\$

With 5 LEDs, 1 button, and 2 pins for power this is a perfect match for an 8-pin micro-controller. The hobby-friendly DIP-8 package would easily fit in your bike light, but the manufacturer probably used a cheaper un-packaged chip directly bonded to the PCB and put a blob of black goo on it. This manufacturing method is sometimes called "chip on board".

\$\endgroup\$
6
  • \$\begingroup\$ +1 Chances are they used a COB ASIC die costing a few pennies in the bike light rather than double the entire cost of the product by using a PIC, but for small quantities, a micro such as a PIC12F series is perfect (and you'd never be able to use a bare die without a lot of equipment and expertise, even if you could find a supplier who would sell them). \$\endgroup\$ Commented Aug 16, 2015 at 22:09
  • \$\begingroup\$ @Spehro: I've used a bare die PIC on a volume product. They are certainly available, but don't make sense for small volumes. If you're not going to make a few 100k or 1M, it's probably not worth it. You don't need a lot of special equipment, you use a contract manufacturer who already has COB capability. It definitely is cheaper in high volumes. \$\endgroup\$ Commented Aug 16, 2015 at 22:27
  • \$\begingroup\$ @OlinLathrop Thanks- there does not seem to be much on Microchip's site on bare die options for PICs. I've been looking into wire bonding for microwave circuits where quantities can be very limited. \$\endgroup\$ Commented Aug 16, 2015 at 22:49
  • 2
    \$\begingroup\$ @Spehro: Bare die is one of those things you have to have a conversation with your sales guy about. At those volumes you should anyway, whether using COB or not. Prices for high volumes are a negotiation, not something quoted from a price list. If you're using more than 100k Microchip products, of any mix, per year, get to know your sales guy. \$\endgroup\$ Commented Aug 16, 2015 at 22:57
  • \$\begingroup\$ But can an 8 pin individually control the 5 LEDs separately? Because when the 3rd one is on, the others are off. So is it that 2 pins for power, 1 for button, and the other 5 used for each LED? \$\endgroup\$
    – poiasd
    Commented Aug 17, 2015 at 9:07
0
\$\begingroup\$

You will need a 8 pin microcontroller. There are many cheap microcontrollers available. You can use PIC microcontroller. Its cheap and programmings are simple for led blinking and easily available on Internet.

\$\endgroup\$
2
  • \$\begingroup\$ The number of bit is not the point. The ATmega the OP menations is an 8-bit UC too. The size is more related to the number of pins. \$\endgroup\$ Commented Aug 16, 2015 at 21:19
  • \$\begingroup\$ Sorry, i mistyped. It should be pin. Thanx. \$\endgroup\$ Commented Aug 16, 2015 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.