Uploaded November 2016 | Updated September 2026, 2 weeks ago
Arduino Basic Tutorial digitalRead Serial Monitor with Button. Reads a digital input on pin 2, prints the result to the serial monitor.
When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to ground (through the pull-down resistor) and reads as LOW, or 0.
When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to 5 volts, so that the pin reads as HIGH, or 1.
Required Hardware
Arduino Board: amzn.to/2LZr6t4
Push Button: amzn.to/3k79Bnh
10k ohm Resistor: amzn.to/3bj2HY9
Jumper Wires: amzn.to/3doetmT
Breadboard: amzn.to/3qxLxwm
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
Banggood Spring Sale - bit.ly/3slMbOn
Connections
One leg of the button connect a resistor.
Green wire connect from digital pin 2 to one leg of the pushbutton.
Leg of the resistor to ground.
The other leg of the button connects to the 5 volt supply.
Source Code: create.arduino.cc/editor/mertarduinotech/d9916b75-3ef3-4da5-bf70-272a8b39eb03/preview
Social Media:
instagram.com/mertarduino
facebook.com/mertarduino
Arduino Basic Tutorial digitalRead Serial Monitor with Button. Reads a digital input on pin 2, prints the result to the serial monitor.
When the pushbutton is open (unpressed) there is no connection between the two legs of the pushbutton, so the pin is connected to ground (through the pull-down resistor) and reads as LOW, or 0.
When the button is closed (pressed), it makes a connection between its two legs, connecting the pin to 5 volts, so that the pin reads as HIGH, or 1.
Required Hardware
Arduino Board: amzn.to/2LZr6t4
Push Button: amzn.to/3k79Bnh
10k ohm Resistor: amzn.to/3bj2HY9
Jumper Wires: amzn.to/3doetmT
Breadboard: amzn.to/3qxLxwm
Recommended Items:
Use Your Muscles in Project - amzn.to/3wdL45C
37 Sensor & Module Packages - amzn.to/3m66WeQ
Try this Robot Arm - amzn.to/3fq8DCl
Best Resin 3D Printer - amzn.to/39tY8KB
Arduino Compatible Kits - bit.ly/2J2AFF7
Banggood Spring Sale - bit.ly/3slMbOn
Connections
One leg of the button connect a resistor.
Green wire connect from digital pin 2 to one leg of the pushbutton.
Leg of the resistor to ground.
The other leg of the button connects to the 5 volt supply.
Source Code: create.arduino.cc/editor/mertarduinotech/d9916b75-3ef3-4da5-bf70-272a8b39eb03/preview
Social Media:
instagram.com/mertarduino
facebook.com/mertarduino






![Watch This Speaker Come to Life With Arduino!
Watch This Speaker Come to Life With Arduino! In this exciting tutorial, you’ll learn how to build an Arduino project that can speak and react to your commands. We’ll show you how to:
- Play audio files using a simple speaker
- Use an SD card module to store and access multiple sound files
- Upload and trigger various sounds based on different commands
This is a great starting point for projects like talking robots, interactive gadgets, or custom sound effects for your DIY electronics. No advanced experience needed — perfect for beginners and makers who want to give their Arduino a voice!
Arduino UNO R3 (Elegoo Clone) - https://amzn.to/46DB5er
Arduino UNO R4 (Arduino Original) - https://amzn.to/457PQ7h
Arduino UNO R3 (Clone) - https://amzn.to/40dMxtA
Jumper Wires (Elegoo 120pcs) - https://amzn.to/4nMHGtm
Jumper Wires (120pcs) - https://amzn.to/3UaQAmK
SD Card Module (HiLetgo 5pcs) - https://amzn.to/4lrmSWR
Micro SD Card Module (Adafruit) - https://amzn.to/4eLLc33
Mini Speaker (Model 1) - https://amzn.to/3GIjbwA
Mini Speaker (Model 2) - https://amzn.to/4lOIaNA
Mini Speaker (Model 3) - https://amzn.to/40OZQRa
💾 About the SD Card Module Adapter
The MicroSD Card Adapter is a module that allows your Arduino to read and write files to a microSD card using the SPI interface. It works with most Arduino boards and allows access to audio files and other data stored on the card.
🎵 Audio Playback Library
We’re using the TMRpcm library, which enables asynchronous playback of WAV/PCM audio files directly from an SD card. Compatible with Arduino Uno, Nano, Mega, and similar boards.
🔗 Library Download:
https://github.com/TMRh20/TMRpcm
🎧 Convert Audio to WAV Format:
https://audio.online-convert.com/convert-to-wav
Make sure to use mono, 8-bit or 16-bit, and 8kHz–32kHz sample rate for best compatibility.
💻 Project Source Code
📂 GitHub Repository:
https://github.com/MertArduino/Make-an-Arduino-Project-that-Speaks-and-Reacts
Background Music:
Tobu & Itro - Sunburst [NCS Release]
https://youtu.be/4lXBHD5C8do Watch This Speaker Come to Life With Arduino!](https://i.ytimg.com/vi/gi9mqIha8n0/mqdefault.jpg)



