ElectronicsInfoline

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

Outputs1 Blink2 Traffic3 SerialInputs4 Button5 Reaction6 7-seg diceAnalogue7 Dimmer8 Night light9 LM35Timeand sound10 Piezo11 HC-SR0412 Soil probeMotionand power13 Servo14 DC motor15 Battery
Figure 1. The fifteen projects in five stages. Each stage reuses everything above it and adds one idea.

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.

ArduinoUNOD8GND220 Ωred LED(5 − 2.0) V÷ 220 Ω= 13.6 mA13.6 mA
Figure 2. Project 1 schematic: pin 8, 220 Ω, red LED, GND. The resistor sets the current.
UNOD8GND15101520aelong leg (anode) in 13Each half-column of five holes is one wire.
Figure 3. The same circuit on a breadboard. The LED's long leg is the anode and goes towards the resistor; the five holes in each half-column are joined underneath.
  • 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.

UNOD10D9D8GND330 Ωred330 Ωamber330 Ωgreen9.1 mAeach
Figure 4. Project 2: one 330 Ω resistor per LED, on pins 10, 9 and 8, cathodes to GND.
  • 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.

UNOD1 TXD0 RXUSB-serial16U2 / CH340USBSerial Monitoron the PC'A' = 0x41 on TX at 9600 baudstart0110203040506170stop1 bit = 104.2 µs; 10 bits = 1.04 ms
Figure 5. Project 3: the serial pins go to the USB chip on the board, so the cable is the whole circuit. Below it, one character on the wire: 10 bits, including the start and stop bits.
  • 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.

inside the chipArduinoUNOD2GND5 V20–50 kΩpush buttonopen: reads HIGHpressed: reads LOW≤ 0.25 mA
Figure 6. Project 4: the button pulls pin 2 to GND. INPUT_PULLUP supplies the resistor to 5 V from inside the chip.

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.

UNOD8D2GND220 Ωred LEDbutton (INPUT_PULLUP)on press: print millis() − start
Figure 7. Project 5 reuses the LED from project 1 and the button from project 4. Only the sketch is new.
  • 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, never millis() >= 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.

“8.”: 8 × 9.1 = 72.7 mAUNOD2D3D4D5D6D7D8D9D12GND8 × 330 ΩabcdefgdpCOMbutton
Figure 8. Project 6: eight pins, eight 330 Ω resistors, one per segment, and the common cathode to GND.
  • 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).

UNO5VA0GNDD9 ~10 kΩpot220 ΩLEDanalogRead(A0) / 4→ analogWrite(9, …)
Figure 9. Project 7: the potentiometer is a voltage divider from 5 V to GND with its wiper on A0; the LED sits on PWM pin 9.
64 →25%1.25 V127 →50%2.49 V191 →75%3.75 V2.04 ms (490 Hz)0 V to 5 V on the pin; dashed = the average
Figure 10. What analogWrite() does: the pin switches fully on and off 490 times a second, and the value sets how long it stays on.
  • 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.

UNO5VA0GNDD8LDR10 kΩ220 ΩLEDbright 2 kΩ:4.17 V → 853dark 200 kΩ:0.24 V → 48
Figure 11. Project 8: the LDR and 10 kΩ form a divider into A0. The readings shown are for our example LDR; measure yours.
  • 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.

UNO5VA0GND100 nFLM35+VSOUTGND10 mV/°C25 °C = 250 mV→ 51 (5 V ref)
Figure 12. Project 9: three wires and a 100 nF capacitor placed close to the sensor.
  • 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.

UNOD8GND100 Ωpiezo2.27 ms= 440 Hz (A4)
Figure 13. Project 10: a passive piezo on pin 8. tone() makes the square wave; the pin only switches it.
  • 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.

UNO5VD9D10GNDHC-SR04VCCTRIGECHOGNDTRIGburst40 kHzECHOhigh for 5,831 µs at 1 m58.3 µs per cm (c = 343 m/s)
Figure 14. Project 11: four wires, then the timing. The sketch measures how long ECHO stays high and turns it into distance.
  • 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.

UNOD7A0GNDD8probe in soil10 kΩpiezoon 10 ms in 10 min= 0.0017%
Figure 15. Project 12 with a bare two-prong probe: pin 7 powers it only while the sketch reads, and 10 kΩ to GND turns soil resistance into a voltage. A probe module with its own board takes its VCC from pin 7 in the same way.
  • 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).

UNOD9 ~GNDSG90SIGV+GND+5 Vgrounds joined0°544 µs90°1472 µs180°2400 µsone pulse every 20 ms (widths to scale)
Figure 16. Project 13: the signal comes from the board, the power from a separate 5 V supply, and the grounds are joined. Below, the three pulse widths the library sends.
UNOD9GNDSG905 V supply+−orange = signal, red = +, brown = −
Figure 17. The servo's three wires as they go in. The red wire goes to the separate supply, never to the Arduino's 5 V pin.
  • 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.

ArduinoUNOD9 ~GNDM1N4007330 Ω10 kΩIRLZ44N+motorsupply1² × 0.025 Ω = 25 mW in the MOSFETgate spike5 V / 330 Ω = 15.2 mA
Figure 18. Project 14: the pin drives only the MOSFET's gate. The motor current flows from its own supply, through the motor and the MOSFET, back to that supply's negative.
UNOD9GNDIRLZ44NGDS330 Ω10 kΩ across G and SM1N4007, band to ++−common ground
Figure 19. The same circuit as built. With the printed face towards you, the IRLZ44N's legs are gate, drain, source; the diode's band goes to the + side of the motor.
  • 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.

ArduinoUNOA0GND20 kΩ10 kΩ100 nF+12.6 V× 10/30: 4.20 Vreads 860
Figure 20. Project 15: 20 kΩ over 10 kΩ divides the battery by three before it reaches A0.
  • 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

020406080mA through one pinplan to 2040 damages1 Blink2 Traffic3 Serialsignal only4 Button5 Reaction6 7-seg dicechip total 73 mA7 Dimmer8 Night light9 LM35signal only10 Piezo11 HC-SR04signal only12 Soil probe13 Servosignal only14 DC motorsignal only15 Batterysignal only
Figure 21. Current through the busiest pin in each project. Everything stays under the 20 mA the datasheet tests at. The dice's chip total is the sum over all eight segment pins. The piezo and soil-probe bars are our estimates; the rest are calculated.

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

Sources and assumptions

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.