Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

Similar documents
Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

LDR_Light_Switch2 -- Overview

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

SPDM Level 2 Smart Electronics Unit, Level 2

LDR_Light_Switch5 -- Overview

Lab 2.2 Ohm s Law and Introduction to Arduinos

Physical Computing Self-Quiz

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

GUIDE TO SP STARTER SHIELD (V3.0)

Arduino Programming. Arduino UNO & Innoesys Educational Shield

LDR_Light_Switch1 -- Overview

Halloween Pumpkinusing. Wednesday, October 17, 12

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Introduction to Arduino Diagrams & Code Brown County Library

Introduction to Arduino Diagrams & Code Brown County Library

RKP08 Component List and Instructions

How to use the Zduino LEE Module with the Trainer Board

ARDUINO MINI 05 Code: A000087

Arduino 6: Analog I/O part 1. Jeffrey A. Meunier University of Connecticut

Create moving images in forward and reverse with your Arduino when you connect a motor to an H-bridge and some still images BATTERY POTENTIOMETER

Project 16 Using an L293D Motor Driver IC

Electronic Brick Starter Kit

Analog Input. Sure sure, but how to make a varying voltage? With a potentiometer. Or just pot.

Tutorial 1: Software Setup

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

EDUCATION EXPERIENCES WITH A USB INTERFACE

Arduino Platform Part I

Layad Circuits Arduino Basic Kit B. Content Summary

Sensor board. EB003

TA0013 ARDUINO RFID UNO STARTER KIT

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Potentiometers. Showcase your project!

Laboratory of Sensors Engineering Sciences 9 CFU

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

Arduino Robots Robot Kit Parts List

RS422/RS485 Shield. Application Note: Multiple RS485 busses. 1 Introduction

Prototyping & Engineering Electronics Kits Basic Kit Guide

Quick Start by JP Liew

Arduino IDE The Developer Kit library The JeeLib library for RFM12 transceivers

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

Elektor Uno R4 Installation & Test

EXPERIMENT 7 Please visit to learn all features of arduino before you start the experiments

PHYC 500: Introduction to LabView. Exercise 16 (v 1.2) Controlling hardware with DAQ device. M.P. Hasselbeck, University of New Mexico

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

Arduino Lesson 15. DC Motor Reversing

Arduino Micro Breadboard Laboratory Interface Processor (Micro BLIP) User Manual

cs281: Introduction to Computer Systems Lab03 K-Map Simplification for an LED-based Circuit Decimal Input LED Result LED3 LED2 LED1 LED3 LED2 1, 2

EK307 Lab: Microcontrollers

solutions for teaching and learning

Arduino Prof. Dr. Magdy M. Abdelhameed

Robotics/Electronics Review for the Final Exam

Adafruit 1-Wire GPIO Breakout - DS2413

Techgirlz Workshop Scratch and Raspberry Pi

Make a Simple Weather Station Using Arduino

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

Beyond the Blink: Add Drupal to Your IoT Playground. Amber Matz

AT42QT1010 Capacitive Touch Breakout Hookup Guide

AlphaBot2 robot building kit for Arduino

Number Name Description Notes Image 0101 Resistor, 100 ohm. brown-black-browngold. ¼ watt, 5% tolerance, red-red-brown-gold. brown-black-red-gold.

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

Arduino 04: Python Arduino reference. Jeffrey A. Meunier University of Connecticut

IME-100 Interdisciplinary Design and Manufacturing

AT42QT101X Capacitive Touch Breakout Hookup Guide

Getting Started Manual for CODIBOT

Digital Pins and Constants

Lesson 4: Animation. Goals

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

In this activity you will create a tool to allow you to play games such as Red Light/Green Light. To create the game, follow the steps below.

Arduino: RGB LEDs Diagrams & Code Brown County Library

Electronics Single Board Computers

3. The circuit is composed of 1 set of Relay circuit.

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

1.0. Presents. techathon 3.0

Pg 3. Specifications. Hardware Required

Floppy Disk To USB. Converter Installation and. Operation Manual

ArdOS The Arduino Operating System Quick Start Guide and Examples

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

Digital I/O Operations

Thursday, September 15, electronic components

AndyMark Arduino Tutorial

Copyright 2017 by ELENCO Electronics, Inc. All rights reserved. No part of this book shall be reproduced

micro:bit Lesson 2. Controlling LEDs on Breadboard

Introduction to microcontrollers

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

How-To: Make an RGB combination door lock (Part 1)

Physical Computing Self-Quiz

BASIC Arduino. Part I

FUNCTIONS For controlling the Arduino board and performing computations.

One Grove Base Shield board this allows you to connect various Grove units (below) to your Seeeduino board; Nine Grove Grove units, consisting of:

Module 1: Crash Prevention Lesson 3: Weather Information systems Programming Activity Using Arduino Teacher Resource Grade 6-8 Time Required

Bill of Materials: Picaxe-based IR Control Module Pair PART NO

- Software may become unresponsive during some operations, always wait before reclicking.

Background. Procedure

RedBoard Hookup Guide

Goal: We want to build an autonomous vehicle (robot)


Ardusat Space Kits in the Classroom


Spooky Projects. Class 2. Introduction to Microcontrollers with Arduino. 14 Oct machineproject - Tod E. Kurt

Transcription:

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen By the end of this session: You will know how to write a program to send values to the computer screen and also dim LEDs. Page: 1

Arduino Uno Breadboard Jumper Wires LEDs Resistors Potentiometer Potentiometers are used in objects such as volume controls and radios, they are resistors that change their value depending on their position. The Arduino can read this value as a number between 0 and 1024. LDR s (Light Dependent Resistors) change their resistance when light changes, this can be read by the Arduino and used in programs. LDR Page: 2

1) Insert the potentiometer into the breadboard and connect three wires as shown in the diagram. 2) Connect a wire and resistor as shown in the diagram. 3) Finally, connect an LED and a wire between the Arduino s pin 9 and the LED. Page: 3

1) Plug the USB cable into the Arduino and Computer, then open the Arduino Program. 2) Visit the website http://bit.ly/1dovzwe and copy and paste the Analog template program into the Arduino window. 3) The program sets LED (pin p) as an OUTPUT in the setup function. It then enters the loop and saves the value read from the potentiometer into a variable called value. This is between 0 1023. The final part sends the value to the LED. It needs to be divided by 4, since the output range is between 0 256. Page: 4

4) Upload the program by clicking on the upload button. 5) Your LED should change in brightness when you turn the potentiometer. It would be useful to know what value the Arduino is using, so we are going to make the Arduino talk to the computer to show us the value. Add the following line of code to the bottom of the setup function: This starts the conversation between the Arduino and the computer. The number is the speed at which it talks. 6) Then add the following lines of code in the loop function: This sends the potentiometer value to the computer screen. Page: 5

7) Upload the program by clicking on the upload button. 8) Open the Serial Monitor by clicking on the Serial Monitor button. 9) Check that the number displayed in the bottom right corner is 115200, if not, click on the drop down menu and choose it. 9) You should see numbers appear in the window, turn the potentiometer and watch the values change. These numbers are being used to set the brightness of the LED. Page: 6

10) We can also use the number from the potentiometer in a different way. Such as changing the delay of a flashing LED. Replace your loop function with the code shown on the right. 11) Upload the program and open the Serial Monitor. 12) You should see that when the numbers get smaller, the LED flashes faster. However, when it flashes really quickly, it becomes too quick for us to see, instead it just looks dimmer. This is how the analogwrite function works. 13) Other devices can be used to input an analogue value, nut just a potentiometer. For example we can replace the potentiometer with an LDR. Page: 7

14) Remove the potentiometer and plug in the LDR and resistor as shown in the diagram below: Place your hand over the LDR, and you should see that the LED flashes at a different rate. Extension task If you finish all of these steps, try making the LED flash twice as slow. Also get the Arduino to send a message to the computer every time it turns the LED on (Hint, you will need this line of code:) Page: 8