Recently Element14 sent me a handful of green LEDs, 17 to be precise and I wanted to use these in some way in a project. At present the Photonics Project14 activity is taking place so I thought why not try to make something for that. After spending some time with my thinking cap on (or a cup of tea as we say in the UK) I decided that a grid array would be fun and as there are 17 LEDs this naturally comes out as 4 x 4 with one spare (always good to have a spare). Of course I could just buy some LED grid arrays but where is the fun in that!
I 3D printed a front plate to hold all 16 of the LEDs in place. I spaced them out 1 cm apart as I am thinking of trying this display out at a distance at night so a larger display is needed to be able to see it. Also, it provides plenty of room for making the connections on the back. The holes are just about the same diameter as the LEDs as I was hoping for a tight fit to hold them in. I was a bit optimistic about that and although they are a snug fit they are not tight so can sometimes fall out.
The circuit for this LEDGrid display is shown below and is a fairly standard arrangement. The D2, D3, D4 and D5 outputs from the Nano drive the X dimension and the A2, A3, A4 and A5 outputs drive the Y dimension of the LEDGrid display. An LED is on when the appropriate X signal is driven HIGH and the appropriate Y signal is driven LOW. I decided to drive the LEDs directly from the Nano outputs without the use of a current limiting resistor as I wanted maximum brightness. This approach uses the circuitry of Nano outputs to limit the current, which is probably not a recommended design approach but it seems to work. This may be creating some stress on the outputs driving the X values and if the Nano stops working we will know the reason why.
This is a time-multiplexed display so each LED is on for a maximum of 1/16th of the time and so are going to be quite dim. As update rates of greater than 50 Hz (20 ms intervals) are needed for the human eye to not see any flicker this corresponds to an ON time for any individual LED of approximately1 ms. I have not investigated how much time the Nano spends going through all the for loops and so on but I do think there is some scope for improving the LED ON period and still avoid flicker. I am aiming to try to drive the display and create the graphics to be output in software without the use of any interrupts, just for some software programming fun. I might not be able to do this but we'll see. I hope to be able to create some animation of the data displayed.
I have included a fragment of the programme below. This just shows the variable LEDgrid that holds the image to be displayed, being initialised with all '1' (LED on) and then a nested for loop running through the rows and then the columns of LEDgrid and outputting whatever is present as the value to drive the X value ( a logic 1 will turn the LED on and a logic 0 will turn it off).
for (indexX = 0; indexX< 4; indexX++)
{
for (indexY = 0; indexY < 4; indexY++)
{
LEDgrid[indexX][indexY] = 1;
} /* for */
} /* for */
while (1)
{
for (indexY = 0; indexY < 4; indexY++)
{
digitalWrite(A2 + indexY, LOW);
for (indexX = 0; indexX < 4; indexX++)
{
digitalWrite(indexX+2,LEDgrid[indexX][indexY]);
delay(1);
digitalWrite(indexX+2,LOW);
} /* for */
digitalWrite(A2 + indexY, HIGH);
} /* for */
The result of all this activity is shown in the video below.
(If you can see any flicker on the display in this video it is just aliasing of camera update rates, computer display rates and the LEDGrid display rates - there is no flicker visible to the human eye when viewed directly.)
I now have two things that I want to do with this display. First is to somehow write the software to be able to create some animation in the graphics but without introducing visible flicker and then secondly and perhaps more interestingly, I want to put an LDR into the centre of the display (the hole is already present) and use this to detect the beam from a laser pointer and see if I can create some form of 'shooting laser' game. Plus, I'll get two lots of photons into this project.
Dubbie
Top Comments