Activity 1A Blinking An LED - (1) Erns

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

www.SaskCode.

ca

Robot Name: Arduino


Project One: Light
Activity: Blinking an LED

Grade Level 7-9 Difficulty Beginner

Subject Practical and Applied Arts


Science

Description Each project is broken up into several circuits, the last circuit being a culmination
of the technologies that came before. The purpose of these projects is to help
students learn about new technologies and concepts.

This first project is titled “Light” and is divided up into several activities.
By completing these activities, students will be given the prior knowledge to
design, build, and program their own multi-coloured light project that uses inputs
and outputs to change the color, timing, and intensity of lighting.

In this activity, students will learn about LED’s (light-emitting diodes), resistors,
inputs, outputs, and sensors and write a code that makes an LED blink on and
off.

Outcome(s) Supports:
PAA - Electronics Modules - ELEC02A, ELEC04A; Robotics Modules -
ROBA7, ROBA9, ROBA12A, ROBA13A, ROBA15A, ROBA21, ROBA23A, ROBA28A;
Science - CE9.1, CE9.2

Required Prior Getting Started: Activity One - Downloading Programs for Arduino
Learning

Time Frame One hour

Materials Arduino Uno Board, Breadboard, LED, 330 Ω Resistor, 2 Jumper Wires
Activity: Blinking an LED

BlocklyDuino Reference

Additional Sparkfun Inventor's Kit Guide,


Resources

Assessment Review lesson ending questions with students for understanding and future
application.
2

Activity: Blinking an LED

Procedure:
Review the organization of the kit and how groups need to be careful with all the components,
how they are used, and how they need to be kept organized and put back into their place when
done.
Divide your class into groups of two (Paired Programming). Paired programming is highly
recommended when working with coding and robotics so that students can piggyback off each
others ideas and strengths.
Students will wire a circuit using an Arduino Board, LED, breadboard, 330 Ω Resistor, and two
jumper wires to create a circuit that will make an LED blink following the instructions online or
you can choose to make a handout. Once students have wired their Arduino, students can
create the blocklyduino code in the Chrome App and transfer their code to the Arduino Editor.
They can also copy and paste the provided code into the Arduino Editor directly and download it
onto the Arduino Board. Once downloaded, the LED will blink at 2 second intervals.

Extension

Students can complete the extension challenges once they have done the first program

Student Handouts
Activity - Blinking an LED

Assessment Guide
Circulate the room observing and assisting with students so that they can complete the project.
Correct the assignment sheet as a class ensuring that students share their errors and
successes while reinforcing the importance of persistence and patience in programming.
3

Activity: Blinking an LED


Purpose:
● To wire and code a light to blink at different intervals using parallel and series circuits.
● To use BlocklyDuino and Codebender to create code to communicate with the Arduino
microcontroller

Materials: Computer, Arduino Uno Board, USB cable, Breadboard, 2 coloured LED’s, 200 -
330 Ω Resistor, 2 Jumper Wires

New Components:
Arduino Uno Board: The Arduino is a microcontroller that will
communicate the code to the components of your program. For example,
the uno will communicate your code to the LED so that it performs what it is
instructed to.

Breadboard: A breadboard is a solderless device for temporary wiring


used to test circuit designs. Most electronic components in electronic
circuits can be interconnected by inserting their leads or terminals into the
holes and then making connections through wires where appropriate.

LEDs: (Light Emitting Diodes) are small lights made from a silicon diode.
They come in different colors, brightnesses and sizes. LEDs have a
positive (+) leg and a negative (-) leg, and they will only let electricity flow
through them in one direction. The (+) leg is the longer of the legs on the
LED.

Resistors: Resistors resist the flow of electricity. You can use them to
protect sensitive components like LEDs from . The strength of a resistor (measured in ohms) is
marked on the body of the resistor using small colored bands. Each color stands for a number,
which you can look up using a resistor chart. The LED can be safely lit without a resistor, but
will be brighter.
4

Assignment: BLINKY
Procedure:
1. Wire the project using the following schematic.

2. You can create your code in BlocklyDuino that you downloaded last lesson and then
paste it to the Arduino IDE. Below is the blockly code that you will need to make and
the Arduino code that you will need to copy and paste into codebender. Click
BlocklyDuino Reference for a link to all the blockly codes.
BLOCKLY CODE ARDUINO CODE

***SAVE your sketch to your BlocklyDuino Folder that you created***

3. Copy the Arduino Code from BlocklyDuino into the Arduino IDE. To paste the code into
the website be sure to use ctrl “v.” Hook up your arduino to your computer using the
USB cable.
5

6. Make sure the Arduino Uno board is hooked up using the supplied USB cord to your
computer. Select the correct serial port by clicking the Tools Menu then select port and
pick the serial port that appears (i.e. COM4 in this example).

7. Click the “upload” button.

8. Your program is now loaded. Observe your LED and complete your worksheet titled
Assignment: Blinking an LED.
6

Assignment WORKSHEET: Blinking an LED.


1. Describe in detail what the LED is doing. (Observe the timing).
Emits light when an electric current flows through it.

2. THE CODE. Code is a set of instructions used to communicate to the arduino. Answer the
following questions relating to code:
a) What does the output block do?
It makes the led light up

b) How would you write this code in Arduino?


Digitalwrite(9, high);

c) What does this timing block do ?


It makes the led blink slowly

d) How would you write this code in Arduino?


Delay (2000);

e) The following code turns the led off . How would you write this in
Arduino. (two lines)
Digitalwrite(9, low);
Delay (2000);
.
f) Coders can add a description of each line of code by putting // after their code. It gives
the person a reading it a description of what the code does. What punctuation does
Arduino use at the end of each instruction to separate them?
This punctuation does arduino use the end instruction to separate them “;” the
colon punctuation.

Extension Challenges:

3. Change your code so that your LED flashes on and off at one second intervals. Explain
how you changed your code to achieve this.

4. Change your code so that your LED flashes on for three seconds and off for one second.
Explain how you changed your code to achieve this.
7

5. Connect a different colored light to pin 10. Code your arduino to flash both lights at the
same time. Show your teacher!

6. Code light one to flash every two seconds and light two to code every second.

7. Code your lights so that when light one flashes on, light two flashes off and when light
two flashes on, light one flashes off. Show your teacher!

8. Wire a parallel and series circuit.

Parallel Circuit
8

Series Circuit

CONCLUSION:

9. List two real life applications that coding lights have in our everyday lives.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy