How do I control a 100 leds with my arduino?

Hi, I was wondering if I can control 50-50 LEDs separately.
It is going on my Christmas tree that's why I want 50-50 LEDs.
I have everything that's in the Arduino Starter Kit, I'm talking about: MOSFETs, resistors, chips (some kind that is used for dc motors).
The LEDs each take around 3 volts as input, but there is a resistor between the LEDs and the battery.
I would like to only flash the leds.

Hi, I was wondering if I can control 50-50 LEDs separately.
It is going on my Christmas tree that's why I want 50-50 LEDs.
I have everything that's in the Arduino Starter Kit, I'm talking about: MOSFETs, resistors, chips (some kind that is used for dc motors).
The LEDs each take around 3 volts as input, but there is a resistor between the LEDs and the battery.
I would like to only flash the LEDs.

If you see another post, I posted it in the wrong section and don't know how to delete it, so this isn't spam

I know you got some start with parts and stuff going on but have you considered using a LED light strip, with COB (chip on board)?

Such as a WS2812B WS2812B - Bing images.

Several options

TPIC6B595 - Serial to parallel - 8 outputs per chip - chain many chips in line

74HC595 - Serial to parallel - 8 outputs per chip - but not enough power on the chip to turn all the outputs on at once when driving LED's -

2803 (I think) - drive with the 74HC595 above - one 74HC595 output can drive several inputs to a 2803 High Power

There are several other chips that can be driven with I2C - look at Adafruit or Sparkfun for them.

I doubt each LED has to have it's own unique timer pattern - so the 74HC595 driving a 2803 would be the easiest for programming and wiring since having 8 or 16 or 24 lights with the same pattern would be a visual issue

Or you can have a string of LED's and just keep pushing new data into one end of the string to get the change of pattern or timing

Many ways

Just so we're clear - You've got two LED strings (50 LEDs each) and you want to flash the whole string on & off? You don't need to address/control the LEDs individually? (Controlling the LEDs individually would require a different kind of LED strip/string or you'd have to tear that one apart.)

The simplest solution is a relay ,but you can't directly control a relay from the Arduino so you'll either need to buy a relay board with a built-in driver (very common) or build a relay driver circuit.

A relay is simply an electrically-isolated and electrically-controlled switch. If you know how to connect a switch to turn the LEDs on & off, you can do it with a relay (and control the relay with the Arduino).

Or, you can build a MOSFET driver circuit. The MOSFET needs to handle the current and you can estimate 20mA per LED so the MOSFET should be rated for more than 2 Amps. (You can leave-out the diode since you have a non-inductive load).

"so the 74HC595 driving a 2803 would be the easiest for programming and wiring"

Disagree; TPIC6x595 would be 1/2 the chips to wire up.
There are versions that will sink up to 350mA. TPIC6A595 I think, or just TPIC6595.
Doubt you'd want an LED that bright on your tree tho, unless it is outside.

All the '595s look the same to the Arduino, just use SPI.transfer() to send data to them.

If driving All on or off together, the LEDs should be wired up in series.
Typical strips can be powered from 12V, groups of 3 LEDs are connected in series with a current limit resistor and each group of 3 draws about 20mA. 50/3 = 17 groups, total current needed 340mA. Lots of N-channel MOSFETs will sink that easily.

Relay - noisy, prone to wearing out after some limited number of cycles.

If you mean you want to individually control each of 50 LEDs, then a MAX7219 will control a matrix of 64 with on/ off switching of each and overall brightness control. Clearly, two such chips will control up to 128 LEDs and you use only three pins to control one or more chips.

The best way is to buy a couple of the partly-assembled matrix kits to which you can connect your own LEDs in a matrix - you need only 16 connections from the board to connect up to 64 LEDs. If you buy an extra kit or two you can actually assemble them with the red LED matrix provided to practice programming and otherwise play with. :grinning:

@rego0116, do not cross-post. Threads merged.

Dear Moderator -thanks for locking something in the middle of my typing and blowing a painful almost half a page/ half hour into oblivion - but I don't know what happened since it looks mostly like the original thread

How do I not have this happen to me again?

thanks

saildude:
Dear Moderator -thanks for locking something in the middle of my typing and blowing a painful almost half a page/ half hour into oblivion - but I don't know what happened since it looks mostly like the original thread

How do I not have this happen to me again?

thanks

Preview or save draft can be your best friend with long answers.

Or even check your DRAFTS folder for an autosaved reply.

Not really rocket science.

CrossRoads:
"so the 74HC595 driving a 2803 would be the easiest for programming and wiring"

Disagree; TPIC6x595 would be 1/2 the chips to wire up.
There are versions that will sink up to 350mA. TPIC6A595 I think, or just TPIC6595.
Doubt you'd want an LED that bright on your tree tho, unless it is outside.

All the '595s look the same to the Arduino, just use SPI.transfer() to send data to them.

What we have here is a failure to communicate or maybe my Klutz explanation.

Yes if you drive a 2803 with a 74HC595 that is not something I would recommend. But it was what I did on my first project - I had an existing processor that did not have enough I/O - so I ask what to do and was told to use the 74HC595 chips - but as I got further along I noted the current limits of the chip which would not allow all the outputs on at the same time - but not likely to happen but figuring out how many might be on at the same time was not something that could be reliably calculated - so add the 2803 chip - - after I finished the project I found the TPIC6B595 chip - but decided not to remake the project.

However one output on a 74HC595 will drive all the channels on a 2803 - so a single 74HC595 chip can drive 8 2803 chips for a total of 64 I/O - that would give 8 different timing patterns. But not the 100 I/O of the OP

The OP seems to have an UNO which has 14 Digital outputs - which would drive 14 2803 chips for 112 outputs with 14 different timing patterns to mix and match. That is if the O/P does not need to use the pins for something else.

For the current draw of the LED's I used a dropping resistor to set the current to 18ma to 19ma

There are also different chips and ways but I have not used them

Good luck with your project

ballscrewbob:
Preview or save draft can be your best friend with long answers.

Or even check your DRAFTS folder for an autosaved reply.

Not really rocket science.

However that assumes one has the proper handshake - there were several autosaves but I was not aware of a Draft folder somewhere - guess I will look and see if I can find it -

I did retype my reply which took about 20+ minutes plus this - my fingers don't work very well anymore and sometimes they hurt so bad that I scream from the pain and do simple wiring and solder activities can take a very long time

Thanks

saildude:
How do I not have this happen to me again?

I must confess that for a multiplicity of reasons, using "Preview" is absolutely essential practice. As I understand it, it also causes an autosave in the process, but the autosave operates every five or ten minutes if you alter what you have written. It is also a good idea to Ctrl-A Ctrl-C before selecting Preview.

Perhaps not a bad idea to beware of the post count of the OP - if it is low and not all contained in the present thread, then there is a significant risk of a cross-posting.

rego0116:
If you see another post, I posted it in the wrong section and don't know how to delete it, so this isn't spam

No, it was a cross post and reported as such because your original was actually in the correct section. :roll_eyes:

saildude:
2803 (I think) - drive with the 74HC595 above - one 74HC595 output can drive several inputs to a 2803 High Power

The ULN 2803 is essentially obsolete. There is a CMOS upgrade to the ULN2003 which does not suffer from the more than 1 V drop, but for most applications, as CrossRoads points out, the TPIC6x595 is the proper answer.

I did find the drafts with a bit of looking and most of my original post was there - thanks for the tip - sometimes I don't save drafts here -on WordPress sites you need to save a draft to start the Auto save function

Paul__B:
The ULN 2803 is essentially obsolete. There is a CMOS upgrade to the ULN2003 which does not suffer from the more than 1 V drop, but for most applications, as CrossRoads points out, the TPIC6x595 is the proper answer.

At the risk of irritating someone with way more experience than I - I would make a point that my answer was also valid - as of a few months ago all the chips were available from Digikey -

However I did look at the TPIC6x595 but Digikey dumped me to tpic6c596 which also looks nice with a few less pins and DMOS so also a bit more efficient -so I will take a look at.

Part of my point was that you can fan out if having 8 LED's with the same blink pattern some programming can be saved - yes the CMOS version to the ULN2003would be more efficient - but I am not sure how important that is if the current is 20ma at room temperature - but moving to a more efficient chip never hurts - -

Thanks for the new chip numbers I will take a look next Digikey order - the problem with new chips for me is that I don't have much board level design experience and Data Sheets are very painful for me and takes much marking and going over and over -

Thanks

saildude:
At the risk of irritating someone with way more experience than I - I would make a point that my answer was also valid - as of a few months ago all the chips were available from Digikey -

Yes, apparently you can even buy an actual SN7400.

So what? :grinning: