Arduino Examples

Arduino Examples with Copy-Ready Code

All Arduino lessons with matching titles and unique code examples.

Arduino

Arduino with wiring and copy-ready code.

Arduino Analog Threshold Example

Turn output on when analog value crosses a threshold.

Arduino Battery Powered Sensor Design

Improve Arduino battery life with sleep modes, regulator choice and lower clock speed.

Arduino Blink LED Example

Blink the built-in LED once per second.

Arduino Button Debounce Example

Debounce a push button in software.

Arduino Button Input Example

Read a push button using INPUT_PULLUP.

Arduino Buzzer Example

Play tones with a piezo buzzer.

Arduino DC Motor MOSFET Example

Control a DC motor using PWM and MOSFET.

Arduino DHT22 Example

Read temperature and humidity from DHT22.

Arduino DS3231 RTC Example

Read time from DS3231 RTC.

Arduino HC-SR04 Ultrasonic Sensor Example

Measure distance with HC-SR04.

Arduino I2C Scanner Example

Scan the I2C bus and print found addresses.

Arduino IR Receiver Example

Read IR remote commands.

Arduino LCD I2C Example

Display text on 16x2 I2C LCD.

Arduino LDR Light Sensor Example

Read an LDR light sensor.

Arduino LED Dimmer with Potentiometer

Use a potentiometer to control LED brightness.

Arduino LED Strip MOSFET Guide

Control LED strips from Arduino using MOSFET switches and external power.

Arduino map Function Example

Map analog input to PWM output.

Arduino millis Blink Without Delay Example

Blink LED without delay().

Arduino MOSFET LED Strip Example

Control a 12V LED strip using MOSFET.

Arduino Nano vs Uno

Compare Arduino Nano and Uno for size, power, GPIO and beginner projects.

Arduino NeoPixel LED Example

Control WS2812 NeoPixel LEDs.

Arduino NTC Thermistor Example

Read an NTC thermistor voltage divider.

Arduino OLED I2C Example

Display text on SSD1306 OLED.

Arduino Potentiometer Example

Read analog value from a potentiometer.

Arduino Pro Mini Battery Guide

Use Arduino Pro Mini in low-power battery projects with sleep modes.

Arduino PWM LED Dimming Example

Dim an LED using PWM.

Arduino Relay Module Example

Control a relay module from Arduino.

Arduino RGB LED PWM Example

Control RGB LED color with PWM.

Arduino SD Card Example

Write text to a microSD card.

Arduino Serial Monitor Example

Print debug values to Serial Monitor.

Arduino Servo Motor Example

Move a servo between angles.

Arduino Sleep Mode Guide

Use Arduino sleep modes to reduce current in battery-powered projects.

Arduino Soil Moisture Sensor Example

Read soil moisture sensor values.

Arduino Tone Melody Example

Play a simple melody with tone().

Arduino vs ESP32

Compare Arduino and ESP32 for WiFi, GPIO, power consumption and beginner projects.