0

I currently have a "tiny" setup and want to put a few (~20-30) 0402 LEDs on a 1:87 scale car. My current setup is an ATtiny85 USB Mini Dev Board powered by a 90mAh 3.7V LiPo battery which is connected to a TP4056 5V micro USB Lipo battery charger:enter image description here

To my bitter disappointment one cannot connect the leds in series. I've read about charlieplexing which was a little mind boggling for me to comprehend.

I was going to break down the leds and pins as follows:

  • P0 - headlights (2x white 0402 LEDs) + tail lights (2x red 0402 LEDs) - in series - in parrallel
  • P1 - blinkers (4x amber 0402 LEDs) - in series - in parrallel
  • P2 - siren (12x amber 0402 LEDs) - in series - in parrallel
  • P3 - beacon (2x blue 0402 LEDs) - in series - in parrallel
  • P4 - beacon (2x blue 0402 LEDs) - in series - in parrallel
  • P5 - beacon (2x blue 0402 LEDs) - in series - in parrallel

Question:

  1. With space being limited inside the model car how would I be able to drive 20-30 LEDs with the above set up?
  2. I am in doubt that the models in the video use charlieplexing and use a similar microcontroller, how would they be doing this?
  3. Would it be better for me use something like a Pro Micro ATmega32U4 5V 16MHz and spread the LEDs across the 16 pins (ie 2 LEDs per pin = total of 32 LEDs)?

closed as off-topic by VE7JRO, sempaiscuba, MatsK, Juraj, gre_gor Feb 15 at 6:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – VE7JRO, sempaiscuba, MatsK, Juraj, gre_gor
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    No, you will never want to put the LEDs in series. You will have to put them in parallel. Some LEDs have a forward voltage of about 3V if you put them in series you will have to provide 6V to turn them on. You can't do that with just 5V. – Kwasmich Feb 12 at 9:39
2
  1. I see no reason why you would not be able to light 30 LEDs.
  2. ATtiny85 only has 5 pins for use (unless you want to use the reset pin as well in which case hell will cover you). So with charlieplexing you are going to be able to address 20 endpoints. (where each endpoint might consist of multiple LEDs) But beware. You CAN address 20 endpoints but you CANNOT light every combination simultaneouly. You will have to work out if there is a constellation that allows you to light all lights you want in the same time or you will have to use one of the timers to toggle between different lights. I don't know how well it works thou.
    I have managed to use a timer on an 8MHz device to drive 4 LEDs at 400Hz directly without charlieplexing and not using PWM. So I assume it will be possible but might be flickering.
  3. It would definitively be easier. I always recommend to stick to things that are well known and widely used. That would fit your ATmega32U4.

Make sure you layout your LEDs and think how you want to address them and if it makes sense to join multiple LEDs to one pin and toggle them at once.

  • so 2x 0402 leds per pin on a Pro Micro ATmega32U4 5V 16MHz would work well? Would the Pro Micro be able to supply enough voltage & current for 2 0402 leds? – 3kstc Feb 12 at 9:33
  • 2
    Yes, the pin will usually provide enough current for two LEDs in parallel. You will have to limit the current by using a current limiting resistor. BUT you will have to worry about the current of all pins together. From the datasheet p.383 states you can draw at most 40mA per pin and 200mA in total. Those are absolute maximum before it will blast. Usually you aim to never exceed half of it. You will have to look up the current of your LEDs to see if you can drive them directly or have to use a transistor. – Kwasmich Feb 12 at 9:45
  • half of 200mA is 100 mA; @ 20mA per 0402 LED I can only run 5 LEDs at any given instance? – 3kstc Feb 12 at 10:33
  • 1
    @3kstc you probably don't want to run those leds at 20mA or your model car will be to bright to look at. Using transistors will bypass this issue. This could be a good option for the headlights, as you want to run those at max output. PS the red leds you might be able to run in series. – Gerben Feb 12 at 11:18
  • @Gerben - I can maybe PWM them so that they aren't too bright? Would the brightness of a LED and current drawn be in a linear relationship - (ie 20mA = 255PWM, 127PWM = 10mA?) – 3kstc Feb 12 at 21:54

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