DesignSpark Circuit Simulator Maintenance on 13th March at 17:00 UTC for up to 2 hours

Skip to main content

Building a Spaceship Interface with the Arduino Starter Kit

by TechED

The Arduino Starter Kit (761-7355) is an innovative educational tool meticulously crafted to empower young minds with essential coding skills.

Specifically designed to foster an early interest in programming and electronics, this kit serves as a gateway for students to delve into the exciting world of technology. In this project we show you how you can use the Arduino Starter Kit (761-7355) to build a control panel complete with switches and lights, simulating the interface of a spaceship. Through this hands-on experience, students will valuable insights into digital inputs and outputs, grasp fundamental programming structures, and deepen their understanding of resistors.

Prefer to watch a video of the project? 

Author and image credits: Arduino.cc - Arduino YouTube account.

Arduino Starter Kit

Step 1 - Arduino IDE

Let’s get started! Firstly, you’ll need to open Arduino Integrated Development Environment (IDE). Arduino IDE connects to your Arduino board to upload programs, communicate with it, and makes it easy to write code and upload it to the board offline. You can read more about the Arduino IDE on the Arduino Docs hub. For this project, you can use either the desktop version or the web editor version of Arduino IDE.

Step 2 - The Board's Pins

Now, let’s take a look at the Arduino UNO Board included in the Arduino Starter Kit. For this project we’ll be utilising the digital pins on the board, they can either be ON or OFF. However, these pins can act as both inputs and outputs.

An input is when the microcontroller receives information from any external component, meaning the data is flowing towards the microcontroller. An output is when the microcontroller sends information to the components, so the data flows out from the microcontroller.

Input and Output of microcontroller

For example, a switch is an input that can tell us if it is being pressed or not, and based on that information we can turn on and off an LED, which is an output.

Step 3 - Connecting your LEDs

Firstly, make sure your UNO board is not connected to a computer. You can start connecting your 3 LEDs. Because the LED is a polarised component it’s important that you connect it the right way. The longer leg of the LED connects to the digital pin (row 5), and the shorter leg to ground (row 6).

Connect LED

Now connect a jumper wire to the same row as the long leg of the LED, and the other end to digital pin 5 on your UNO board.

Connect Jumper Wires

Finally, connect your resistor to the same row as the short leg of the LED, and the other end to ground.

Connect Resistor

Repeat this process for all 3 LEDs and connect to digital pins 5, 4, and 3 on your UNO board. Your circuit should look something like this:

Three LEDs and wiring

It’s important that you know which LED is connected to which digital pin on your UNO board as we will use this later when coding.

Step 4 - Connecting your Switch

Time to connect your switch, jumper wire, and resistor to ground as shown below:

Connect Switch

Connect wire and resistor to switch

Now connect the resistor using the same pin to digital pin 2 on the UNO board using a cable as shown below:

Connect resistor to digital pin 2 on the UNO board

Finally, connect ground and power to the UNO board as shown below:

connect ground and power to the UNO board

Your circuit is now ready, just connect your board to your computer and get ready to code!

Step 5: Coding

Once your board is connected to your computer, open Arduino IDE, you can use the desktop version or the web editor. The interface should look something like this:

Arduino IDE Screen

Open the example code, you can find this under File, Examples, Built-In Examples, StarterKit_BasicKit, then p02SpaceshipInterface:

Open the example code

You can now upload the code to your board:

upload the code to your board

Once it has successfully uploaded, when you click the button on your circuit your LEDs will blink and one will remain on when the button is not pressed.

test circuit design

Step 6: Understanding the Example Code

In the Arduino IDE, examine the example code, and you’ll notice the additional comments providing helpful notes.

example code - with notes

Identify the variable "switchstate" at the beginning of the code, please be aware of case sensitivity if you are editing the “switchstate”.

Identify switchstate

In the setup section, you can configure the digital pins of the UNO board, just ensure the pin numbers match your physical components on the board.

configure the digital pins of the UNO board

In the loop section, you’ll find most of the code. Here you can utilise the digitalRead() function to check the state of pin 2, whether it is HIGH or LOW, and store it in the "switchstate" variable.

loop section of code

Use an if statement to execute code when the button is not pressed (switchstate is LOW), ensuring proper syntax with double equal signs for value comparison.

statement to execute code

You can modify the example sketch by adding an extra LED to the circuit and adjusting the code to make one LED blink when the switch is not pressed.

Adjust code for additional LED

Before making modifications, simply create a copy of the example sketch and save it with a different name, such as "project02_challenge."

Summary

If you've followed every step in the project you will have just built a cool control panel with switches and lights, mimicking a spaceship interface. Along the way, you’ll have demonstrated some key skills in understanding digital inputs and outputs, getting the hang of basic programming structures, and wrapping your head around resistors.

Don't forget to check out the Arduino YouTube account for a full video on this project.

TechED has not written a bio yet…
DesignSpark Logo

Enjoying DesignSpark?

Create an account to unlock powerful PCB and 3D Mechanical design software, collaborate in our forums, and download over a million free 3D models, schematics, and footprints.
Create an account

Already a DesignSpark member? Log In

Comments