overview and Video
In this project you will learn how to wire a button to control the Arduino and have it turn on an LED light.
Unlike general use single board computers like the Raspberry Pi, the Arduino – like other microcontrollers – does not have an easy way to receive commands. That is, it lacks a simple human-machine interface. By programming your Arduino to respond to something like a button, you begin to harness the power of this microcontroller.
So, yes, this project helps familiarize you with the basics of circuits and switches. But more importantly, it gives you a taste of what you need to know to send a command to the Arduino.
This is project 1 from the Arduino Project Handbook, V1 by Mark Geddes.
We built this project on a WorkBench Project Development Kit from Phase Dock.
you will need
One 400 pin breadboard
“Always-on” battery (optional; this project can be powered from your computer)
Button, momentary tactile (we used the one in the Elegoo 37 Sensors Kit, V2.0)
Two resistors (10k ohm and 220 ohm)
WorkBench 1007 Project Development Kit (PDK)
Two 2x3 Clicks
One Arduino Slide
Optional: one 2x3 or 1x3 Click depending on the size of your battery
Optional: 1007 Cover
Arduino Project Handbook, Volume 1, by Mark Geddes; this is Project 21
You can purchase the book (we recommend supporting Mark’s work).
You can download the sketches and libraries (code) for these projects.
ELEGOO Upgraded 37 in 1 Sensor Modules Kit with Tutorial(for the momentary tactile button)
Links are provided for your convenience; as an Amazon Associate Phase Dock Inc. earns from qualifying purchases. These products may be available from other sources.
1. The button in the Elegoo Kit has a different format from the one shown in the Arduino Project Handbook. It functions exactly the same way, however. You may want to review the lesson on Breadboards found on pages 4-5 of the Arduino Project Handbook if you need a little guidance.
2. The fritzing diagram shows the LED toward the back — behind the button. We suggest reversing the position of the LED and the resistor as shown in one of the project photos in the handbook to bring the LED to a more visible position.
3. If the LED doesn’t light…you may have it in backwards. (LEDs are directional and they only work one way.)