Introduction: How to Add 6 Extra Pins to Your Arduino With No Extra Hardware

Picture of How to Add 6 Extra Pins to Your Arduino With No Extra Hardware

Hello, this is my second Instructable so please bear with me.
I am going to tell you how to get 6 extra Arduino digital pins.
I discovered this by playing with the Arduino IDE and tried setting up a LED on pin 14 (which does not exist on the board) And guess what? Analog pin 0 is pin 14!

Step 1: How to Get the Other Analog Inputs Working Too

Picture of How to Get the Other Analog Inputs Working Too

It is pretty simple to get the others working too! Here is a list of all of the pins:

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

Unfortunately these are not PWM pins, but you can use the SoftPWM library to get software-based PWM, which is almost as good as native PWM.

Step 2: The Example Code

Here is just an example code i wrote for testing:

int ledPin = 14;
int gndPin = 15;
void setup()
pinMode(ledPin, OUTPUT);
pinMode(gndPin, OUTPUT);

digitalWrite(gndPin, LOW);

void loop()
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin, LOW);


WendaS1 (author)2017-12-02

Thanks a lot. The Arduino should include the analog to digital pin map to their manual.

KristenT22 (author)2017-03-24

Thanks for taking the time to post, is obvious but still I may have missed it in the documentation and android assistant pointed me to this instructable and now I have more pins to play with. So much to learn, thanks again

sighsigh (author)2016-11-24

Thanks, I was running out of digital pins.

AqsaB (author)2016-08-17

what if i want to give two different inputs to pin 0 and 1?

wasp95 (author)2016-03-29

Will this work for bluetooth hc 05 if I give tx rx to any two analog pins using the digital function.I am using serial I cannot use pin 0 and 1 as it creates conflict(which I myself didn't really understand).i need to control servos using bluetooth app.

FullSoundBox made it! (author)2016-01-09

Thank you, I was getting some problems trying to use the analog 0 and 1 pins for reading a digital sensor, now works just fine.

ReCreate (author)2009-10-27

Its nothing new, Its already on the board >_<

RichardBronosky (author)ReCreate2014-07-10

I actually found this instructable by Googling for the answer to my question I asked over on Sparkfun. So, I for one appreciate the time he spent making this. I'm new to hardware and EE. There is so much mystery in it (especially the Arduino) for me.

There is not many mystery in Arduino -_- study microcontrollers.These are all same

That's pretty arrogant. There is plenty of mystery. There are numerous resources dedicated to it. This happens to be one of them. The whole point of Arduino is to make microcontrollers approachable to the people who learn by doing. Finally, they are not all the same. They are subtly different and therein lies the mystery.

There was just nothing good or true in your comment. Why do people feel the need to leave comments like this? "Look, a person on the internet does not know something that I know. -_- Grr, that makes me angry. I must strike them down."

Sire_74 (author)RichardBronosky2016-01-07

I second that. Learning Arduino (and it's programming) is not that easy if you're a noob. It might be kiddy stuff for those who knows their way around more advanced electronics, but for people who'd never tinkered with this before, no.

sdcharle (author)RichardBronosky2015-01-10

Actually Instructables is usually one of the better sites as far as not having comments from the electronics equivalent of the Comic Book Guy from the Simpsons. Unfortunately a couple of them squeeze through...

GencayC (author)2015-12-10

Also works with the nano.

rabiuls (author)2015-11-30

For Arduino Mega, analog pin's digital number is as:

A0 = 54
A1 = 55
A2 = 56
A3 = 57
A4 = 58
A5 = 59
A6 = 60
A7 = 61
A8 = 62
A9 = 63
A10 = 64
A11 = 65
A12 = 66
A13 = 67
A14 = 68
A15 = 69

RichardBronosky (author)2014-09-25

I'd like to point out that with the SparkFun Arduino Pro Micro it is:

A0 = D18

A1 = D19

A2 = D20

A3 = D21

For the Leonardo also gain:

A4 = D22

A5 = D23

A6 = D24

A7 = D25

A8 = D26

A9 = D27

A10 = D28

A11 = D29

josefdz (author)RichardBronosky2015-11-12

Hello RichardBronosky can you give an example on how to do a simple code to read A1 Pin as a Digital pin?

Thank You.

I did this, but is not working.

void setup()



pinMode (A1, INPUT);



void loop()


DIGITAL = digitalRead(A1);




diy_bloke (author)josefdz2015-11-29

dont define it as A1 but as D15

PumaBare (author)2015-08-20

Thank you, this just answered a question I was asking in regard to the arduino pro-mini, normally only 14 digital outputs and I need 16, seems this solves it for me, cheers!

genezis (author)2015-08-05

You can use 4 additional digital pins in Arduino Micro:

MISO = D14

SCK = D15

MOSI = D16

SS = D17 (orange LED conneted on board)

AhmedM46 (author)2015-07-11

Thanks so much you solve a big problem faced me

coolersport (author)2015-04-25

If anyone would like more output pins, you could utilise a demultiplexer. See following:

GerrieH (author)coolersport2015-05-03

Adding shift registers is also a inexpensive and easy option.

SideTracked350 (author)2015-03-19

Fantastic!! I was trying to find out if I could sub the analogs for digitals. strangely I had no success in finding a straight forward answer and thus wrote it off, and now stumbled on this while looking for something else HAHA. This saves me from having to incorporate another board. Thanks a bunch for sharing. any idea how one might get them to chase like Christmas lights for a time period as a sub routine to a sketch?

GR0B (author)2013-09-26

Thanks for sharing, I knew you could control the pull up of an analog but didn't know it also had a digital pin number too.

DustinT (author)GR0B2015-01-14

Same here. The fact that analog pins can be used as digital is well documented. I was a bit annoyed by the title at first, but this is good info.

daniel.huebner.96 (author)2014-12-21

awesome just what i needed, more pins.

DouglasF (author)2014-11-27

I am Brazilian student. thanks for the help always has excellent tutorials

Nickson Yap (author)2013-09-07

btw, in SoftPWM, you can write it as pin A1 and it works just as well as pin 15.

oqla2000 (author)2011-07-22

Good info thanks !

'jaiswal (author)2011-04-28

thanks for the all know that "analog pin can be use as digital" is already on but helpful info. is that A0 is pin 14...that is not given on site... :)

neutron7 (author)2010-03-18

On the MEGA the anlog pins are digital  53,54,55 etc.

Grathio (author)2009-11-04

It's new to me!  Thanks for sharing!  I know this will come in handy!

davidbuzz (author)2009-10-22

it's also on this page:  whereit says :
" Most of the analog inputs can also be used as digital pins "

belectric23 (author)2009-10-21

News to me - thanks for the tip!

mikemmcmeans (author)2009-10-17

neat, but what about the arduino MEGA's?
they have digital pins up to 53 and analog pins upto 16

Dege (author)2009-10-08

 It's already in the arduino documentation but it's a bit hidden:
(watch the note at the end of the page...)

Noodle93 (author)2009-10-06

Yeah, this is pretty well known.

ikestarm17 (author)2009-10-05

that's pretty cool and is very helpful. Thanks!

About This Instructable



Bio: I'm a software developer, but I also love tinkering with electronics. My Instructables are all about Arduino.
More by baharini:ATTiny45/85 LCD display control with a shift register, programmed in ArduinoControlling a character LCD with an ArduinoHow to add 6 extra pins to your Arduino with no extra hardware
Add instructable to: