Hardware Atlas

Arduino

Arduino is an open-source microcontroller platform that lets you read sensors, control motors, and interface electronics with code. It is the most accessible entry point into hardware programming.

BeginnermicrocontrollerhardwareembeddedC++

Arduino is a family of microcontroller boards with an IDE and a simplified programming environment. The board you write code for is an actual physical chip that runs your program directly — no operating system, no internet required. Connect sensors, LEDs, motors, or any electronic component, and your code controls them directly.

Arduino is the simplest computer possible

Your laptop runs thousands of programs simultaneously, manages memory, handles networking. An Arduino runs exactly one program, repeatedly, forever. It has no display, no keyboard, no filesystem. It is just: power on → run setup() once → loop() forever. This simplicity is what makes it perfect for controlling hardware.

Why we use it

  • Immediate hardware access — write a program, upload it, the hardware responds in milliseconds
  • Huge ecosystem — thousands of libraries for every sensor, motor, and display imaginable
  • Cheap — original Arduino Uno is ~₹500–800. Clones are cheaper
  • Good documentation — one of the best-documented platforms for beginners
  • Industry standard — the concepts transfer to professional embedded systems

Working principle

Arduino boards contain an AVR or ARM microcontroller. When you upload code, it is flashed into the chip's non-volatile memory. When powered, the chip:

  1. Runs setup() once — configure pins, start serial, initialise sensors
  2. Runs loop() repeatedly — forever, until power off

The microcontroller reads digital and analogue signals on its input pins and drives signals on output pins. This is the foundation of all physical computing.

Arduino Uno R3 — Board Diagram
USBDCATmega328P16MHzONL(13)RSTDigital I/O — D0 to D13012345678910111213~~~~~~~ = PWM capableAnalog In — A0 to A5A0A1A2A3A4A5PowerIOREFRST3.3V5VGNDGNDVinArduinoUno R35V · 16 MHzATmega328P

Digital I/O pins 0–13 along the top edge (~ marks indicate PWM-capable pins). Analog inputs A0–A5 and power rail along the bottom. ATmega328P microcontroller in the centre. USB Type-B port for programming and serial communication.

Important parameters (Arduino Uno R3)

Arduino Uno R3 Specifications
ParameterValueNotes
MicrocontrollerATmega328P8-bit AVR
Operating voltage5VRegulated
Digital I/O pins146 with PWM output
Analogue input pins610-bit resolution
Flash memory32 KB0.5 KB used by bootloader
SRAM2 KBRuntime memory
Clock speed16 MHzCrystal oscillator
USB connectionType BFor programming and serial
DC current per I/O pin40 mAMax — use resistors with LEDs

Pinout overview

Arduino Uno Key Pins
PinLabelTypeDescription
5V5Vpower5V regulated output — powers sensors
3.3V3.3Vpower3.3V output — 50 mA max
GNDGNDgroundGround reference — multiple pins available
0RXcommunicationSerial receive — used for USB programming
1TXcommunicationSerial transmit
2–13D2–D13digitalDigital input/output — HIGH or LOW
3,5,6,9,10,11PWManalogPWM output — analogWrite() for motors, LEDs
A0–A5A0–A5analogAnalogue input — reads 0–5V as 0–1023
A4SDAcommunicationI2C data
A5SCLcommunicationI2C clock

Basic example code

Blink an LED on pin 13 (the built-in LED):

void setup() {
  pinMode(13, OUTPUT);   // configure pin 13 as output
}

void loop() {
  digitalWrite(13, HIGH);  // LED on
  delay(1000);             // wait 1 second
  digitalWrite(13, LOW);   // LED off
  delay(1000);             // wait 1 second
}

Read an analogue sensor and print to Serial Monitor:

void setup() {
  Serial.begin(9600);    // start serial at 9600 baud
}

void loop() {
  int value = analogRead(A0);    // read pin A0 (0–1023)
  float voltage = value * (5.0 / 1023.0);   // convert to volts
  Serial.println(voltage);       // print to serial monitor
  delay(100);
}

How to test it

  1. Connect Arduino via USB
  2. Open Arduino IDE, select your board (Tools → Board → Arduino Uno)
  3. Select the correct port (Tools → Port)
  4. Upload the Blink example (File → Examples → Basics → Blink)
  5. The built-in LED on pin 13 should blink every second
Safety Note
  • Never exceed 5V on digital pins — this will destroy the microcontroller
  • Always use current-limiting resistors (220Ω–1kΩ) when connecting LEDs
  • Never draw more than 40mA from a single I/O pin — use a transistor or motor driver for motors
  • Do not reverse polarity — Arduino boards can be destroyed by reversed power connections
Common Mistakes
  • Forgetting pinMode() — pins default to INPUT. If you want to drive an LED, set pinMode(pin, OUTPUT) in setup()
  • Using delay() with sensors — delay() blocks everything. For precise timing, use millis()
  • Not setting Serial baud rate — if Serial Monitor shows garbage, the baud rates don't match
  • Driving motors directly from I/O pins — motors need more current than Arduino pins can provide. Use a motor driver (L298N, DRV8833)
How to Verify It Works
  • The Blink sketch uploads without errors
  • The built-in LED blinks at 1Hz
  • Serial Monitor shows expected values from analogRead()
  • No pins get hot to the touch (sign of overcurrent)

Robotics and AI use cases

  • Servo motor control — PWM signals to joint servos in robotic arms
  • Sensor reading — reading IMUs, ultrasonic sensors, encoders for feedback
  • Serial communication — bridge between Raspberry Pi (running AI) and physical actuators
  • PID control — motor speed regulation using encoder feedback

Beginner project

Blink an LED with a button control.

Components: Arduino Uno, LED, 220Ω resistor, push button, breadboard, jumper wires.

Goal: LED is off by default. Press and hold the button → LED turns on. Release → LED turns off.

Advanced project

Build a servo arm controlled by a joystick.

Components: Arduino Uno, 2-axis joystick module, 2× servo motors, breadboard.

Goal: Joystick X-axis controls one servo, Y-axis controls the other. Smooth, proportional control using map() to convert 0–1023 to 0–180 degrees.