loading

Step 3: Multi what?

So what is multiplexing:
It is basically a way to split information in to little peaces and send it one by one.
this way you can save a lot of pins on the Arduino and keep your program quite simple.

In our case we split the image that we want to display to 10 peaces (10 rows), We want to scan the rows of the matrix( light up one row at a time) and send info from the Arduino to the columns.
All the columns are positives of the LEDs and the rows are negatives so if the first row is connected to ground and we send information to the columns we will only light the first row.
To get a good display we need to scan the rows very fast, so fast the the human eye thinks that all of the rows are connected at the same time.

So why the 4017:
For this LED matrix I wanted to use this useful IC.
Heres a good site to learn the basics of this IC : http://www.doctronics.co.uk/4017.htm
The 4017 decade counter is used to allow multiplexing.
This IC basically scans the rows of the matrix( lights up one row at a time).
In our case we want to connect the rows to ground but the 4017 doesn't build to sink current, so to solve this little problem we need to use a transistor with a resistor.
The 4017 has 10 output pins so we need 10 resistors and 10 transistors, we connect the 1K resistors to the outputs of the 4017 and the base of the transistor to the other end of the resistor.
Then we connect the collectors of the transistor to the rows and the emitter to the ground.
Heres the data sheet of the transistor we need to use : http://www.fairchildsemi.com/ds/2N/2N3904.pdf

The shift register:
This little IC is a very useful one it allows you to control lots of outputs with the use of onlt 3 pins from the micro-controller. By connecting more IC's you can increase the number of outputs with losing more micro-controller pins.
You can read more about them and how to use them with arduino in this link:
http://www.arduino.cc/en/Tutorial/ShiftOut

Advertisement

<p>Hi. I made one with 74HC595. After uploading the code, only the 1st row lights up. Why? Thanks.</p>
<p>I have the same problem but without usin the shift register. Anyone has a solution?</p>
<p>Hi,</p><p>If I want to connect 10x 10 matrix then I have to use shift register. Can any one help me with the circuit diagram and code. Thanks in advance.</p>
<p>Could the same code be used if I were to add an additional 8 columns? I would use another 595 shift register and cascade the date from the first to the next allowing 16 total outputs. I would imagine something in the FOR loop would need to change. Any comments would be great! :) </p><p>-Sky</p>
<p>Simple online code generator : https://jsfiddle.net/pranavcbalan/Lk2szgu5/4/</p>
<p>How large of a perfboard is used? I'm trying to buy it and idk what size would fit! I have everything else already, just need the canvas </p>
<p>HOLA SYS3MX </p><p>HE PREPARADO UNA FORMA MAS SENCILLA DE LA MATRIX MIRA AQUI SI TE GUSTA ,GRACIAS</p><p>http://www.instructables.com/id/10x8leds-En-3-Horas/</p>
<p>thanks for you work</p>
<p>Question: Is supplying the current from the +5V pin unwise? Isn't that a lot of current going through that one pin that could possibly destroy the Arduino's voltage regulator? Go through VIN instead?</p>
<p>how about 8x8 led matrix?</p>
This was my first electrical project. It works, but it scrolls backwards and the letters are backwards. I know I could remedy this by turning it upside down and redefining the code but I would like to know where I went wrong.
you must invert the negative pins, this happened to me too in a 24x6 matrix<br>if you don't understand my english is because i am argentinian
<p>this happened to me too. do you know where to edit in the code?</p>
<p>I've figured it out if anyone else get this problem.<br>Just change this line<br>for(y=0;y&lt;10;y++){<br>into this instead:<br>for(y=9;y&gt;-1;y--){</p>
I don't know anything about code, I probably should have mentioned that.
Thanks, it works correctly.
<p>Well what I did was flip the matrix upside down, then in the code I went through and reversed the order of the &quot;B00000000&quot; part for each character.</p><p>Ex: #define A {B00000000,B00111100,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010,B00000000}</p><p>into: #define A {B00000000,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010,B00111100,B00000000}</p><p>I think if you reverse the order of the wires going from the positive wires &gt; arduino pins and then from the transistors to the decade counter, it would do the trick, but I haven't tried it yet. Hope this helps.</p>
<p>thanks, but found another solutions (see reply above)</p>
<p>First project done! Thanks for nice instructable.</p><p>Had trouble with the letters were backwards. Fixed it by changing this line<br>for(y=0;y&lt;10;y++){<br>into this instead:<br>for(y=9;y&gt;-1;y--){</p>
<p>well it works perfectly using 8x8 matrix..<br>well im trying to do 8 rows x 12columns and daisy chain 2 shift registers on columns.. can someone help me with the code? need it badly.. TIA guys</p>
<p>First complete project, this was really helpful- thank you!</p>
<p>I made the hardware same as the description above using shift register and used the code of <a href="http://www.instructables.com/files/orig/FWE/03YD/G56ZZXYW/FWE03YDG56ZZXYW.txt" rel="nofollow">Scrolling text(with a shift register)</a> but while in the output all the all the LED of the row and column required for a letter to display glows. I tried a lot still having the same problem. Is it a hardware problem or coding???? </p>
<p>Thanks a lot for the author. Made it today but using 2n2222A transistors. Also wrote a little program create custom patterns. I would like to share it.</p>
Hey, cool tut, I managed to adapt it to 8x8(pretty easy in fact, I just had to reset the 4017 after 8 rows :) ) .. I didn't have all the LEDs :)) hope you like it :D
<p>Hey :D really cool tutorial.. I am almost done, but I would like a bit of help on making this matrix a 8x8, so just reduce the 4017 steps.. but I am not very good with such complex code.. I tried but couldn't follow..Can you please help me?</p>
<p>Hi very nice and neat project! I am making it right now actually. I was wondering why we need the 1k ohm resistors in series with the base of the transistor. Can't we just leave them out?<br>Thanks Lars</p>
<p>My only need is to simulate this project and I can not find any simulator that provides a 4017 decade counter. Is it possible to replace it with another component or even not use it at all?</p>
<p>I built the matrix without using the shift register. Is there a way of coding to light up a standing image of a letter? without scrolling? tried to figure out myself but cannot make it work. thanks!!</p>
<p>is it possible to this without the use of 4017 decade counter, or any other shift register ? just only a transistor and resistor connected to the LED</p>
<p>megcsin&aacute;ltam &eacute;n is a led matrix szot nagyon j&oacute;</p>
<p>Thanks for putting together this instructable. I learned so much and it was really fun.</p><p>I did mine with wire-wrap which turned out to be really elegnt.</p>
<p>i am doing 8*10 led display for my minor project. so i want to ask that whether the provided information are sufficient or not. are there anythings that u have not explained. n can anyone tell me what are the main things to present in a minor project defense. Please kindly reply soon. Its a humble request.. Please..</p>
<p>i am doing 8*10 led display for my minor project. so i want to ask that whether the provided information are sufficient or not. are there anythings that u have not explained. n can anyone tell me what are the main things to present in a minor project defense. Please kindly reply soon. Its a humble request.. Please..</p>
<p>made it.thanks </p><p>https://www.youtube.com/watch?v=nhybbm-POcg</p>
<p>Hello,</p><p> I am working with both the 74HC595 and 4017 Decade Counter to acheive One-at-a-time lighting (without the letters going from one side to the other on the screen).</p><p> Is there any part of code that I can erase to just show the letters at once, rather than moving? </p><p> As you may imagine, I'm a newby here, so please share if possible. Thank you very much</p>
<p>Hello,</p><p> I am working with both the 74HC595 and 4017 Decade Counter to acheive One-at-a-time lighting (without the letters going from one side to the other on the screen).</p><p> Is there any part of code that I can erase to just show the letters at once, rather than moving? </p><p> As you may imagine, I'm a newby here, so please share if possible. Thank you very much</p>
<p>Hi, will it work with arduino substitute with same schema ??? thanks</p>
<p>hey guys! I made a matrix (with shift register) with this nice instruction. I used exactly the code as posted above... But know after shifting a couple columns something strange happens... As a test I used a whole lighted matrix (or all B11111111), where after <strong>ALL </strong>LED's light up like they should. When this block has shifted four columns to the left in a normal way, a bug appears. In the next shifting step the whole next <strong>TWO</strong> columns <strong>aren't </strong>lighted and this remains two shifting time steps. After this the remaining two columns are shifted out like they should...<br>Does someone has a idea how to fix this problem? (A)</p>
<p>HI... i want to make a 48x10 LED matrix for my arduino project. help me to modify the code of yours... </p>
The Leonardo pin map
Hi yusfsalim, it does work with Leonardo just fine, i just did it. <br>check the pins, it canbe very tricky. with a shift register it worked a lot better.
where can i buy the Arduino Duemilanove
Hey, I built the matrix but I used an arduino leonardo to code it. <br>I saw the ATmega 32U4-Arduino leonardo Pin Mapping diagram and Port manipulation is really different. <br>PORTD is used to control pins 0,1,2,3,4,6,12 and the tx LED. So the program that you have written is not applicable on the Leonardo. Could you help me change the code so that it is compatible with the Leonardo. <br>Thanks for the amazing instructable, any help would be great. <br>
Hello, <br>I am doing the similar kind project with 8051 and 4094. <br>Can i use the same logic of yours.

About This Instructable

204,838views

249favorites

License:

Bio: Electronics and LEDs what can be better ?! :D
More by Syst3mX:Make a Desktop Tamagotchi LED Binary Calculator Make a 24X6 LED matrix 
Add instructable to: