Pages

  • Home
  • About Us
  • Contact Us
* 3*3*3 LED Cube
* 2*2*2 LED Cube
* 8*8 LED Matrix
* 16*8 LED Matrix
* Segment Display
* Motor Driver

Blogroll

Powered by Blogger.

Tuesday 26 August 2014

Circuit and Program to Control 74HC595 / 74HCT595 using Arduino Mega

by realfinetime  |  in Electronics at  21:21

<< Read Previous Page
   
          We have already seen that, arduino get damaged if 16 control pins of LED matrix is directly connected to the 16 digital output pins of arduino because of the large current drawn from arduino board. Our next aim is to reduce the number of digital pins required to control LED matrix.

          A simple and effective method is using shift registers. Shift register IC used for our purpose is 74HC595. This tutorial is to make you an expert in this project quickly. So the timing diagram is not going to explain in this blog. If you want to read more about 74595, get the PDF from here. All other details such as voltage rating, limiting values, recommended operating conditions and timing diagram is clearly explained in the datasheet.

          Circuit is done as given in the following diagram. Q0 - Q7 are the output pins and is connected to individual LEDs as shown in the diagram through current limiting resistors of 1K each. Q7' is left unconnected in this case. This is serial data output and is given as serial data input to the next 74595. 5V for the working of 74595 is given from a 5V regulator. MRbar should be connected to the VCC pin of 74595. OEbar should be connected to the Gnd pin of 74595. DS, STCP and SHCP is given from arduino in this case. SHCP of 74595 is connected to the digital pin 13 of arduino. STCP of 74595 is connected to the digital pin 12 of arduino and DS pin of 74595 is connected to the digital pin 13 of arduino.
Program to shift out number 1 to 74595 in MSBFIRST order

Now upload the following program to your arduino board.

//Pin connected to ST_CP of 74595
int latchPin = 12;
//Pin connected to SH_CP of 74595
int clockPin = 13;
////Pin connected to DS of 74595
int dataPin = 11;

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {

    int ShiftOut_value = 1;
    // take the latchPin low so     // the LEDs don't change while you're sending in bits:     digitalWrite(latchPin, LOW);     // shift out the bits:     shiftOut(dataPin, clockPin, MSBFIRST, ShiftOut_value);
    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
}

Output:

Q0 will turn on, all others will turn off.

Q0   Q1   Q2   Q3   Q4   Q5   Q6   Q7

 1      0      0      0      0      0      0      0


Program to shift out number 2 to 74595 in MSBFIRST order

Upload the following program to your arduino board.

//Pin connected to ST_CP of 74595
int latchPin = 12;
//Pin connected to SH_CP of 74595
int clockPin = 13;
////Pin connected to DS of 74595
int dataPin = 11;

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {

    int ShiftOut_value = 2;
    // take the latchPin low so     // the LEDs don't change while you're sending in bits:     digitalWrite(latchPin, LOW);     // shift out the bits:     shiftOut(dataPin, clockPin, MSBFIRST, ShiftOut_value);
    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
}

Output:

Q1 will turn on, all others will turn off.

Q0   Q1   Q2   Q3   Q4   Q5   Q6   Q7

 0      1      0      0      0      0      0      0


Program to shift out number 3 to 74595 in MSBFIRST order

Now upload the following program to your arduino board.

//Pin connected to ST_CP of 74595
int latchPin = 12;
//Pin connected to SH_CP of 74595
int clockPin = 13;
////Pin connected to DS of 74595
int dataPin = 11;

void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {

    int ShiftOut_value = 3;
    // take the latchPin low so     // the LEDs don't change while you're sending in bits:     digitalWrite(latchPin, LOW);     // shift out the bits:     shiftOut(dataPin, clockPin, MSBFIRST, ShiftOut_value);
    //take the latch pin high so the LEDs will light up:
    digitalWrite(latchPin, HIGH);
}

Output:

Q0 and Q1 will turn on, all others will turn off.

Q0   Q1   Q2   Q3   Q4   Q5   Q6   Q7

 1      1      0      0      0      0      0      0

Read the remaining in next page.

Read Next Page >>

2 comments:

  1. Unknown 24 April 2021 at 05:07

    You can choose between active and passive buzzer? Here https://nerdytechy.com/active-vs-passive-buzzer/ you can understand differences!

    Reply Delete
  2. Unknown 20 May 2021 at 08:56

    Here you can find the best bluetooth modules for Arduino

    Reply Delete
Add comment

IMPORTANT NOTICE

All the circuits, published in this blog is only after testing and getting proper results in my private lab. When you try these circuits, you should check the supply voltage, polarity of components, presence of childrens nearby and shorts in the circuits. This website will not be responsible for any harm happened to you or your components caused by your carelessness.

For More Electronic Tips

For More Electronic Tips


Blog Archive

  • ▼  2014 (243)
    • ▼  August (35)
      • Animated Demonstration of an Amazing Design in an ...
      • Logic Behind Turning on and Turning off Alternate ...
      • Arduino Program to Turn on Alternate LEDs of 8*8 L...
      • Arduino Program to Design Running Diagonal LEDs in...
      • Arduino Program to Turn on Diagonal LEDs of an 8*8...
      • Arduino Program to Improve the Brightness of 1st a...
      • Arduino Program to Turn on the First and Tenth LED...
      • Arduino Program to Turn on 1st LED of an 8*8 LED M...
      • Arduino Program to Turn on All LEDs of 8*8 LED Mat...
      • Method to Control 8*8 LED Matrix using Shift Regis...
      • Various Shiftout Values and State of Qn Pins of 74...
      • Circuit and Program to Control 74HC595 / 74HCT595 ...
      • Arduino Program to Increase the Brightness of LEDs...
      • 8*8 LED Matrix - Pinout and Internal Circuit Diagram
      • Theory of Controlling Diagonal LEDs of 8*8 LED Mat...
      • How to Connect SIM900-TTL GSM/GPRS Modem to Arduin...
      • Interfacing 4*4 Button Key Pad to a Seven Segment ...
      • Working of the Circuit to Interface 4*4 Key Pad an...
      • Program to Interface 4*4 Button Key Pad and Seven ...
      • Demonstration of Interfacing 4*4 Button Pad to Ard...
      • Sealed Membrane 4X4 Button Pad For Microcontrollers
      • Best illustration of Logic Behind the Interfacing ...
      • How to put a set of " " marks inside another set o...
      • Set the Date and Time of a TTL GSM/GPRS Modem usin...
      • AT+GMI - AT Command to Display Manufacturer Identi...
      • Animated Demonstration of Johnson Counter using 55...
      • A Simple Technique to Measure the Light Intensity ...
      • Beautiful Animated Demonstration of Bistable Opera...
      • Beautiful Running LED Animated Demo : Circuit usin...
      • Amazing Animation of Astable Mode Operation of 555...
      • Johnson Counter Demonstration using 74HC4017 / 74H...
      • Animated Demo of Working of 74HC4017, Johnson Coun...
      • A Motor which Reverse the Direction of Rotation in...
      • Push Button Switch that Turn On a Motor in One Pus...
      • Switch that Turn On the Circuit in One Press and T...

    Popular Posts

© 2014 Funny Electronics. Blogger templates by Bloggertheme9
Proudly Powered by Blogger.

4617作文网解梦种玉米鼠起名字大全女孩名字易周刊易奇八字算命免费10月10日八字算命周公解梦自己光着的身子周公解梦梦到搬办公室徐明怎么起名给女孩起什么名王梓睿起名字测试打分周公八字算命周易取名字测验周易算命婚姻配对算命一条街占卜算命梦到牙都掉了怎么回事周公解梦周易姻缘算命怎么给女生起名字起名字测试好不好听宝宝起名100分的名子周易看手相准吗鼠年宝宝起名姓张五行八字算命给女生起名字姓氏曹睡觉哭醒周公解梦百家讲坛《周易》周公解梦梦到自己生了个女孩周公解梦梦关门公司名字起名大全四个字烟花易冷歌曲周深周公解梦查询2018淀粉肠小王子日销售额涨超10倍罗斯否认插足凯特王妃婚姻让美丽中国“从细节出发”清明节放假3天调休1天男子给前妻转账 现任妻子起诉要回网友建议重庆地铁不准乘客携带菜筐月嫂回应掌掴婴儿是在赶虫子重庆警方辟谣“男子杀人焚尸”国产伟哥去年销售近13亿新的一天从800个哈欠开始男孩疑遭霸凌 家长讨说法被踢出群高中生被打伤下体休学 邯郸通报男子持台球杆殴打2名女店员被抓19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警两大学生合买彩票中奖一人不认账德国打算提及普京时仅用姓名山西省委原副书记商黎光被逮捕武汉大学樱花即将进入盛花期今日春分张家界的山上“长”满了韩国人?特朗普谈“凯特王妃P图照”王树国3次鞠躬告别西交大师生白宫:哈马斯三号人物被杀代拍被何赛飞拿着魔杖追着打315晚会后胖东来又人满为患了房客欠租失踪 房东直发愁倪萍分享减重40斤方法“重生之我在北大当嫡校长”槽头肉企业被曝光前生意红火手机成瘾是影响睡眠质量重要因素考生莫言也上北大硕士复试名单了妈妈回应孩子在校撞护栏坠楼网友洛杉矶偶遇贾玲呼北高速交通事故已致14人死亡西双版纳热带植物园回应蜉蝣大爆发男孩8年未见母亲被告知被遗忘张立群任西安交通大学校长恒大被罚41.75亿到底怎么缴沈阳一轿车冲入人行道致3死2伤奥运男篮美国塞尔维亚同组周杰伦一审败诉网易国标起草人:淀粉肠是低配版火腿肠外国人感慨凌晨的中国很安全男子被流浪猫绊倒 投喂者赔24万杨倩无缘巴黎奥运男子被猫抓伤后确诊“猫抓病”春分“立蛋”成功率更高?记者:伊万改变了国足氛围奥巴马现身唐宁街 黑色着装引猜测

4617作文网 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化