loading

The following information is a single lesson in a larger project. Find more great projects here.

Project Overview:

In this project, your Arduino is going to star in a science fiction movie! Now that you understand the basics of electronics, it's time to start controlling things with the Arduino. In this project, a control panel lights up when you press a button. This project uses digital inputs and outputs, variables, and basic Arduino code.

Step 1: Project Description

Your Arduino is going to star in a science fiction movie! In this project, you’ll be building a control panel with colored lights lights that turn on and blink when you press the button.

You can decide whether the lights mean “Engage Hyperdrive” or “Fire the lasers!” You will be using the Arduino to control the communication between inputs and outputs. A green LED will be on, until you press a button. When the Arduino gets a signal from the button, the green light will turn off and 2 other lights will start blinking.

Take a look at the circuit diagram below. When the button is not pressed, the voltage at digital pin 2 is pulled down to ground (0 volts). When it is pressed, pin 2 sees 5 volts. Reading the voltage on pin 2 is how you will determine whether or not the button is pressed.

You can also see that the three LEDs are connected to digital pins, which will act as output pins.

  1. Continue to the next step.

Step 2: Bill of Materials

You will need the following electrical components for this project:

1 pushbutton

2 red LEDs

1 green LED

220 Ohm resistor

10 k-ohm resistor ...and of course your Arduino Uno board and a breadboard!

If you have a physical kit and are building the project at your desk, you will also need the pre-cut paper spaceship dashboard that comes with your kit.

  1. Can you match each component on the list to its location on the breadboard?
  2. Continue to the next step.

Step 3: Digital Pins

The Arduino’s digital pins only has two possible states: when there is voltage on an input pin, and when there’s not.

This kind of input is normally called digital (or sometimes binary, for two-states). These states are commonly referred to as HIGH and LOW. HIGH is the same as saying “there’s voltage here!” and LOW means “there’s no voltage on this pin!” When you turn an OUTPUT pin HIGH using a command called digitalWrite(), you’re turning it on. The voltage between the pin and ground will measure 5 volts. When you turn an OUTPUT pin LOW, you’re turning it off.

  1. Identify the row of digital pins on the Arduino Uno in the Workplane.
  2. Continue to the next step.

Step 4: Digital Pins (2)

In the Arduino code, you'll have to configure each pin that you want to use as either an input or an output. When the pins are outputs, you can turn on components like LEDs. If you set the pins as inputs, you can check if a switch is being pressed or not.

  1. Continue to the next lesson to learn how to set up the circuit!

Next Lesson:Setting Up the Circuit

About This Instructable

181views

1favorite

License:

More by circuits:Introduction Arduino Project 15: Hacking Buttons Arduino Project 14: Tweak the Arduino Logo 
Add instructable to: