Arduino

Arduino is an open-source electronics platform that made microcontroller programming approachable for millions of students, artists, makers, and engineers. It combines inexpensive boards with standardized pin layouts, a simple programming model called the sketch, a cross-platform IDE, and an enormous ecosystem of libraries and add-on shields. In an afternoon, someone with no embedded experience can read a sensor, drive a motor, and send data over Wi-Fi.

That accessibility makes Arduino the default tool for prototypes, education, and small production runs. The same simplicity — global state, blocking delays, minimal structure — becomes a liability as projects grow. Knowing how the platform works underneath, and how to structure sketches as real firmware, lets you keep the benefits without the mess.

TL;DR

Quick Example

A non-blocking sketch that blinks an LED and samples a sensor at different rates:

Building and uploading from the command line, the same way CI would:

Core Concepts

Boards

Third-party boards supported through board cores — ESP32, ESP8266, Raspberry Pi Pico (RP2040/RP2350), STM32 — vastly extend the range. See ESP32 and Microcontrollers.

The Sketch Model and Core API

The Arduino build system wraps your sketch in a main() that calls setup() once and then loop() repeatedly. The core API abstracts hardware behind portable functions:

Under the hood, sketches are C++ compiled with GCC for the board's architecture; nothing prevents using registers, vendor libraries, or plain C++ classes.

Libraries and Cores

The Library Manager installs libraries for sensors, displays, motors, networking, and protocols such as MQTT. Quality varies: check maintenance activity, supported architectures, memory use, and licenses. Cores (installed through the Boards Manager) provide the core API for each chip family.

Tooling

From Prototype to Maintainable Firmware

Best Practices

Prefer Non-Blocking Timing

Track time with millis() and compare intervals with unsigned subtraction; delay() freezes everything else, including input handling.

Keep Interrupt Handlers Tiny

Set flags or capture timestamps in interrupts, mark shared variables volatile, and do the real work in loop().

Watch Memory on Small Boards

Avoid String concatenation on AVR boards, store constant strings in flash with the F() macro, and check free RAM during development.

Debug With Evidence

Use the serial plotter, logic analyzers, and multimeters; many "software bugs" are wiring, power, or pull-up resistor problems.

Common Mistakes

delay() Everywhere

Floating Inputs

Ignoring Voltage Levels

FAQ

What is Arduino?

An open-source platform of microcontroller boards, a simplified C++ programming model, development tools, and libraries that makes it easy to build interactive electronics and prototypes.

What language does Arduino use?

C++ with the Arduino core API. Sketches are compiled with GCC for the target microcontroller, and standard C and C++ code can be used alongside Arduino functions.

Which Arduino board should I start with?

An Uno R4 (Minima or WiFi) is a common starting point thanks to its documentation and shield compatibility. For connected projects, boards with Wi-Fi such as the Uno R4 WiFi or Nano ESP32 are convenient.

Can Arduino be used in commercial products?

Yes, especially for small volumes and professional boards designed for it. Larger products often use the same microcontrollers on custom boards, with firmware structured for maintainability and certification.

What is the difference between Arduino and Raspberry Pi?

Arduino boards are microcontrollers that run a single program directly on the hardware with precise timing and low power. Raspberry Pi computers run a full Linux operating system and are better for networking, displays, and heavy computation. See Raspberry Pi.

Related Topics

References