#10 Anne Roudaut hci2: building interactive devices hasso-plattner institute tangible & electronic.

Slides:



Advertisements
Similar presentations
Sensing and Control.
Advertisements

Lab7: Introduction to Arduino
Engineers in Training Day 2 Developed by Shodor and Michael Woody.
Fair Use Building and Research Labs Presents
Electricity and Circuits
1 Boe-Bot Parts BOE-BOT Lecture #1b DE - Digital Electronics.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
Dr. Andreas Kunz © 10/2004 inspire icvr BASICS OF ELECTRONICS.
Interactive Engineering Workshop Eng. Mageda Al-Moubarak Eng. Fadia El-ssa.
ELECTRONIC/COMPUTER AGE. Electronic/Computer Age  Electronics –Electrical signals can carry information quickly over wires or through the air by radio.
Working with Arduino: Lesson #2: Variable, Photo, and Force Sensitive Resistors EGN1007.
Digital I/O Connecting to the Outside World
Introduction.
Basic Circuits – Lab 1 Xmedia Spring Basically Power –Provides energy for the sensor and the output Sensor –Changes aspects of the circuit based.
Embedded Programming and Robotics Lesson 1 Basic Electricity and Electronics Transistor Basics Lesson 1 -- Basic Electricity1.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Chapter 1 Quick review over Electronics and Electric Components Prepared By : Elec Solv.
Pulse Width Modulation (PWM) LED Dimmer Circuit
Electronic Components
BASIC ELECTRONICS.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Basic Circuits – Lab 1 Xmedia Spring Basically Power –Provides energy for the sensor and the output Sensor –Changes aspects of the circuit based.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Embedded Programming and Robotics
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Image of Arduino. Arduino discussion Address issues with circuit walk-through – Electricity, Programming, Arduino Concepts Work on BeatTable (next week)
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
Intro to Arduino Zero to Virtual Prototyping in Seven Hours
Electricity and Electrical Circuits. Chapter Sections O 1 - Electrical Circuits O 2 - Current and Voltage O 3 - Resistance and Ohm’s Law.
Resistors Ohm’s Law and Combinations of resistors (see Chapter 13 in the A+ Certification book)
Segway Controller Notes. = connection on top layer of circuit board = connection on bottom layer of circuit board Ground Plane: Areas enclosed by the.
Hardware Basics. Electricity Electricity is the flow of electrons Atoms contain –In the nucleus (center) Protons with a positive charge Neutrons with.
ENGR 6806 – Motor Control Prepared By: Rob Collett September 15, Office: EN2074.
Electronics Section 2 Robotics, Electronics, and Fluid Power.
Advanced Design Applications Power and Energy © 2014 International Technology and Engineering Educators Association STEM  Center for Teaching and Learning™
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
© 2002 University of North Carolina at Charlotte, ALL RIGHTS RESERVED Basic DC Circuits Review.
AP Physics C Electric Circuits.
Circuits, Systems, & the Arduino. Challenge: Make the bulb light up! -Make observations and explain why it has the setup it does? - What are the components.
Getting Started With the Arduino Uno
Basic Electronics for Arduino -basic electronics -arduino related stuff -tips and tricks Rob Zimmermann 2015.
Electronic. Analog Vs. Digital Analog –Continuous –Can take on any values in a given range –Very susceptible to noise Digital –Discrete –Can only take.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Unit 13 Electric Circuits
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Circuits and electricity basics interactive materials spring 2016 Stacey Kuznetsov
Electronics for Physical Computing Materials: capacitor, diode, LED, transistor, switch,resistor, relay, proto board, multimeter.
Solar Powered LED Blinds Group 28: Austin Estes and Kerr Oliva TA: Katherine O’Kane.
Bdps 2 Lecture 2. Circuits and Ohm's Law For resistive circuits.
Static vs Current Circuit Elements Resistance is V / I Energy switch Make and use How to generate.
1 Transistor. 2 Transistors are used to turn components on and off They come in all different shapes and sizes.
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Prototyping with Microcontrollers and Sensors. Overview Objective Background Information Problem Statement Materials Procedure Assignment Closing.
Arduino.
SENSORS.
Prototyping with Microcontrollers and Sensors
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
UCD ElecSoc Robotics Club 2017/2018
Arduino - Introduction
Unit 3 – Fundamentals of Electronics Examination Specifications
Unit 3 – Fundamentals of Electronics Examination Specifications
How to avoid catching things on fire.
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Arduino Part 4 Let there be more light.
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Introduction to arduino
Presentation transcript:

#10 Anne Roudaut hci2: building interactive devices hasso-plattner institute tangible & electronic

assignment design, prototype, and laser cut a robotic vehicle that you can control by projecting on it upload sketches, drawings, & photos to the wiki

design & built a motorized tangible object your task: shape allows users to pick up and move (onmi) wheels and motor, so it can move itself light sensors, to allow sending commands to the tangible

electronic part with an arduino board

and a set of components (battery / motors / photoresistors / chips / resistors …)

arduino

board

program on PC (simplified C++) upload to the board separate and run independently main advantage of Arduino!

processor usb plug (5V) external power (max 12v) some LEDs reset button pins when programming and testing to run independently

usb plug (5V) external power (max 12v) some LEDs reset button pins pins: to plug in components such as… processor

LEDs long leg is the + +-

pin “gnd” (ground)pin “12” (we will see later why we need the resistor) what’s happening? the LED blinks continuously

step by step

configure 0

pluging in 1 pin “gnd” (ground)pin “12”

e.g. all these pins are connected It is the same here etc. test board

compiling 2

uploading 3

it is blinking: the board is uploading the binary code (1 = light on / 0 = light off) 3

executing 1st loop 4

5 reseting executes setup ()

test 1 (5 mn) 1.plug in a resistor and an LED in pin 12 2.launch the File/Examples/Basic/Blink arduino files 3.modify the code to make the LED says “SOS” in Morse (3 shorts, 3 longs, 3 shorts) pin 12 (5 V) pin gnd Blue LED -+-+ blinking LED 82 ohm

don’t forget your programming skills! write functions

test 2 (5 mn) (with the same circuit) 1.upload File/Examples/Basic/Blink to the board 2.change the first delay value to 1 and the second to 1. upload the code to the board 3.change the first delay value to 1 and the second to 10. upload the code to the board 4.compare the three cases and tell me more! more blinking

1 2 3 blink bright less bright even less bright HIGH LOW delay(1) … delay(10) delay(1) … delay(1) delay(1000) … delay(1000)

1 2 3 HIGH LOW voltage is either 0 or 5v voltage is ½ of 5V voltage is a 1/11 of 5 V delay(1) … delay(10) delay(1) … delay(1) delay(1000) … delay(1000)

pulse width modulation :: technique using a rectangular pulse wave whose pulse width is modulated resulting in the variation of the average value of the waveform it serves to create an analog signal from a digital one

digitalWrite("pin number", HIGH or LOW) or analogWrite("pin number", "value in [0;255]") (% of voltage) there are special pins that produce PWM signals (in addition to digital signals)

test 3 (5 mn) 1.change your circuit to use a PMW pin 1.write code with analogWrite() to make the led smoothly blink (the brightness progressively increases) smooth blinking

pins are input and output

digitalWrite("pin number”,”HIGH or LOW”) digitalRead("pin number”) -> 1 or 0 (0 if voltage < 3v) digital pins are for input and output

analogWrite("pin number”,[0;255]) PWM pins are analog output

analogRead("pin number”) -> [0;1023] (1023 being the maximum voltage in the board) analog pins are for analog input

both digital and analog pins deal with voltages reading input works with every components that generate voltages

battery

pin “gnd” pin “A0” 1.5V battery on A0 pin to read it voltage by the way, components that generate high voltage will damage the board, be careful!

digitalWrite(A0,HIGH)

Monitor display Serial.print() Serial,println() of [0;1023] so 305x5/1023 = 1,49V

so it works with components that generate voltages such as…

photodiode voltage increases when the intensity of light increases

piezoelectric cells voltage increases when pressure increases

but also with components that generate resistance (and we will see the trick later)

conductive foam material in what components are plug in it removes electrostatic charges

conductive foam the more you squeeze it, the less it resists to the travel of the charges it lets the charge passing thought: it conduces charges

pin “gnd” pin “A0” let’s play with a piece of conductive foam

test 4 (5 mn) 1.plug in two wires and a piece of foam between pin A0 and GND 1.write code to display the change of voltage on pin A0 1.write code to make an LED more or less bright when you squeeze the foam read pins

it is a simple way to make a pressure sensor

at this point you know the basics of arduino you are almost ready to go what remains now is some math in order to understand…

why do we need a resistor with the LED? how does an input pin read different values of resistance whereas we said it reads voltage? 1 2

let’s forget arduino for a moment

electric quantities voltage / current / resistance battery resistor

-+-+ voltage is the amount of cars it is measured in Volt battery resistor traffic jam analogy

resistance defines the type of road it is measured in Ohm (Ω) 10 Kilo OHM vs. 60 OHM vs highways let more cars passing through current is the amount of cars that pass through the circuit per units of time (the flow) it is measured in Ampere

Current Voltage plumbing analogy

the smaller the road is (resistance increases), the slower the flow of cars is (current decreases) the harder a pipe is pressed, the smaller the water flow is

the relation between these 3 quantities is given by Ohm’s law U = R x I Volt Ohm Ω Ampere

U=RI works for resistors Current (I) 1 Ω resistor

resistors color code = value

more generally, U=RI works for ohmic materials Current (I) 1 Ω resistor Voltage (U) 1 meter silver (1.59×10 −8 Ω) 1 meter air (1.3×10 16 Ω) 1 meter sea water (0.2 Ω) conductors insulators

most components are not ohmic e.g. light bulb / LED / motor

ligh bulb U I the resistance of the filament increases with its temperature

LED works in a small interval of voltage steep slope: small variations of voltage = large variations of current U I

U I LED offLED on (brightness increasing) LED blows max current indicated on the spec working voltage interval indicated on the spec

to reduce current we put a resistor in serie to know it value, we use Ohm’s law Red LED [1.8;2.2] V 0,02 A -+-+ (5-2.2) = R x 0,02 R = 140Ω V battery

we can also adapt the voltage but … Red LED [1.8;2.2] V 0,02 A V battery -+-+

U I LED offLED on (brightness increasing) LED blows steep slope: when the voltage decreases a little bit, the current dramatically decreases, thus decreasing the brightness

the resistor also regulates the LED voltage, that stays almost constant Red LED [1.8;2.2] V 0,02 A V battery 140Ω

so LEDs must always be mounted with a resistor in serie

true for several LEDs in serie V battery Red LEDs [1.8;2.2] V 0,02 A (5-2x2.2) = R x 0,02 R = 30Ω 30Ω

true for several LEDs in parrallel V battery Red LEDs [1.8;2.2] V 0,02 A (5-2.2) = R x 0,02 R = 140Ω 140Ω (voltage is the same in each branch)

if LEDs are the same, we can also serialize the resistor V battery Red LEDs [1.8;2.2] V 0,02 A (5-2.2) = R x (2x0,02) R = 70Ω 70Ω 0.04 A is drained from the battery (current splits in each branch)

why do we need a resistor with the LED? how does an input pin read different values of resistance whereas we said it reads voltage? 1 2 done and we know how to compute it value

squeezing the foam changes the resistance but the voltage of A0 pin was changing

Battery 5 V conductive foam -+-+ the resistance changes and thus the current (Ohm’s law) but still not the voltage

so there must be a trick somewhere … we must use a tension divider circuit layout

tension divider R foam + R pullup R foam x V in V out = V in -+-+ pull-up resistor V out

V in -+-+ V out demonstration V in = R pullup I + R foam I (1)ohm’s law U = RI (2) Kirchhoff 2 nd law Σ voltage drop by components = Σ voltage generates in the circuit by the way, Kirchhoff 1 st law at any nodes, Σ current floating in = Σ current floating out

V in -+-+ V out demonstration V in = R pullup I + R foam I (1)ohm’s law U = RI (2) Kirchhoff 2 nd law Σ voltage drop by components = Σ voltage generates in the circuit V out = R foam I V out = R foam x V in (R pullup + R foam ) So

pin 5V R foam + R pullup R foam X 5 A0 = so the arduino circuit can look like that e.g. 10 KΩ (to have precise A0 value) pull-up resistor pin A0 pin GND

pin 5V pull-up resistor pin A0 pin GND but arduino also have an internal pull-up resistor -> we can plug in the foam between A0 and gnd Optional if internal pull up resistor is enabled

potentiometer by the way, a potentiometer is a tension divider circuit Vout Vingndresistor adjustable

why do we need a resistor with the LED? how does an input pin read different values of resistance whereas we said it reads voltage? 1 2 done and we know how to compute it value

use multimeter (in the shop) to check voltage: in parrallel current: in serie

more components

motor M

photoresistor resistance decreases when the intensity of light increases

relays to switch on higher voltage

transistors a small current at the Base can control or switch a much larger current between the Collector and Emitter It serves as a switch or current amplifier

capacitors they store electric charge

capacitors

chips or integrated circuits (the notch shows the orientation when reading the spec) more pins!

chips 7400 serie = 4 NAND GATES A B out A B out example:

Gleichrichter chips H-BRIDGE It can inverse the polarity of two motors (one on each side) It doesn't control the amount of voltage (i.e. the speed). For that, you must reduce or increase the voltage sent on pin 8

chips H-BRIDGE

chips H-BRIDGE Pin 8 is the power for the chip. It has to be max 5V. Just plug in it to a digital pin always HIGH Pin 6 is the control pin for the left motor. If it is HIGH the left motor do something, otherwise nothing (same principle for the pin 7 controlling the motor on the right) If pin 2 LOW pin 3 HIGH, then the left motor will turn in one direction If pin 2 HIGH pin 3 LOW, the left motor will turn in the other direction If both pin 2 and 3 have the same value the left motor stop (same principle for right motor and pin 4 and 5)

555 timer (e.g. toaster timer) 741 operational amplifier (amplify current) Accelerometers … chips etc.

without the computer

external power max 12 V (some versions can handle more) max 40mA per pins max 50mA on 3.3V pin

for your 9V battery

assignment design, prototype, and laser cut a robotic vehicle that you can control by projecting on it upload sketches, drawings, & photos to the wiki Go! be sure your design is feasible : - check materials before - ask Professor or TA

end

have you ever tasted a 9V battery? no more than 9V!

try different flavors ! wetdry

Ampere (current/flow) (A) Resistance (Ohm Ω) Voltage (pressure) (V) Water level

= electron particle

different flavors = different resistance electrons flow more or less easily wetdry

encoder