Microcontrollers
15 Arduino projects for beginners, in the order that teaches the most
By Bulan Sarkar, founder of ElectronicsInfoline (since 2000) · About a 14-minute read
Most Arduino project lists are a pile of builds in no order. You finish one and learn nothing you can use on the next.
These fifteen run in order. Each one adds a single new idea, and each comes with the one calculation that decides whether it works or slowly damages a pin.
Start with an LED and a resistor, then a button, then analogue readings, then timing and sound, and end with motors and batteries. That order teaches digital output, digital input, the ADC, timers and power, which covers almost every project you will build later.
The rule that runs through all fifteen: an Arduino pin carries a signal, not power. Plan for 20 mA per pin at most. The ATmega328P's absolute limit is 40 mA per pin and 200 mA for the whole chip (Microchip ATmega48A/PA/88A/PA/168A/PA/328/P datasheet).
The kit
An Arduino UNO R3 or a Nano clone, a breadboard, jumper wires, a USB cable and a bag of parts: red LEDs, 220 Ω, 330 Ω and 10 kΩ resistors, two push buttons, a 10 kΩ potentiometer, an LDR, an LM35, a passive piezo, a common-cathode seven-segment display, an HC-SR04, an SG90 servo, a small DC motor, an IRLZ44N MOSFET and a 1N4007 diode. Most starter kits have all of it except the MOSFET and the LM35.
The numbers below assume a 5 V board. On a 3.3 V board (an ESP32 or a Raspberry Pi Pico), redo every resistor value; the method is the same.
Our take: buy a clone, not a genuine board, for the first year. You will short something, and a clone costs a fraction of the price.
Stage 1: outputs
1. Blink an external LED
The built-in LED on pin 13 proves the board works. An external one on pin 8 proves you can wire a circuit. The resistor is the whole lesson: without it, the LED and the pin try to settle the current between themselves, and the pin loses.
- Parts: 1 red LED, 220 Ω
- The number that matters: (5 V − 2.0 V) / 220 Ω = 13.6 mA, under the 20 mA the datasheet tests at. Our LED resistor calculator does other colours and supplies.
2. Traffic lights
Three LEDs, three pins and a sequence: red, red and amber, green, amber. It is the first sketch where the order of statements is the behaviour. Use 330 Ω here; at 9.1 mA an LED is still bright indoors, and the lower current leaves headroom for later projects.
- Parts: red, amber and green LEDs, 3 × 330 Ω
- The number that matters: 9.1 mA per lit LED. Then add a pedestrian button and you have project 4 as well.
3. Talk to the Serial Monitor
Print a counter once a second, then print sensor readings. Serial output is how you will debug every project after this, so learn it early, before you need it.
- Parts: none beyond the USB cable
- The number that matters: Each character costs 10 bits on the wire (start, 8 data, stop). At 9600 baud that is 960 characters a second; at 115200 it is 11,520. A sketch that prints a long line every loop at 9600 slows to the speed of the printing.
Our take: set the Serial Monitor to 115200 from day one and match it in Serial.begin(). A screen of garbage characters almost always means the two baud rates differ.
Stage 2: inputs
4. A button that toggles
Press once for on, again for off. Use pinMode(pin, INPUT_PULLUP) and wire the button from the pin to ground, so the pin reads HIGH at rest and LOW when pressed. No external resistor needed.
One press will often toggle two or three times, though. The contacts bounce for a few milliseconds, and the loop reads each bounce. Ignore changes for about 50 ms after the first one and the problem goes away.
- Parts: 1 push button, the LED from project 1
- The number that matters: The internal pull-up is 20 to 50 kΩ (Microchip ATmega48A/PA/88A/PA/168A/PA/328/P datasheet), so a pressed button draws at most 0.25 mA. See pull-up and pull-down resistors.
5. Reaction-time game
The LED lights after a random wait; the player hits the button; the board prints the time in milliseconds. It forces you to stop using delay(), because delay() freezes the loop and the button press is missed. You learn to compare millis() against a start time instead.
- Parts: the button and LED from before
- The number that matters: millis() is a 32-bit count of milliseconds, so it wraps after 2³² ms = 49.7 days (Arduino language reference). Write
millis() - start >= wait, nevermillis() >= start + wait, and the subtraction stays correct across the wrap.
6. Seven-segment dice
Press the button, the display spins through numbers and lands on 1 to 6. You meet arrays (a byte pattern per digit), random(), and the need for randomSeed() from an unconnected analogue pin, or the dice roll the same sequence after every reset.
- Parts: common-cathode display, 8 × 330 Ω (one per segment, never one shared)
- The number that matters: 9.1 mA per segment is fine for each pin, but showing 8 with the dot lit draws 72.7 mA from the chip at once. That is under the 200 mA total, and the datasheet also caps groups of pins at 100 to 150 mA. Two digits would not fit; that is where a driver chip or multiplexing comes in. See the seven-segment display lesson.
Stage 3: analogue
7. Potentiometer LED dimmer
Turn a knob, the LED dims. analogRead() returns 0 to 1023; analogWrite() takes 0 to 255, so divide by four. The LED must be on a PWM pin (3, 5, 6, 9, 10 or 11 on an UNO).
- Parts: 10 kΩ potentiometer, the LED and 220 Ω
- The number that matters: analogWrite() is not a voltage. It switches the pin fully on and off 490 times a second (980 Hz on pins 5 and 6) (Arduino language reference), a 2.04 ms period. Your eye averages it. A multimeter on the pin averages it too, which is why it reads about 2.5 V at 127. See duty cycle and PWM.
8. LDR night light
An LDR and a fixed 10 kΩ make a voltage divider; the board reads the middle point and turns the LED on below a threshold. It is the first project where you measure your own part before writing the code, because LDRs vary widely.
- Parts: LDR, 10 kΩ, the LED
- The number that matters: With the LDR from 5 V to A0 and 10 kΩ to ground: at 2 kΩ (daylight on our example part) A0 sits at 4.17 V and reads 853; at 200 kΩ (dark) it sits at 0.24 V and reads 48. Put the threshold between your own two readings. Check yours with the voltage divider calculator.
9. LM35 thermometer
The LM35 puts out 10 mV per °C (Texas Instruments LM35 datasheet), so 25 °C is 250 mV. Read it, convert, print. Simple, until you look at the resolution.
- Parts: LM35, a 100 nF capacitor across its supply
- The number that matters: With the default 5 V reference one count is 4.88 mV, which is 0.49 °C. Room temperature reads 51, and the display jumps in half-degree steps. Switch to analogReference(INTERNAL) and one count is 0.11 °C; 25 °C now reads 232. The cost: the range stops at 110 °C, and the 1.1 V reference varies from part to part, so calibrate against a known temperature once.
Our take: stage 3 is where most people stall, because the numbers stop being exact. Print the raw counts before you convert anything. The bug is almost always visible there.
Stage 4: time and sound
10. Piezo melody
tone(pin, frequency) plays a square wave on a passive piezo. Store a tune as two arrays, notes and durations, and play it with a loop. Use a passive piezo; an active buzzer has its own oscillator and only beeps.
- Parts: passive piezo, optionally 100 Ω in series
- The number that matters: A4 is 440 Hz, a 2.27 ms period. tone() takes over a hardware timer to make it, and on an UNO that breaks PWM on pins 3 and 11 (Arduino language reference). If your dimmer from project 7 stops dimming, this is why.
11. Ultrasonic distance meter
The HC-SR04 sends a 40 kHz ping and holds its echo pin high until the echo returns. pulseIn() measures that time; distance is time × speed of sound ÷ 2.
- Parts: HC-SR04 (powered from 5 V, not from a pin)
- The number that matters: At 343 m/s, each centimetre of range is 58.3 µs of echo, so 1 m is 5,831 µs. Sound speeds up with heat: at 35 °C it is 352.5 m/s, and a sketch that assumes 343 reads a true metre as 97.3 cm. On an Indian summer afternoon that is 2.7 cm short at 1 m. Add an LM35 from project 9 and correct for it.
12. Soil-moisture alarm
Two probes in the pot, a beep when the soil dries. The common resistive probe corrodes within weeks if it is powered all the time, because DC through wet soil is electrolysis.
- Parts: resistive or capacitive soil probe, the piezo
- The number that matters: Power the probe from a digital pin, wait 10 ms, read, switch it off, and do it once every 10 minutes. The probe is then live 0.0017% of the time instead of 100%. A capacitive probe avoids the problem entirely and costs a little more.
Stage 5: motion and power
13. Servo sweep
A hobby servo turns to an angle set by the width of a pulse sent every 20 ms. The Servo library makes the pulses; you call write(angle).
- Parts: SG90 micro servo, a separate 5 V supply with its ground joined to the Arduino's
- The number that matters: The library maps 0° to 544 µs and 180° to 2400 µs (Arduino Servo library), so 90° is 1472 µs and each degree is 10.3 µs. The signal pin carries almost no current. The motor does, in bursts large enough to reset the board, so feed it from its own supply. See steppers and servos.
14. DC motor speed control
A pin cannot drive a motor, so a logic-level MOSFET does it, and the pin only drives the gate. PWM on the gate sets the speed. The 1N4007 across the motor catches the voltage spike when the MOSFET turns off; leave it out and the MOSFET will fail sooner or later.
- Parts: IRLZ44N, 330 Ω gate resistor, 10 kΩ gate-to-ground, 1N4007, motor and its own supply
- The number that matters: The IRLZ44N is fully on at 5 V on the gate: at most 0.025 Ω (Infineon IRLZ44NPbF datasheet). At 1 A that is 25 mW of heat, no heatsink needed. The gate draws a 15.2 mA spike for nanoseconds at each switch and nothing in between. The plain IRFZ44N needs about 10 V on the gate and is the wrong part here. See MOSFET as a switch and the flyback diode.
15. Battery voltage monitor
Measure a 12 V battery with a 5 V board. A divider scales the voltage down, and the sketch scales the reading back up. It is the project that turns an Arduino into something you leave running in the house, on an inverter battery or a solar setup.
- Parts: 20 kΩ and 10 kΩ, a 100 nF capacitor on A0
- The number that matters: The divider passes one third: a full 12.6 V battery gives 4.20 V at A0, which reads 860. Each count is 14.6 mV at the battery, and anything above 15 V would overrange the pin. The divider itself draws 0.42 mA, which is nothing next to a battery's capacity.
Our take: projects 13 and 14 are where boards die. The fix is the same both times: the motor gets its own supply, and the grounds are joined.
How much each project asks of a pin
The projects that look dangerous (servo, motor, 12 V battery) take almost nothing from a pin, because the pin only carries a signal. The ones that look harmless (an LED, a display) are the ones that load the pin, because the pin is the power supply.
The other limit is the board's own regulator. On a 9 V barrel jack, every milliamp the 5 V rail supplies is dropped across it: 200 mA costs (9 − 5) × 0.2 = 0.8 W, and it gets hot. On 12 V the same load is 1.4 W. Anything with a motor in it wants a separate supply. The linear regulators lesson explains where that heat comes from.
Projects 1, 2 and 7 add up to a festival build: an eight-LED chaser, a fade and a 12 V strip on a MOSFET. The Arduino festival LED lights system takes it from parts list to a printable wiring card.
Lessons underneath this
- Ohm's lawEvery resistor value on this page is one line of it.
- LED circuitsProjects 1, 2 and 6: series resistors and forward voltage.
- Voltage dividerProjects 8 and 15: the circuit behind most analogue sensors.
- ADCs and DACsProject 9: what one count is and how the reference sets it.
- The LDRProject 8: why its resistance spans three decades.
- MOSFET as a switchProject 14: logic-level gates and on-resistance.
- DC motorsProject 14: why a motor is an inductor with a load on it.
- Buzzers and speakersProject 10: passive and active piezos.
Sources and assumptions
- Microchip ATmega48A/PA/88A/PA/168A/PA/328/P datasheet, DS40002061B (p. 322: 40 mA DC per I/O pin and 200 mA through VCC and GND (absolute maximum); p. 323: pull-up 20 to 50 kΩ, test current 20 mA at 5 V)
- Arduino language reference, analogWrite() (UNO R3 and Nano: PWM on 3, 5, 6, 9, 10, 11 at 490 Hz, pins 5 and 6 at 980 Hz)
- Arduino language reference, tone() (tone() interferes with PWM on pins 3 and 11 (boards other than the Mega))
- Arduino language reference, millis() and micros() (millis() overflows after about 50 days; micros() has 4 µs resolution on 16 MHz boards)
- Arduino Servo library, src/Servo.h (MIN_PULSE_WIDTH 544 µs, MAX_PULSE_WIDTH 2400 µs, REFRESH_INTERVAL 20000 µs)
- Texas Instruments LM35 datasheet (linear +10 mV/°C scale factor)
- Infineon IRLZ44NPbF datasheet (RDS(on) at most 0.025 Ω at VGS = 5.0 V, ID = 25 A)
Read on 1 October 2026. Our own choices, not taken from any source: the 2.0 V red LED forward voltage, the LDR readings (2 kΩ and 200 kΩ), the 1 A motor, the divider values, the 50 ms debounce, the 10-minute soil interval and the piezo and probe currents in Figure 21, the pin numbers in the schematics and the 10 kΩ resistor under the bare soil probe. The speed of sound is 331.3 + 0.606 × T m/s, the standard linear fit for dry air.