Skip to content
Tutorials Center
My learning

Topics

Arduino Tutorial

Learn Arduino step by step: 37 lessons in 9 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is Arduino? Meet Arduino: an open-source family of microcontroller boards and a simple C++ toolchain. Learn what a microcontroller is, what a sketch does, and what you can build.
  2. 2 Electronics Basics: Voltage, Current and Ohm's Law The electronics every Arduino beginner needs: voltage, current, resistance, Ohm's law, LED resistor calculations, series and parallel circuits, and safe habits.
  3. 3 Your First Sketch: Blink Build and upload the classic Blink sketch: wire an external LED, understand pinMode, digitalWrite and delay, and learn the common reasons a first upload fails.
  4. 4 Sketch Anatomy: setup() and loop() Understand how an Arduino sketch is organized: globals, constants, setup() and loop(), functions, data types, comments and the hidden main() that calls them.

Boards and IDE

  1. 5 Boards Compared: Uno, Nano, Mega and ESP32 Compare popular Arduino boards by microcontroller, voltage, memory, pins and features, and learn how to choose the right board for a project and avoid 3.3 V mistakes.
  2. 6 The Arduino IDE and CLI Install and use the Arduino IDE 2 and the arduino-cli: select a board and port, install board packages and libraries, use the Serial Monitor, and fix common setup problems.
  3. 7 Pinout and Power Pins Read the Arduino Uno pinout: digital pins 0-13, analog A0-A5, PWM, serial, SPI and I2C pins, power pins 5V, 3.3V, VIN and GND, and the current limits of each.
  4. 8 Compiling and Uploading: The Bootloader Learn what happens when you press Upload: the compiler, the HEX file, the bootloader, the auto-reset trick, flash memory limits and what to do when upload fails.

Digital I/O

  1. 9 pinMode and digitalWrite Master digital outputs in Arduino: pinMode, digitalWrite, HIGH and LOW, sinking versus sourcing current, driving LEDs and transistors, and building patterns with arrays.
  2. 10 digitalRead and Buttons Read buttons and switches with digitalRead: floating inputs, wiring a button, edge detection, toggling an LED on each press and counting presses without errors.
  3. 11 Pull-Up Resistors and Debouncing Understand pull-up and pull-down resistors, choose resistor values, and eliminate contact bounce with a time-based debounce routine that works without delay().
  4. 12 Using millis() Instead of delay() Replace blocking delay() calls with millis() timing: blink without waiting, run several tasks at once, handle the 49-day rollover and build simple non-blocking state machines.
  5. 13 Bit Manipulation and Direct Port Access Learn the bitwise operators used in Arduino code, set, clear and toggle bits, and use DDRx, PORTx and PINx registers to drive many pins at once much faster than digitalWrite.

Analog and PWM

  1. 14 Reading Analog Inputs with analogRead Learn how the Arduino ADC turns a voltage into a number: analogRead, 10-bit resolution, reference voltage, converting readings to volts, potentiometers and ADC quirks.
  2. 15 Voltage Dividers Learn the voltage divider formula, use it to read resistive sensors like LDRs and thermistors, scale 5 V signals down for 3.3 V boards and measure battery voltage.
  3. 16 PWM and analogWrite Understand pulse width modulation: duty cycle, analogWrite values 0-255, PWM pins and frequencies, fading an LED, motor speed, servo basics and why PWM is not true analog.
  4. 17 map(), constrain() and Scaling Values Convert ranges with Arduino's map(), clamp values with constrain(), understand integer rounding traps, handle floats with a custom function and calibrate sensor min and max.
  5. 18 Smoothing and Filtering Noisy Readings Tame noisy analog readings with averaging, a moving-average ring buffer, an exponential filter, a median filter for spikes and hysteresis, with runnable demos.

Sensors and Actuators

  1. 19 Temperature and Humidity Sensors (DHT and TMP36) Read temperature and humidity with an Arduino: wire an analog TMP36 and a digital DHT22, convert raw readings to units, and smooth noisy data with averaging.
  2. 20 Ultrasonic Distance Sensor (HC-SR04) Measure distance with the HC-SR04 and Arduino: trigger and echo timing, pulseIn(), converting microseconds to centimeters, timeouts, and filtering bad echoes.
  3. 21 Servo Motors Control hobby servos with Arduino: how pulse width sets the angle, the Servo library, smooth sweeps without delay, power requirements, and common problems.
  4. 22 DC Motors and the H-Bridge Drive DC motors from an Arduino safely: why pins cannot power a motor, transistor and flyback diode basics, the H-bridge for direction, and PWM speed control.
  5. 23 Stepper Motors Use stepper motors with Arduino: how steps and coils work, full and half stepping, the 28BYJ-48 with ULN2003, the Stepper library, A4988 drivers and timing.

Serial and Communication

  1. 24 The Serial Monitor and Printing Data Use Serial on Arduino: baud rates, Serial.print and println, number formats, the Serial Plotter, reading incoming bytes, and how long data takes to send.
  2. 25 Writing a Serial Command Parser Build a robust Arduino serial command parser: collect bytes into a line buffer without blocking, split command and argument, validate values, and reply with errors.
  3. 26 The I2C Bus (Wire Library) Connect many devices with two wires: how I2C addresses, SDA and SCL work, the Wire library, scanning for devices, reading registers, pull-ups and common problems.
  4. 27 The SPI Bus Understand SPI on Arduino: the four wires, clock modes, chip select, the SPI library and transactions, shift registers, and when to choose SPI over I2C.

Libraries and Projects

  1. 28 Installing and Managing Libraries Find, install and manage Arduino libraries: the Library Manager, ZIP and Git installs, library folders, versions and dependencies, include errors, and choosing good ones.
  2. 29 LCD and OLED Displays Show text and graphics on Arduino: the 16x2 character LCD with LiquidCrystal and an I2C backpack, custom characters, SSD1306 OLED basics, and formatting values.
  3. 30 Writing Your Own Arduino Library Package reusable Arduino code as a library: header and source files, classes with constructors and begin(), non-blocking update(), folder layout and library.properties.

Power and Debugging

  1. 31 Power Supplies and Batteries Power an Arduino project properly: USB, barrel jack and VIN limits, linear regulators and heat, battery types, voltage dividers for battery monitoring, and runtime math.
  2. 32 Sleep Modes and Low-Power Design Make Arduino projects last on batteries: duty cycling, AVR sleep modes, watchdog timer wakeups, wake from pin interrupts, and calculating average current.
  3. 33 Debugging Sketches and Managing Memory Find and fix Arduino bugs: a systematic method, serial and LED debugging, millis rollover, integer overflow, RAM, flash and EEPROM limits, F() and PROGMEM, and heap fragmentation.

Projects and Practice

  1. 34 Project: Traffic Light State Machine Build a pedestrian-crossing traffic light with Arduino: wiring, a non-blocking finite state machine driven by millis(), a debounced button, and a simulation to test the logic.
  2. 35 Project: Temperature Data Logger Build an Arduino data logger: read a sensor on a schedule, timestamp readings with a DS3231 clock, write CSV lines to an SD card, and summarize min, max and average.
  3. 36 Project: Thermostat Fan Controller Build a temperature-controlled fan: read a sensor, add hysteresis to avoid chatter, scale fan speed with PWM, show status, and simulate a room to tune the controller.
  4. 37 Arduino Practice Problems Test your Arduino skills with exercises on debouncing, map(), bit manipulation, timing, button patterns and sensor filtering, each with a hint and a runnable C stand-in solution.