DEV Community

pankaj chauhan
pankaj chauhan

Posted on

Arduino Pins Explained: Digital, Analog, PWM Pins and Their Functions

If you have ever picked up an Arduino board for the first time, you probably stared at those little rows of holes and wondered what each one does. I did the same. You plug a wire in one spot, nothing happens. You plug it in another spot, the LED lights up. It feels like guesswork until someone explains it properly.
So here is the plain version. This guide covers Arduino pins explained: digital, analog, PWM pins and their functions, in simple words, with real examples you can try on your desk today.
Arduino Uno Meaning: What the Name Actually Tells You

Let us start with the name. Many beginners ask about the arduino uno meaning, and the answer is simple. “Uno” is the Italian word for “one.” The Arduino team picked it to mark the first board in their main line, and it stuck. The company is Italian, so the name fits.
The Uno uses an ATmega328P chip. It runs at 16 MHz, has 32 KB of flash memory, and works on 5 volts. It is the board most tutorials, school projects and college labs use, which is why learning its pins first makes sense. Once you understand the Uno, every other board feels familiar.
Arduino Diagram: Reading the Pin Layout Without Getting Lost

When someone searches for an arduino diagram, they usually want to see where everything sits. Here is how the Uno layout breaks down.
Digital pins 0 to 13. These sit along the top edge. Pins 0 and 1 are also used for serial communication (RX and TX), so avoid them when you are uploading code.
Analog pins A0 to A5. These sit along the bottom edge, next to the power header.
Power pins. You get 5V, 3.3V, two GND pins and a VIN pin. Always connect ground first, it saves a lot of trouble.
Reset pin and AREF. Reset restarts the board. AREF lets you set a custom reference voltage for analog readings.
My tip: print an arduino diagram and keep it next to your laptop. After a week you will not need it anymore, but in the first few days it saves you from wiring mistakes.
Digital Pins: The On and Off Switches

Digital pins deal with only two states. HIGH means 5 volts, LOW means 0 volts. That is all.
You can set each digital pin as an input or an output using the pinMode function.
As an output, a digital pin can switch on an LED, a relay or a buzzer. As an input, it can read a push button, a limit switch or a motion sensor.
One thing beginners miss: each pin can supply only about 20 mA safely. That is enough for one LED with a resistor, but not enough for a motor. For motors you need a driver or a transistor in between.
Here is a quick example. Connect an LED with a 220 ohm resistor to pin 13, then use digitalWrite to turn it on and off with a delay. That tiny blink sketch teaches you most of what digital pins do.
Analog Pins: Reading the Real World

The real world is not just on or off. Temperature rises slowly. Light fades gradually. A potentiometer knob turns smoothly. Analog pins exist for this reason.
The Uno has six analog input pins, A0 to A5. Each one connects to a 10 bit analog to digital converter, so it reads values from 0 to 1023. A reading of 0 means 0 volts, and 1023 means 5 volts.
You use the analogRead function to get these values. Common sensors that work with analog pins include:
LDR light sensors
LM35 temperature sensors
Potentiometers
Soil moisture sensors
Joystick modules
A small thing worth knowing: analog pins can also work as digital pins if you need extra ones. So A0 to A5 become digital pins 14 to 19 in your code.
PWM Pins: How Arduino Fakes an Analog Output

This is the part that confuses almost everyone. The Uno has no true analog output. So how do you dim an LED or control motor speed?
The answer is PWM, which stands for pulse width modulation. The pin switches on and off very fast, hundreds of times each second. By changing how long it stays on in each cycle, the average voltage changes. A longer on time feels like higher voltage, and a shorter one feels like lower.
On the Uno, the PWM pins are 3, 5, 6, 9, 10 and 11. You will see a tilde sign (~) printed next to them on the board. That mark is your clue.
You control PWM with the analogWrite function, using values from 0 to 255. Zero is fully off, 255 is fully on, and 127 is roughly half brightness.
Where is PWM useful in real projects?
Dimming LEDs smoothly
Controlling DC motor speed
Driving servo motors
Making simple tones with a buzzer
Running fan speed controllers
If you want to dig into this further, test it with a potentiometer on A0 and an LED on pin 9. Turn the knob and watch the brightness follow. It makes the whole idea click.
Arduino Nano: Same Brain, Smaller Body

Now let us talk about the arduino nano, because many people ask whether it works differently. Short answer: no, the brain is the same.
The Nano uses the same ATmega328P chip as the Uno, so the digital, analog and PWM pin ideas stay exactly the same. The difference is size. It is tiny, about the size of a thumb, and it fits straight onto a breadboard.
Here is what changes:
The Nano has 8 analog pins (A0 to A7) instead of 6. Note that A6 and A7 work only as analog inputs, not digital.
It has 14 digital pins, the same as the Uno, with the same PWM pins.
It uses a mini USB or micro USB port depending on the version.
There is no DC barrel jack, so power comes from USB or the VIN pin.
If you are building something small, like a wearable gadget, a mini robot or a compact sensor box, the Nano is a better pick. For learning and testing with shields, the Uno is easier.
Facts About Arduino That Most Beginners Do Not Know

Before we finish, here are a few facts about arduino that make the hobby more interesting.
Arduino started in 2005 at the Interaction Design Institute in Ivrea, Italy. It was built so design students with no electronics background could make interactive projects cheaply.
The whole platform is open source. The hardware designs and software are free to study and modify, which is why so many clone boards exist.
The Arduino programming language is based on C and C++, but the IDE hides most of the hard parts. You only write two main functions, setup and loop.
Pins can be damaged easily. Connecting more than 5 volts to a pin, or pulling too much current, can burn the chip. Always check your wiring twice.
The Uno has a built in LED connected to pin 13, so you can test your first sketch without any extra parts.
Millions of boards have been sold worldwide, and they are used in schools, startups and even small industrial setups.
Quick Tips Before You Start Wiring

A few habits will save you time and money.
Always use a resistor with LEDs. Never connect a motor directly to a pin. Keep your ground connections common between the board and any external power supply. Label your wires if the project gets messy. And whenever something does not work, check the pin number in your code first, because that is the cause nine times out of ten.
If you need boards, sensors, jumper wires, breadboards or LEDs to practise all of this, you can find them at Electro Global. Having the parts ready makes learning much faster, because you can test every pin type the same day you read about it.
Final Words

Once you break it down, the pins are not scary. Digital pins give you on and off. Analog pins let you read smooth values from sensors. PWM pins let you control brightness and speed. That is the whole story behind Arduino pins explained: digital, analog, PWM pins and their functions.
Start with one LED, one button and one potentiometer. Get comfortable, then add a sensor, then a motor. Every big project started with a small blink sketch.
FAQs

  1. How many digital pins does an Arduino Uno have? The Uno has 14 digital pins, numbered 0 to 13. Six of them also support PWM.
  2. Can I use analog pins as digital pins? Yes. Pins A0 to A5 can work as digital input or output pins. In code, they are numbered 14 to 19.
  3. Which pins on Arduino Uno support PWM? Pins 3, 5, 6, 9, 10 and 11. Look for the tilde (~) mark printed beside them.
  4. What is the difference between Arduino Uno and Arduino Nano? Both use the same chip and the same pin logic. The Nano is much smaller and has two extra analog input pins, while the Uno is bigger and works with shields.
  5. How much current can an Arduino pin handle? Each pin can safely give about 20 mA, with an absolute limit of 40 mA. For anything heavier, use a transistor, relay or motor driver.

Top comments (0)