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

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

Robotics/Electronics Review for the Final Exam

Potentiometers. Showcase your project!

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

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

Physical Computing Self-Quiz

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

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

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

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

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

Rotary Encoder Basics

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Lab 2.2 Ohm s Law and Introduction to Arduinos

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

Using PSpice to Simulate Transmission Lines K. A. Connor Summer 2000 Fields and Waves I

Getting Started Guide

Halloween Pumpkinusing. Wednesday, October 17, 12

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Light Sensor. Overview. Features

Physical Computing Self-Quiz

Bill of Materials: Turn Off the Lights Reminder PART NO

Lecture 12. Building an LED Display

Lab 0: Wire Wrapping Project: Counter Board

Digital Pins and Constants

The PUMPKIN LIGHT LED

Arduino Lesson 15. DC Motor Reversing

Introducing Cubelets. What do they do?

6 Channel Lighting Flicker Board

BBC micro:bit Cool Colours!

ANATOMY OF A BIT TM how you can tell top from bottom. four on the floor!

Thursday, September 15, electronic components

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

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

HiJack Hello world! Project

LDR_Light_Switch1 -- Overview

Thumb Joystick Retail. Tools and parts you'll need. Things you'll want to know. How does it work? Skill Level: Beginner. by MikeGrusin March 22, 2011

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

ENGG1015: Lab 7. In Search of Light

INTRODUCING THE CODEBIT!

GALACTIC MOON 2CE. user manual. Abstract Design to Light 1996 Tel:

How to Use an Arduino

DEV-1 HamStack Development Board

Electronic Brick Starter Kit

Project 16 Using an L293D Motor Driver IC

Contents Copyright 2013 By Small Bear Electronics LLC

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

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

Experiment 4.A. Speed and Position Control. ECEN 2270 Electronics Design Laboratory 1

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

E40M LEDs, Time Multiplexing. M. Horowitz, J. Plummer, R. Howe 1

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

SPDM Level 2 Smart Electronics Unit, Level 2

Using Sensors with the RoboRIO

Bionic Arduino. Class 1. Introduction to Microcontrollers with Arduino. 11 Nov machineproject - Tod E. Kurt

Prototyping & Engineering Electronics Kits Basic Kit Guide

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

Lesson 0 Installing IDE

Arduino - DigitalReadSerial

Techgirlz Workshop Scratch and Raspberry Pi

Look closely at this schematic diagram, in thid class you will be asked to construct this circuit WITHOUT using the textbook!

SX1509 I/O Expander Breakout Hookup Guide

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

BuffaloLabs WiFi Lantern Assembly guide version 1

TELIKOU Intercom System. FM Wire Matrix Control Station. Instruction Manual

Laboratory of Sensors Engineering Sciences 9 CFU

High Power (15W + 15W) Stereo Amplifier

Experiment 10 Fall 2012

Physics 120/220 Lab Equipment, Hints & Tips

DIY Line Tracking Smart Car with AT89C2051

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Intro to Arduino. Zero to Prototyping in a Flash! Material designed by Linz Craig and Brian Huang

Mercury Baseboard Reference Manual

CHAPTER 5. Voltage Regulator

Measuring Light with a BeagleBone Black

Objectives: - You need to be able to use the two equations above and the series and parallel circuit rules.

Lecture 7. Processing Development Environment (or PDE)

Digital Design through. Arduino

WEEK PRactice. Turning on LED with a Switch. Learning Objective. Materials to Prepare. Summary of Class. Project Goal. Hardware Expression

Components List No Product Name Quantity Picture 1 Uno 1 R3 Controller Board 2 USB Cable 1 3 LCD1602 Module 1 4 Breadboard 1 5 9V 1A Power Supply 1 4

Arduino Robots Robot Kit Parts List

MP6500 Stepper Motor Driver, Digital Current Control

PP-BOB2-V1.0 PARALLEL PORT BREAKOUT BOARD

TLC5947 and TLC59711 PWM LED Driver Breakouts

Polygons and Angles: Student Guide

Basic Electronic Toolkit for under $40

Pulse Sensor Getting Started Guide

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

Figure 1. The completed programming kit List of Parts

VIII.! READING ANALOG!!!!! VALUES

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

LOGIC RAIL. Grade Crossing Pro Instructions

Necessary software and hardware:

ANTUMBRA KLIK MANUAL

Experiment 1 Electrical Circuits Simulation using Multisim Electronics Workbench: An Introduction

More Arduino Programming

Arduino Part 2. Introductory Medical Device Prototyping

Figure 1. A complete Temperature Sensor

LCMM024: DRV8825 Stepper Motor Driver Carrier,

Transcription:

Analog Input Sure sure, but how to make a varying voltage? With a potentiometer. Or just pot. +5V measure gnd Color coding: red goes to power, blue to ground, purple to measure here (it s a mix, see?)

Potentiometers Moving the knob is like moving where the arrow taps the voltage on the resistor And that s actually how it works, btw, if you take apart a pot. But I might have the directions reversed (clockwise vs. anti-clockwise).

Arduino Analog Input Red to Vcc Purple to A0 Blue to Gnd Hook it up, plug in the wires in directly Vcc is alias for +5V. Raw is alias for external power (approx 9V)

Analog Input Sketch Sketch Examples/sensors_resistive/analog_read_led Change to 0 Turn knob to vary blink rate of the LED Notice no pinmode() for analog inputs

What good are pots? Anytime you need a ranged input (we re used to knobs) Measure rotational position steering wheel, etc. But more importantly for us, potentiometers are a good example of a resistive sensor

Sensing the Dark Pots are example of a voltage divider Voltage divider splits a voltage in two Same as two resistors, but you can vary them

Sensing the Dark: Photocells aka. photoresistor, light-dependent resistor A variable resistor Brighter light == lower resistance Photocells you have range approx. 0-10k schematic symbol Pretty cheap too. Can get a grab bag of 100 misc from Jameco for $20

Photocell Circuit Vcc pin A0 gnd Looks a lot like the pot circuit, doesn t it?

Photocell Arduino Sketch Can use as before, sketch analog_read_led Change to 0 Wave your hand over it = blink faster Point it towards the light = blink slower Just like magic! If circuit was configured the other way (photocell on bottom), then darkness would make it blink slower.

More Spooky, Please All this blinking is okay, but...

Booo! I design your eyes Okay, so the googly-eyeness of it makes it more Simpsonesque than spooky.

Almost as cool as Roy Batty Evil Glowing Eyes

LED Eyeballs Use your two orange LEDs Little bit of hot glue and you re set Use the two orange LEDs. Save the R,G,B LEDs for next week. Hot glue is the best thing in the world. I brought my hot glue gun if you want to do this right now

Driving Two LEDs Could use two Arduino pins. But wasteful. Instead, put two in series Doesn t work for blue LEDs (and white, and some green) Blue LEDs have a voltage drop of ~3.4V, two in series makes ~6.8V which is greater than the 5V the Arduino puts out. Don t put LEDs in parallel. http://members.misty.com/don/ledd.html Notice pin 10. That s important.

LED Eyes Notice, pin 10. This will become important later. photocell circuit is as before

LED Eyes Brightness To complement analogread(), there is analogwrite(). Only available on digital pins 9,10,11. (yes, a little confusing) More next week about how it works. Can use it to set brightness of LEDs

LED Eyes Sketch Sketch analog_brightness As it gets darker, the LEDs get less bright You just built an auto-dimmer This is cool, but still not spooky enough.

Making Eyes Glow (where glow is the throbbing of brightness) How does that glow throbbing work? Sleeping laptops do something similar Need to describe how brightness changes over time

LED Brightness Functions Brightness over time can be described as a graph 100% on brightness off time Draw your graph, use the resulting numbers Doesn t matter which numbers you choose right now

LED Brightness Functions Then turn those numbers into an array Make sure max_count is not too large! Use any pattern of numbers you like but they must range between 0-255 0 = full off 127 = half on 255 = full on

LED Brightness Functions Once you have your table......the rest is just programming 1. Get a bright_table value 2. Send it out with analogwrite() 3. Advance counter into bright_table 4. Wait a bit 5. Repeat

Glowing Eyes Sketch led_glow I can

Glowing Eyes

Going Further Glowing LEDs The last sketch is data driven So you can plug in any brightness function Make a flickering candle or a bad neon light

Going Further Photocells Think of some interesting uses What about multiple photocells? Homemade Sensors Make some of your own!