Project tutorial
Snap Circuits® - Push Button LED

Snap Circuits® - Push Button LED © GPL3+

Snap Circuits® makes learning electronics easy and fun! These projects are designed for younger kids who want to get introduced IoT.

  • 2,289 views
  • 0 comments
  • 10 respects

Components and supplies

Apps and online services

About this project

Follow the Snap Circuits platform!

Overview

What Are Snap Circuits?

Snap Circuits® makes learning electronics easy and fun! Learn how to use integrate Snap Circuits® with your hardware. Fun for kids!

Introduction Project

If you have not completed the introduction please go to the Snap Circuits - Introduction project. This project also contains a complete index of Snap Circuit projects.

Let's Get Started

Project Objective

To show how to use an Arduino sketch to monitor a push button and use it to turn an LED on and off.

Building the Circuit

The minimum set requirement for this project is SC-300.

Open the PDF below and follow the directions. The PDF file can also be found in the GitHub repository.

Circuit diagram and instructions

Here are images of the components that you will use to build the circuit.


Loading the Sketch

The attachment below contain the sketch for this project. Click the link below and save this to your computer.

This is the sketch required for this project

Load this sketch into the Arduino IDE in the same manner as in the Blinking LED project. After it is loaded compile and run it. The sketch for this project will write output to the serial port so you will need to open the Serial Monitor from the Tools menu (you can press Ctrl-Shift M).

How this Works

The Circuit

The circuit in this project is the same as the Push Button Monitor project. To understand this circuit please read the description provided that project.

Remember in Project #1 we turned the LED on and off in the Loop function with a delay between them. This circuit behaves the same way and still requires the output of pin 2 to be changed from HIGH to LOW or LOW to High to toggle the state of the LED.

The Software

The sketch for this project is a modified version of sketch used in the Push Button Monitor project. When the button is pushed the LED is turned on

Serial.println("The button was pushed; turning LED on");digitalWrite(LED_PIN, LOW);

When the button is released the LED is turned off.

Serial.println("The button was released; turning LED off");digitalWrite(LED_PIN, HIGH);

The image below demonstrates the output from the application.


Code

Source Code for all Snap Circuit Projects
This is the GitHub repository for all of the source code, documents and files presented in the Snap Circuit projects.

Schematics

Fritzing File
Push_Button_LED.fzz
Schematic
Push button led schematic
Circuit Diagram
Push button led bb

Comments

Similar projects you might like

Snap Circuits® - Push Button Monitor

Project tutorial by Daniel Porrey

  • 1,135 views
  • 0 comments
  • 8 respects

Snap Circuits® - Blinking LED

Project tutorial by Daniel Porrey

  • 2,064 views
  • 1 comment
  • 16 respects

Snap Circuits® - Breathing LED

Project tutorial by Daniel Porrey

  • 1,513 views
  • 0 comments
  • 9 respects

Snap Circuits® - Button Controlled Launcher

Project tutorial by Daniel Porrey

  • 3,354 views
  • 0 comments
  • 11 respects

Snap Circuits® - Seven Segment Display

Project tutorial by Daniel Porrey

  • 2,095 views
  • 0 comments
  • 7 respects

Snap Circuits® - Measuring Light

Project tutorial by Daniel Porrey

  • 1,635 views
  • 0 comments
  • 10 respects
Add projectSign up / Login