Arduino UMBC IEEE Sekar Kulandaivel

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 8 Pulse Width Modulation (PWM)
Advertisements

ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Lecture 1 – Arduino Basics
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
© red ©
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Introduction.
Understanding the Resistor Color Code
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Arduino John Marcoux Christopher Lesch Thomas Dodge Unless otherwise noted, all information and pictures came from:
Instrumental Analysis Electrical Components and Circuits.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Pulse Width Modulation (PWM). 100% Pulse Width Modulation (PWM) 0% On the chipKIT there are 490 periods per second. Use analogWrite(pin, value) to control.
Resistance How to read the strength of a resistor.
Resistor Colour Code Why the Colour Code? The Colour code was developed to overcome two basic problems; Difficult to print and see numbers on a.
Daily Sprint START 1. If a computer uses 3A of current and is supplied with 120V of voltage, then what is the total resistance of the computer? 2. A circuit.
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
ME 120: User-defined functions: average analog input reading Arduino Programming – Part 5: User-defined functions ME 120 Mechanical and Materials Engineering.
Pulse-Width Modulation: Simulating variable DC output
Pulse Width Modulation Instructor Dr Matthew Khi Yi Kyaw.
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Hacking on Arduino George Patterson
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Microcontrollers & Electronics Basics OR…
Having fun with code, using Arduino in a middle school CS classroom
Experiment #1 Measurement of Resistance
Get Your Project Started with Arduino
Application of Programming: Scratch & Arduino
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
CU ATLAS Practical electronics Motion and Servos
Microcontroller basics
Wireless Cue Light Project
How to read the strength of a resistor
Exploring more with LED’s and Arduino
European Robotic LABoratory
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
Control a motors angular position with a flex sensor
Resistors (466) Chapter 14.
Analog Input through POT
Introduction to Arduinos
Topics: Analog/Digital Read Relay control 7 segment control Buzzer
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.
What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.
IoT Programming the Particle Photon.
RESISTOR COLOR CODE GUIDE
Arduino Week 2 Lab ECE 1020 Prof. Ahmadi.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
What Color is it?.
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino at UMBC Sekar Kulandaivel Week 4: LCD & Serial
Electronics Resistance Practice Problems R LabRat Scientific © 2018.
Introduction to Arduinos
Arduino UMBC IEEE Sekar Kulandaivel
Arduino程式範例.
Arduino UMBC IEEE Sekar Kulandaivel Week 3: Motor Control w/ H-Bridges
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Arduino Microcontroller Workshop UMBC Institute of Electrical and Electronics Engineers Arduino UMBC IEEE Sekar Kulandaivel sekark1@umbc.edu Week 2: Arduino Programming with Piezo Technical Skills Series Presentation April 8th – 9th, 2014

Topics to Cover Arduino Coding Basics & Functions Analog & Digital Signals Piezoelectric Sensors Pulse Width Modulation

Color 1st Digit 2nd Digit Multiplier 4th band is Tolerance. L R Color 1st Digit 2nd Digit Multiplier Black 100 Brown 1 101 Red 2 102 Orange 3 103 Yellow 4 104 Green 5 105 Blue 6 106 Violet 7 107 Gray 8 108 White 9 109

330Ω 3 x 101 = 10kΩ 1 x 103 = 2kΩ 2 x 102 = 1MΩ 1 x 105 =

Made with Fritzing.org

Important Functions int val, time; void setup() { … } void loop() { … } Serial.begin(9600); Serial.print(“Hello”); Serial.println(“Hi”); delay(1000); pinMode(8, INPUT); pinMode(9, OUTPUT); val = digitalRead(8); digitalWrite(9, out); val = analogRead(A0); analogWrite(9, out); time = millis(); map(var, testLow, testHigh, mapLow, mapHigh); tone(8, pitch, time);

const int sensorPin = 8; int sensorValue; void setup() { Serial const int sensorPin = 8; int sensorValue; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); } void loop() { sensorValue = digitalRead(sensorPin); Serial.println(sensorValue); delay(25);

const int sensorPin = 8; const int outputPin = 9; int sensorValue; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); pinMode(outputPin, OUTPUT); } void loop() { sensorValue = digitalRead(sensorPin); Serial.println(sensorValue); if (sensorValue == HIGH) { digitalWrite(outputPin, HIGH); delay(500); digitalWrite(outputPin, LOW); delay(25);

const int sensorPin = A0; const int outputPin = 9; int sensorValue; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); pinMode(outputPin, OUTPUT); } void loop() { sensorValue = analogRead(sensorPin); Serial.println(sensorValue); analogWrite(outputPin, sensorValue); delay(25);

const int sensorPin = A1; const int outputPin = 9; int sensorValue; int low = 300; int high = 450; int range[2] = {0, 255}; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); pinMode(outputPin, OUTPUT); } void loop() { sensorValue = analogRead(sensorPin); Serial.println(sensorValue); sensorValue = map(sensorValue, low, high, range[0], range[1]); analogWrite(outputPin, sensorValue); delay(25);

const int sensorPin = A1; const int outputPin = 11; int wait = 25; int sensorValue, pitch; int range[2] = {1023, 0}; int minTone = 500; int maxTone = 1500; void setup() { Serial.begin(9600); pinMode(sensorPin, INPUT); pinMode(outputPin, OUTPUT); while (millis() < 3000) { sensorValue = analogRead(sensorPin); if (sensorValue < range[0]) { range[0] = sensorValue; } if (sensorValue > range[1]) { range[1] = sensorValue; }

void loop() { sensorValue = analogRead(sensorPin); Serial void loop() { sensorValue = analogRead(sensorPin); Serial.println(sensorValue); pitch = map(sensorValue, range[0], range[1], minTone, maxTone); tone(outputPin, pitch, wait); delay(wait); }

Challenge Requirements: Sense a knock using the piezoelectric sensor. Flash LED once for a soft knock. Flash LED twice for a loud knock. Analog Notes: Remove photoresistor and potentiometer circuits from your board. Knock on the breadboard or tap the piezo for the best results. Utilize previous code as a guide for your project.