• Home
  • Archive
  • Tools
  • Contact Us
  • Forum

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
Home » How to Increase the Number of Digital Pins in Arduino (Port Extender)

By Abhishek Ghosh October 16, 2017 8:52 am Updated on October 16, 2017

How to Increase the Number of Digital Pins in Arduino (Port Extender)

Advertisement

13+6 pins often a limitation of Arduino in projects where we need many pins. Here is how to increase the number of digital pins in Arduino. You know that 13 pins are digital. 6 analog pins also can be used as digital in this way :

Vim
1
2
3
4
5
6
Pin 14 = Analog in 0
Pin 15 = Analog in 1
Pin 16 = Analog in 2
Pin 17 = Analog in 3
Pin 18 = Analog in 4
Pin 19 = Analog in 5

So actually we can refer Analog Pin 5 in this way :

Vim
1
digitalWrite(19,HIGH);

Technically we can use the TX/RX. But TX/RX on board already use Pin 0 and Pin 1. If you load a blank sketch, you will measure 5 V on the Pins 0 and 1. Also it is practical to avoid Pin 0 and Pin 1 in some cases where Serial.begin() like function is used in the sketch. So the total number of Pins going round 17. But with 17 Pins how we can really can control many LEDs as simplest example? How to increase the number of digital pins in Arduino? We can use an IC like device which will “magnify” one Pin. A common way to expand the set of available output Pins on the Arduino is to use shift registers like the 74HC595 IC. 74HC595 IC needs 3 pins to control these chips – Clock, Latch, Data and increase the number the Pins. Display drivers like MAX7219 IC actually expand the pins in TM 1637 like 7 Segment LED display modules. But MAX7219 IC is costly. MCP23017 is a commonly used I/O port expander chip for Arduino like microcontroller boards. Here is data sheet of MCP23017 :

Vim
1
http://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf

 

How to Increase the Number of Digital Pins in Arduino With MCP23017 Port Extender

 

Advertisement

---

MCP23017 chip will use 2 Pins on Arduino and give 16 I/O ports or Digital Pins! So technically you can use 8 MCP23017 to extend one Arduino’s 16 Pins to 16 x 8 = 128 Pins. MCP23017 is an I/O Port Expander, uses the I²C bus and protocol. Arduino has library for  I²C bus and protocol named Wire.h. Things are actually near ready, you simply need this kind of circuit :

How to Increase the Number of Digital Pins in Arduino Port Extender

You can use other additional libraries like Adafruit has to make the “coding” easy :

Vim
1
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library

For this schematic :

You can test with this code :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "Wire.h"
void setup()
{
Wire.begin(); // wake up I2C bus
// set I/O pins to outputs
Wire.beginTransmission(0x20);
Wire.write(0x00); // IODIRA register
Wire.write(0x00); // set all of port A to outputs
Wire.endTransmission();
}
void loop()
{
  Wire.beginTransmission(0x20);
  Wire.write(0x12);      // address bank A
  Wire.write((byte)0xAA);  // value to send - all HIGH
  Wire.endTransmission();
  delay(500);
  Wire.beginTransmission(0x20);
  Wire.write(0x12);      // address bank A
  Wire.write((byte)0x55);  // value to send - all HIGH
  Wire.endTransmission();
  delay(500);
}

Tagged With digital extender with arduino , how many digital pins in arduino , port etendet with attiny 45
Facebook Twitter Google+ Pinterest

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Google Plus - Abhishek Ghosh1 and on Twitter - @AbhishekCTRL.

Follow the Author of this article :

13.7K+ Followers 18.7K+ Followers 2.5K+ Followers 1.5K Followers

Here’s what we’ve got for you which might like :

Articles Related to How to Increase the Number of Digital Pins in Arduino (Port Extender)

  • DIY Basic Stand For TM1637 7 Segment LED Display Module

    Is Not It Risky To Use LED Display Unprotected? Here Is How To Build DIY Basic Stand For TM1637 7 Segment LED Display Module With Cardboard.

  • ATtiny Arduino Boards For Cost Saving Projects

    Ready to Use Cheap ATtiny Arduino Boards Available. Here is What to Know About ATtiny Arduino Boards For Cost Saving Projects Before Buying.

  • List of Electronics Prototyping & Project Materials

    Our Illustrated List of Electronics Prototyping & Project Materials is a Helpful Guide to Those Who Lacks Conventional Course on Electronics.

  • Arduino and LED Bar Display : Circuit Diagram, Code

    Here is a Guide Explaining the Basics, Circuit Diagram, Code on Arduino and LED Bar Display. LED Bar Display is Actually Like Multiple LED.

  • How To Play MP3 On Arduino With No Shield, No SD Card

    Here is How to Play MP3 On Arduino With No Shield, No SD Card at Lower Bit Rate for Few Seconds. It is Suggested to Try for Learning Basic.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website...

 

 

Popular Articles

All articles of this Website are fully Free to read. Here are some, which possibly you'll like to read! Do not hesitate to contact us for any concern.

Contact Us

Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Recent Posts

  • Approaches of Deep Learning : Part 1 April 22, 2018
  • Android Mobile Development Boards : Practical to Consider Now April 22, 2018
  • Mechanical Counter for Arduino : Basic Information April 21, 2018
  • Difference Between Microservices and API Based Cloud Services April 20, 2018
  • Example of Using IBM Watson For Text Analysis with Google Docs April 20, 2018

About This Article

Title: How to Increase the Number of Digital Pins in Arduino (Port Extender)
October 16, 2017
Author: Abhishek Ghosh
Subjects: Computer and Internet, Hardware
Is Part Of:

TheCustomizeWindows, October 16, 2017, Vol.1(01),
p.1–39075 [IoT Ready Journal]

Source:The Customize Windows
ISSN: 0019-5847 ;
E-ISSN: 0019-5847 ;
Publisher: jima.in

Cite this article as: Abhishek Ghosh, "How to Increase the Number of Digital Pins in Arduino (Port Extender)," in The Customize Windows, October 16, 2017, April 22, 2018, https://thecustomizewindows.com/2017/10/increase-number-digital-pins-arduino/.
This website uses cookies.

Read Cookie Policy

Contents are copyright protected and reproduction demands our permission.


PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

web analysis

Copyright © 2018 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy