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

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

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Lab 2: Blinkie Lab. Objectives. Materials. Theory

FABO ACADEMY X ELECTRONIC DESIGN

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

Arduino Lesson 1. Blink. Created by Simon Monk

Lesson 3: Arduino. Goals

Lab 2.4 Arduinos, Resistors, and Circuits

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

Rodni What will yours be?

Pulse Width Modulation and

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

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

Coding with Arduino to operate the prosthetic arm

Arduino An Introduction

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

Understanding the Arduino to LabVIEW Interface

LESSONS Lesson 1. Microcontrollers and SBCs. The Big Idea: Lesson 1: Microcontrollers and SBCs. Background: What, precisely, is computer science?

Lesson 13. The Big Idea: Lesson 13: Infrared Transmitters

Experiment 1: Robot Moves in 3ft squared makes sound and

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

The Motor sketch. One Direction ON-OFF DC Motor

LED + Servo 2 devices, 1 Arduino

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

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

Module: Arduino as Signal Generator

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

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

Blink. EE 285 Arduino 1

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

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

INA169 Breakout Board Hookup Guide

Objective of the lesson

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Internet of Things Student STEM Project Jackson High School. Lesson 2: Arduino and LED

Name & SID 1 : Name & SID 2:

Arduino: Sensors for Fun and Non Profit

Welcome to Arduino Day 2016

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

Milli Developer Kit Reference Application Published on Silver Spring Networks STAGE (

1Getting Started SIK BINDER //3

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

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Application Note AN 102: Arduino I2C Interface to K 30 Sensor

Lab 5: Arduino Uno Microcontroller Innovation Fellows Program Bootcamp Prof. Steven S. Saliterman

Experiment #3: Micro-controlled Movement

CONSTRUCTION GUIDE IR Alarm. Robobox. Level I

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

introduction to Digital Electronics Install the Arduino IDE on your laptop if you haven t already!

Workshop 9: First steps in electronics

TWEAK THE ARDUINO LOGO

CPSC 226 Lab Four Spring 2018

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Practical Assignment 1: Arduino interface with Simulink

Sten-Bot Robot Kit Stensat Group LLC, Copyright 2013

Computer Science/Computer Engineering. Wheeler HS Fall 2018 Foundations of Engineering

Directions for Wiring and Using The GEARS II (2) Channel Combination Controllers

CMSC838. Tangible Interactive Assistant Professor Computer Science

Arduino Sensor Beginners Guide

Exam Practice Problems (3 Point Questions)

// Parts of a Multimeter

Preface. If you have any problems for learning, please contact us at We will do our best to help you solve the problem.

Intro to Electronics. Week 1

CONSTRUCTION GUIDE Robotic Arm. Robobox. Level II

INTRODUCTION to MICRO-CONTROLLERS

INTRODUCTION to MICRO-CONTROLLERS

Lab 06: Ohm s Law and Servo Motor Control

ARDUINO / GENUINO. start as professional

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

INTRODUCTION to MICRO-CONTROLLERS

CONSTRUCTION GUIDE Capacitor, Transistor & Motorbike. Robobox. Level VII

.:Twisting:..:Potentiometers:.

Build a Mintronics: MintDuino

Demon Pumpkin APPROXIMATE TIME (EXCLUDING PREPARATION WORK): 1 HOUR PREREQUISITES: PART LIST:

Arduino Intermediate Projects

ZX Distance and Gesture Sensor Hookup Guide

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Breadboard Arduino Compatible Assembly Guide

Total Hours Registration through Website or for further details please visit (Refer Upcoming Events Section)

1. Controlling the DC Motors

APDS-9960 RGB and Gesture Sensor Hookup Guide

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

Arduino Advanced Projects

Introduction to. An Open-Source Prototyping Platform. Hans-Petter Halvorsen

LEDs and Sensors Part 2: Analog to Digital

Project Kit Project Guide

Using Transistors and Driving Motors

Electronic Components

3.5 hour Drawing Machines Workshop

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Breadboard Primer. Experience. Objective. No previous electronics experience is required.

Two Hour Robot. Lets build a Robot.

EE 314 Spring 2003 Microprocessor Systems

ezsystem elab16m Light Sensing Robot

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

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

Community College of Allegheny County Unit 7 Page #1. Analog to Digital

BEYOND TOYS. Wireless sensor extension pack. Tom Frissen s

ISSN: [Singh* et al., 6(6): June, 2017] Impact Factor: 4.116

Peek-a-BOO Kit JAMECO PART NO / / Experience Level: Beginner Time Required: 1+ hour

Transcription:

Physics 222 Name: Exercise 6: Mr. Blinky This exercise is designed to help you wire a simple circuit based on the Arduino microprocessor, which is a particular brand of microprocessor that also includes the Raspberry Pi and similar devices. These microprocessors require coding to even deliver current to the circuit, so there is both a hardware and software component to this exercise please trade off wiring and coding with your partner! The Autodesk Corporation has a pretty good Arduino simulator called Circuits (www.tinkercad.com) if you want to practice your coding or wiring skills out of class. For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment. 1. For the four resistors shown below, which are connected in a meaningful way and which are not? By meaningful, I mean that the resistor could be part of a real circuit. Now build your first circuit with the Arduino. As you saw in the first question, you never connect a device (LED, resistor) in the same connected row or column. Using the breadboard and the supplied jumpers, connect your 220 ohm resistor and LED to the Arduino s +5V power pin and ground (0V). You are simply using the Arduino as a 5V source. LED is an abbreviation for light-emitting diode, and is therefore a diode, and therefore has a polarity; if the LED does not light up in one direction, switch its polarity. 2. Draw the schematic circuit for what you ve just built. For the power source, simply indicate which number pin on the Arduino you connected the jumper to.

The 220 W resistor is limiting the current to the LED. Remember, the LED can only take up to 30 ma of current. Of the 5 volts supplied to the circuit, if the LED draws 30 ma (the maximum), then it would have 2.1 volts across it. That leaves 2.9 volts for the resistor. 3. What is the minimum value resistor that would work for this simple circuit? You would just need to use a resistor that is that value or larger, but not so large the current drops to a level where the LED won t light up, which is around 0.4 ma. (Hint: it is less than 220 W). Show your work. Note you could have just used a 5V battery or other voltage source you don t need a microcontroller to make an LED light up! Now turn on the laptop, and connect the USB cable to the Arduino (the port on the Arduino is not a USB). Your LED should light up; if it does not, flip the leads of the LED around. To do that you will need to move the wire going to the LED from the 5V pin to a digital pin 13. Unlike the 5V pin which always supplies 5V, the digital pins can supply 5V or 0V, controlled by the program you send to the microcontroller. Open the Arduino software (there s an icon on the Desktop, or else Start All Programs AS instruments Arduino). Make sure that Arduino Uno is selected under Tools/Board and you select the COM port listed in the Tools/Serial Port menu. A version of the Arduino called the Ruggeduino has a built-in 220 W resistor; the one that you are using does not. There is only the 220 W resistor that you included in the circuit. Most companies Arduinos doesn t have this built-in resistor, so it is critical you add one if you use one of these Arduinos. Since voltage = current resistance, (2.9 V)/(440 W) = 6.6 ma, well under the 30 ma maximum the LED can handle, but still enough current to light up the LED. Begin by using the variable int or integer and tell the Arduino which pin the LED is plugged into:

Remember that setup is used for things that only need to be done once. Therefore, tell the Arduino that the LED in pin 13 is an output. That means when you input data, it outputs an outcome or result. So add the following: void setup () { pinmode(ledpin,output); } The next step is telling the Arduino what you want to do with the LED. You first need to use the digitalwrite command to turn the LED ON. Then use the delay command to specify the amount of delay time in milliseconds. Use the same command to turn it OFF then wait again. Since this is a loop the process will repeat forever until the power is removed. void loop () { digitalwrite(ledpin,high); delay(1000); digitalwrite(ledpin,low); delay(1000); } To run this program, you first have to compile it (convert the code into the digital information the microprocessor understands) and then send that to the Arduino. To compile your sketch, click the checkmark. Try changing the time for each delay. Click the arrow to download the program to Arduino. If everything is attached correctly after a few seconds the LED should blink.

4. Delete the second of the two delay(1000) commands, then compile and send the program to your Arduino. Explain why you see what you see. 5. Modify your code so that the LED blinks on and off 10 times in 10 seconds, then turns off for 3 seconds, then repeats this cycle. Write your code below and show your instructor your working program.

The Arduino is a digital device, but we can use digital pins 3, 5, 6, 9, 10, and 11 to emulate an analog signal. It does this with Pulse Width Modulation (PWM). Digital pulses are created that vary so rapidly that a human eye cannot detect the changes, so it can be made to look like the LED brightness is changing smoothly. Switch the + LED pin to digital pin #9 (change the integer in the code as well) and then modify your code with this line in the loop replacing the digitalwrite and delay commands: analogwrite(ledpin,new number); where the new number can be any value between 0 and 255 (see the figure above). Try various numbers from 0 to 255. For each different number you should get a different brightness. 6. At which new number can you detect any light from the LED at all? The Arduino microprocessor has been worked on for many years, and a lot of programs have been written to control a large number of devices, including LEDs. These collections of programs, or snippets within programs, are called libraries. A library of programs was downloaded along with the Arduino IDE.

Go to FILE EXAMPLES ANALOG FADING. Follow the hyperlink, which explains how to FADE. Study their code and answer the following question: 7. Exactly how long does it take for the LED to go from 0 brightness to maximum brightness? (How many times does the delay execute?) Show your work.