Objective of the lesson

Similar documents
Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

Arduino Lesson 1. Blink. Created by Simon Monk

Programming 2 Servos. Learn to connect and write code to control two servos.

Two Hour Robot. Lets build a Robot.

Lesson 3: Arduino. Goals

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Lab 2.4 Arduinos, Resistors, and Circuits

In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. S4A - Scratch for Arduino Workbook

The answer is R= 471 ohms. So we can use a 470 ohm or the next higher one, a 560 ohm.

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

LED + Servo 2 devices, 1 Arduino

Memory. Introduction. Scratch. In this project, you will create a memory game where you have to memorise and repeat a sequence of random colours!

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

Blink. EE 285 Arduino 1

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Lighthouse Beginner s soldering kit

Explore and Challenge:

Internet of Things Student STEM Project Jackson High School. Lesson 3: Arduino Solar Tracker

Introduction 1. Download socket (the cable plugs in here so that the GENIE microcontroller can talk to the computer)

Micro USB Lamp Kit TEACHING RESOURCES. Version 2.1 DESIGN A STYLISH LAMP WITH THIS

In this project you ll learn how to create a times table quiz, in which you have to get as many answers correct as you can in 30 seconds.

Congratulations on your purchase of the SparkFun Arduino ProtoShield Kit!

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Workshops Elisava Introduction to programming and electronics (Scratch & Arduino)

Brain Game. Introduction. Scratch

FABO ACADEMY X ELECTRONIC DESIGN

Pi-Cars Factory Tool Kit

Create Your Own World

Lab. I Electrical Measurements, Serial and Parallel Circuits

Arduino An Introduction

Let s start by making a pencil that can be used to draw on the stage.

The USELESS BOX. Procedure:

PLAN DE FORMACIÓN EN LENGUAS EXTRANJERAS IN-57 Technology for ESO: Contents and Strategies

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

Resistance Measurements (Measure all of your resistors, since even those that are labeled the same can be at least a little different)

Lesson 2: Soldering. Goals

Lab 12: Timing sequencer (Version 1.3)

TV Remote. Discover Engineering. Youth Handouts

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

micro:bit Basics The basic programming interface, utilizes Block Programming and Javascript2. It can be found at

Name My end of year 8 Target = Teacher. OLSJ Design & Technology Electronic Products. Overall Progress Effort Rating ABCDEFG.

EASY BUILD TIMER KIT TEACHING RESOURCES. Version 2.0 LEARN ABOUT SIMPLE TIMING CIRCUITS WITH THIS

Programmable Timer Teaching Notes Issue 1.2

1. (2 point deduction for failure to complete this problem!)

Fireworks. Level. Introduction: In this project, we ll create a fireworks display over a city. Activity Checklist Follow these INSTRUCTIONS one by one

Let s start by making a pencil, that can be used to draw on the stage.

Controlling Your Robot

Rodni What will yours be?

The Motor sketch. One Direction ON-OFF DC Motor

Information for teachers

Bellman BRUGERVEJLEDNING. Fyrtårn Flash BE1441

Experimental Procedure

Digital Electronics & Chip Design

Quick-Prep Series. The. Countdown. Mathematics LEVEL D 141NA

Pong Game. Intermediate. LPo v1

Module 5 Control for a Purpose

Arduino Sensor Beginners Guide

Experiment #3: Micro-controlled Movement

DARK ACTIVATED COLOUR CHANGING NIGHT LIGHT KIT

Build a Mintronics: MintDuino

// Parts of a Multimeter

Give one or two examples of electrical devices that you have personally noticed getting warm when they are turned on.

UCL Micro:bit Robotics Documentation

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

ZX Distance and Gesture Sensor Hookup Guide

Exam Practice Problems (3 Point Questions)

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

Application Note. Communication between arduino and IMU Software capturing the data

D - Robot break time - make a game!

Haria Nikunj Jayantilal Orre Liza Maribor Turning LED on/off using motion sensor- A project report

Lesson 2: Soldering. Goals

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

The light sensor, rotation sensor, and motors may all be monitored using the view function on the RCX.

A Day in the Life CTE Enrichment Grades 3-5 mblock Robotics - Simple Programs

Controlling a Sprite with Ultrasound

Electronics & Control

LEVEL A: SCOPE AND SEQUENCE

Coding with Arduino to operate the prosthetic arm

Breadboard Arduino Compatible Assembly Guide

Lab# 13: Introduction to the Digital Logic

Module: Arduino as Signal Generator

Arduino Setup & Flexing the ExBow

Arduino Workshop 01. AD32600 Physical Computing Prof. Fabian Winkler Fall 2014

Q48 Point to Point System Quick Start Guide

WEEK. Learning Objective. Materials to Prepare LESSON

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

EET 1150 Lab 6 Ohm s Law

e d u c a t i o n Detect Dark Line Objectives Connect Teacher s Notes

RESISTANCE & OHM S LAW (PART I

TECH 3232 Fall 2010 Lab #1 Into To Digital Circuits. To review basic logic gates and digital logic circuit construction and testing.

Studuino Icon Programming Environment Guide

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

Workshop 9: First steps in electronics

Servo Sweep. Learn to make a regular Servo move in a sweeping motion.

CONSTRUCTION GUIDE IR Alarm. Robobox. Level I

On the front of the board there are a number of components that are pretty visible right off the bat!

INA169 Breakout Board Hookup Guide

Transcription:

Arduino Lesson 5 1

Objective of the lesson Learn how to program an Arduino in S4A All of you will: Add an LED to an Arduino and get it to come on and blink Most of you will: Add an LED to an Arduino and get it to display an SOS message Some of you will: Add two LEDs to an Arduino and get them to blink on and off alternatively 2

Homework Arduino s use inputs and outputs. You will need to write down a range of inputs and outputs which you come across during the week, where they were found and what their use was. Also whether the inputs measured Boolean or analogue signals You need to complete this homework for next lesson Write it down in your planner 3

Making a circuit A light or lamp is also known as an LED (Light Emitting Diode) If you join it to both sides of a battery, current flows around the circuit you have made, from one side of the battery to the other. One side of the battery is called GROUND (or GND for short) However, the LED only has a 50% chance of coming on

Making a circuit It has a 50% chance of coming on because it must be joined to the battery the correct way round. If it is the wrong way round then it does not come on. An LED has two legs, a short one and a long one. The short leg is called the GROUND or GND leg for short

Control Project using Arduino Instead of a battery we are going to use an Arduino. This is a device than can be used to control LEDs and make them blink on and off (and much more)

Control Project using Arduino Your Arduino has holes called PINS. The most important is the GROUND pin labelled GND. The short leg of the LED will need connecting to the GND. For the other side of the battery we will use pin 13

Making a circuit If we add an LED we can send a current from PIN 13 back to GND and the LED will come on Note we have the short leg connected to GND

Check your understanding A B Only one of these LEDs will come on Which one does NOT come on? Why?

Your Arduino Your Arduino has ben set up with something called a breadboard to make it easier to plug in your LEDs It looks a little like the picture on the left A black wire comes out from GND A red wire comes out from PIN 13

Your Arduino The way that a breadboard works is that the line of holes coloured green are joined together They are joined like this so that GND is joined to all of the black holes and PIN 13 is joined to all of the red holes

Time to add an LED to your Arduino A B C D Which diagram is connected correctly so that a current will travel from PIN 13 to GND and through the LED correctly

Time to add an LED to your Arduino B The correct answer was B Current flows from PIN 13, Down the red wire Along the breadboard holes To the long leg of the LED Through the LED Down the short leg of the LED Along the breadboard holes Down the black wire Round to GND Add your LED as shown in the diagram

Turning the LED on using Scratch for Arduino (S4A) When the green flag is clicked to start the program running, pin 13 sends electrical current through the LED to ground This is in a forever loop so happens continuously Challenge : Make the LED blink ON and OFF every 1 second like on a lighthouse

Turning the LED on using Scratch for Arduino (S4A) Challenge : Make the LED blink ON and OFF every 1 second like on a lighthouse

Answer : Getting the LED to blink e.g. Lighthouse When the green flag is clicked to start the program running, pin 13 sends electrical current through the LED to ground for 0.5 second and then stops for 0.5 second. This is in a forever loop so happens continuously. The LED will blink

Turning the LED on using Scratch for Arduino (S4A) Challenge : Make the LED blink ON and OFF faster, every 0.5 seconds, like on a bike light

Answer : Getting the LED to blink more quickly e.g. Bike Light When the green flag is clicked to start the program running, pin 13 sends electrical current through the LED to ground for 0.5 second and then stops for 0.5 seconds. This is in a forever loop so happens continuously. The LED will blink quickly

Turning the LED on using Scratch for Arduino (S4A) Challenge : Make an SOS message for a ship in trouble An SOS message will: Blink for 1 second 3 times. Blink for 3 second 3 times. Blink for 1 second 3 times. It will wait 1 second between all blinks

SOS message 3 short blinks 3 long blinks 3 short blinks Here is a solution. It would work fine but it is very long. These would all need adding into the forever loop.

SOS message Can you tidy up the code? Hint you need to use a 3 times repeat block. Any code in here will run 3 times over

SOS message Need another clue? These will repeat the short and long blocks 3 times each

SOS message Put them in a forever loop and it works! This repeats the short blink 3 times This repeats the long blink 3 times This repeats the short blink 3 times I have improved this further by adding a wait 3 seconds between SOS messages

Turning on more than 1 LED Challenge : Can you add a second LED to add a double blinking light?

Turning on 2 LEDs independently Notice that your Arduino has another wire, a yellow wire. This joins PIN 12 to the breadboard Which holes on the breadboard does the yellow wire join to?

Turning on 2 LEDs independently Well done. The yellow wire automatically joins to these holes on the breadboard

Turning on 2 LEDs independently Well done. The yellow wire automatically joins to these holes on the breadboard

Turning on 2 LEDs independently Challenge : Make a zebra crossing. Turn the RED LED ON for 1 second with the yellow LED OFF Then turn the YELLOW LED ON for 1 second with the red LED OFF

Creating a zebra crossing Did you get it correct?