Arduino is, as we know is a great hardware platform for anyone interested in building almost any sort of homebrew electronics project. One of the best things about it is that it’s undergoing constant innovation. There are dozens of different Arduino boards on the market, but we need to find the perfect hardware for any kind of project we’re working on.
Each type of Arduino has its own special features but one thing that differentiates is the number of Input/output pins that each boards have.
At times there is a shortage of I/O pins in Arduino. Even if you use all the analog inputs as digital I/O, there are only 19 pins on an Arduino Uno, for example. That’s a fairly typical number for an 8-bit controller, and it seems not nearly enough if you want to control, say, 100 LEDs or more, to convert serial data into parallel data. Now there seems to be a short coming in the Arduino Uno and this is where the Arduino Due beats the Uno which alone has 54 digital I/O pins.
But again there seems to be an issue as even with 54 digital I/O pins, it is not going to solve the shortage of pins, for example, if you want to glow Multiple LED’S in Matrix, the Arduino Due I/O pins will be limited. Here is one IC which rectifies this issue and that is the Shift Register 74HC595. The Shift Register is controlled by three connections hence you only need Three pins from your microcontroller to control Matrix of LED’S.
Now let’s have a brief introduction to the Arduino DUE,
The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller.
As we had explained earlier about the necessity of a Shift Register to minimize the number of I/O pins used, so let’s see what a Shift register is all about,
The Shift Register is a type of sequential logic circuit that can be used for the storage or the transfer of data in the form of binary numbers. This sequential device loads the data present on its inputs and then moves or “shifts” it to its output once every clock cycle, hence the name “shift register”.
A shift register basically consists of several single bit “D-Type Data Latches”, one for each data bit, either a logic “0” or a “1”, connected together in a serial type daisy-chain arrangement so that the output from one data latch becomes the input of the next latch and so on.
Pin Diagram:
Concept of Shift Register:
The basic concept is you have 8 output pins from the 74HC595. For this example just say these are sent through a resistor to an LED. So we have pins Q0 through Q7 as the output pins. The rest can be considered control pins; we can control the shift of the register with clock pulses. As we raise the signal going to the clock pin to high, the clock is moved forward one step and when we pull it low and high again it shifts another. Each time we shift the clock we switch the input to a different one of the eight registers. We are essentially controlling the output of each of the eight pins one at a time, and as we move one clock signal forward, we switch to the next output pin to control.
So far this simply sounds like a switch board, which is really what it is, but here’s the key.
We can use the Storage register clock pin to control the “Master On/off” switch. Essentially how this is used is we can pull it low before we send our register values. We then send all eight register values; whether they are high or low, and when we are done we pull the Storage register clock pin high. What will happen is the value you send will be stored on each output pin, but not activated yet. When you pull the storage register clock pin high all the outputs will then become active, and which ever pins you assigned as high will illuminate the LED.
So this is just a simple example, The shift register can be a great tool when you are short on output pins, taking 8 outputs from only about 3 actual data inputs. It can be added to for some really complicated applications, and they can be daisy-chained together for even more output options.
Simple analogy for shift register:
You can imagine a shift register as a row of chairs. In this particular case, with the 74HC595, we have a row of 8 chairs. Each chair is either empty (0), or someone is sitting it (1).
Now, every 10 seconds or so, someone rings a bell, and everyone has to get up and move one chair to the right. If there was someone in that rightmost chair, well they just go away. In that leftmost chair, you can either tell someone to sit in it, or just leave it empty.
Working principle:
Now bringing this idea back to the 74HC595: This shift register consists of 8 output pins, which are either high (1) or low (0) . When you pull the SRCLK (Serial Clock) pin high (analogy to ringing the bell), every pin moves one to the right. The Last pin drops out, and the new pin’s state is defined by the SER (Serial) pin, and you can set that to either 1 (HIGH) or 0 (LOW).
How does this let me control LEDs again? Well, say you have 8 LEDs hooked up to the shift registers outputs, and we want to turn on the 1st, 3rd and the 8th LED. So… what we can do is clear out the register so all LEDs are off. Then we put in one high, move it right 4 spots, add one high, move it over 1, and then add another high. See the image on the right, it will make more sense.
The great thing is that the shift register has this pin called RCLK or register clock. You can hold this pin LOW while you get everything setup and nothing on the display pins will change. Then when you are done, and everything is how you want, you pull the RCLK HIGH and the 74HC595 will display the new settings. So even though we are changing values in the register in 8 steps, it looks like it was just one step.
Thank you for reading this blog, we will get back to you with more blogs.
For more information about the product,
http://www.tenettech.com/product/2781/arduino-due
http://www.tenettech.com/product/1439/shift-register-8-bit-74hc595
http://www.tenettech.com/product/882/shift-register-breakout-74hc595
For Video link: http://www.youtube.com/watch?v=N7aJrIbZNqo
For more information please visit: www.tenettech.com
For technical query please send an e-mail: info@tenettech.com