Go Down

Topic: 48 Individually controlled LEDs to create a blinking starry background (Read 1 time) previous topic - next topic

Try the sketch with variable brightness, you will see the flicker and the difference between low and high setting is not very large. I do not really believe in using it.

It is possible to add a fade to it.

pfulda

[quoteI do not really believe in using it][/quote]

Ok, I won't worry about fading then.  One other thing, I was trying to slow down the blinking with the 2 random routines going from 2000ms 3000ms and of from 3000ms 4000ms and it takes the LEDs about 10 seconds before it gets into a good pattern.  Is there a way to get the LEDs to start the random pattern at slower blink rates quicker.  Also, at slower rates on power up, all the LEDs kick on for a second, then they all go blank.  Then one or 2 LEDs start the random blink and about 10 to 15 seconds later about half the LEDs get into a good blinking rhythm.

You have to look at there two statements in the initialization:


for (byte i=0;i<64;i++) mx.set(i,false);
for (byte i = 0; i < 64; i++) nextChange = random(0,1000);


Try:

for (byte i=0;i<64;i++) mx.set(i,random(100)<50);  / Turn about half the leds on
for (byte i = 0; i < 64; i++) nextChange = random(500,3000); // Slow down first change





pfulda

HKJ - I tried your suggestion and it works brilliantly!!  I wish I had the time to really dig into this to understand it more.  Thanks a bunch!!

pfulda

HKJ/Paul__B,   need some more help.  I actually recreated my test env with a more realistic setup.  I am using a Arduino Nano board and using the MAX7219 with 8mm LEDs.  I have attached some videos so you can see what is going on. 

 1) So at power up, there is a pause before the LEDs do their blinking.  I have followed all your suggestions with the code change and the pull up resistor. 

https://www.youtube.com/watch?v=uysshXwq8qU
https://www.youtube.com/watch?v=2WMSa6Njqwg

2) Columns 4,5, and 8 stay very bright in the middle and do not blink at all.  The lights that do blink do not go to full brightness, they kind of flicker at low brightness level and I have changed the brightness variable to high on the breadboard LEDs.  I will also attach the code I am using and edited from HKJ.

Guys, I really appreciate your help and am trying to give you as much info as I can on this project.  If you need anymore picts or videos, I am happy to send them your way!

The initial delay is the Arduino, it has a delay before it starts.
You need to use an external 5V supply for the LED driver chip and I would also be rather vary of the wiring.


Paul__B

I gather your "indicator" matrix which behaves itself perfectly, is connected in parallel to the same power and control lines.

The LEDs which light immediately on power-on and do not change much, are inserted in the breadboard backwards.  :smiley-roll:

pfulda

Quote
I gather your "indicator" matrix which behaves itself perfectly, is connected in parallel to the same power and control lines
Yes, that is correct.  I will look at the anodes/cathodes and make sure they are in their correct positions and also follow what HKJ recommends with the external 5V for the 7219.  I will keep you updated.  Thanks for the help!

pfulda

So those lights that were lit up in the beginning that Paul__B mentioned was a correct response.  They were indeed backwards but not totally my fault.  The long leg (should be anode) and the short leg (should be cathode) must have missed the quality control process during production.  I guess I learned a lesson that they may not always be that way some of the time.  Anyway here is a new video:

https://youtu.be/xsTXKQZ0lMg

Switching those wrongly positioned LEDs also fixed the brightness issue so I do not think I will need an external 5V power supply.  But then again these LEDs will be positioned across a huge 16'x6' board so it might end up needing that.  I don't know yet.  What do you guys think?  Does it look like a starry background?  I think it looks pretty cool.  Thanks for the code HKJ and electronics solution Paul__B!

pfulda

So a new challenge for ya'll.  Probably won't be much of one for you, anyway, I am worried that it will not be bright enough in the middle of the day with natural sunlight and may not be that visible in the middle of a football field even with stadium lights on.  Is there a way to drive 12V leds with the same chipsets (Arduino Nano and max7219)?  I know the Arduino can only output 5V max and not sure what the max7219 can handle but I imagine probably the same.

One way is to use 8 driver modules with TPIC6C596

This chip can drive each output with 100mA at 12V (Max. 30V), an external current limiting resistor is needed for each output.
If more power is needed a ordinary shift register (HC595) with external mosfet transistors can be used, then it would be possible to use 10A or more for each led.
Both of these solution is without any multiplexing, i.e. the LED is on 100% of the time when turned on. With a bit more electronic it would be possible to do multiplexing and reduce the number of driver chips.


For either of these solutions the output stage of the MAX7219 drive would have to be rewritten.

Paul__B

For either of these solutions the output stage of the MAX7219 drive would have to be rewritten.
In other words, you would not be using the MAX7219 but instead, a series of cascaded TPIC6C595s (or 6s) for which the code is somewhat simpler - but different - to the MAX7219; you have to reload all of the TPIC6C595s at once whereas the MAX7219s can (I am not sure what code you were using; I gather it was a library) are actually updated one column at a time.

This is certainly the way to use high voltage LED devices - of course you are back to using one wire to each individual LED plus a common.  A "12 V LED" is in fact three LEDs in series with a resistor but as 1W LEDs necessarily draw 350 mA, you may require the higher-current version of the drivers.

I would consider just trying it out in daylight with your current arrangement, with the brightness register in the MAX7219 set to maximum.  For daylight, you would want to "hood" the LEDs in the prop - that is, shade them from the daylight so that their immediate surround is always dark.  I note that in a field, you want them to have a wide horizontal visibility but no more than 30° above horizontal (if that), so a hood over them is practical.

pfulda

Quote
I would consider just trying it out in daylight with your current arrangement, with the brightness register in the MAX7219 set to maximum.
Yes, that is what I am going to do.  I am going to mount these LEDs on a 1/4" piece of plywood painted flat black to limit glare and reflection about 4" to 8" apart.  Place the board on the middle of the field during the day and see what it looks like.  The hood is a good idea.

In other words, you would not be using the MAX7219 but instead, a series of cascaded TPIC6C595s (or 6s) for which the code is somewhat simpler - but different - to the MAX7219; you have to reload all of the TPIC6C595s at once whereas the MAX7219s can (I am not sure what code you were using; I gather it was a library) are actually updated one column at a time.
The current library updates all LED at once, like the shift register solution would. The current solution uses about 0.4ms for a full update, I would expect the shift register solution to be faster.

This is certainly the way to use high voltage LED devices - of course you are back to using one wire to each individual LED plus a common.  A "12 V LED" is in fact three LEDs in series with a resistor but as 1W LEDs necessarily draw 350 mA, you may require the higher-current version of the drivers.
You can always adjust the current with a resistor.

Go Up