Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.

Slides:



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

Lab7: Introduction to Arduino
Intermediate Electronics and Lilypad Where Electronics Meet Textiles Workshop with Lynne Bruning and Troy Robert Nachtigall Sponsored by Spark Fun and.
Servo Background Servos provide control of rotary position Servos are used extensively in the remote control hobby world for: Aircraft (flaps, ailerons,
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Embedded Sumo 1T4 – 1T5 UTRA.
temperature system wiring
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
Servo Control Using Analog Signal Obtain “analog” input using analogRead().
Circuits Series and Parallel. Series Circuits Example: A 6.00 Ω resistor and a 3.00 Ω resistor are connected in series with a 12.0 V battery. Determine.
Working with Arduino: Lesson #2: Variable, Photo, and Force Sensitive Resistors EGN1007.
Introduction.
Basic Circuits – Lab 1 Xmedia Spring Basically Power –Provides energy for the sensor and the output Sensor –Changes aspects of the circuit based.
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.
Embedded Programming and Robotics
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Basic Circuits – Lab 2 Arduino and Sensors
Image of Arduino. Arduino discussion Address issues with circuit walk-through – Electricity, Programming, Arduino Concepts Work on BeatTable (next week)
Microprocessors Tutorial 1: Arduino Basics
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Series and Parallel Circuits. Series Circuit Current must pass through all resistors.
PARALLEL CIRCUITS HAVE MORE THAN ONE POSSIBLE PATHWAY FOR ELECTRONS.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
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.
Microprocessors Tutorial 1: Arduino Basics
Microprocessors Tutorial 2: Arduino Robotics. Agenda 1. Robot Anatomy 2. Sensor Review 3. PWM 4. MAKE: Fade 5. Motors 6. H Bridge 7. Robot Control library.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Arduino Circuits and Code. int ledPin = 9; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, LOW); delay(1000); digitalWrite(ledPin,
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Basic Circuits – Lab 4 Serial and OSC (maybe some theory too) Xmedia Spring 2011.
SAMI MAKERSPACE MAKE: AN ELECTRONICS WORKSHOP. ARDUINO BASICS Credit to: Sparkfun and Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson,
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
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.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
Microcontroller basics Embedded systems for mortals.
Bdps 2 Lecture 2. Circuits and Ohm's Law For resistive circuits.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
:Blink Blink: Er. Sahil Khanna
Istituto Tecnico Industriale A.Monaco EURLAB Control a Servo Motor If you want to swing an robot arm or … steer a robot you need a special motor (Servo).
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse-Width Modulation: Simulating variable DC output
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Having fun with code, using Arduino in a middle school CS classroom
Microcontroller basics
If you want to swing an robot arm or …
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
UTA010 : Engineering Design – II
Get Your Project Started with Arduino
UCD ElecSoc Robotics Club 2017/2018
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino.
Въведение в Arduino.
Arduino - Introduction
Analog Input through POT
Roller Coaster Design Project
Introduction to Arduinos
Continuing with LED’s and Arduino
IoT Programming the Particle Photon.
Chapter 1 Introduction of Arduino
Programming 2: The Arduino IDE & First Sketches
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Uno circuit basics
Introduction to Arduinos
CTY SAR FCPS Alexander Velikanov
Presentation transcript:

Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011

Agenda Parallel vs. Series Voltage Divider Arduino Uploading code Basics Connecting to a circuit PWM Sensors Reading analog data

Lighting 3 LEDs in Parallel Each LED gets its own resistor Build this circuit Measure the voltage across each branch Measure the current out of the battery and before each LED

Current Split - Parallel Sum of the current through each branch equals the current from the power source Voltage drops are the same across each branch

Lighting 3 LEDs in Series One resistor for all the LEDs Build this circuit Measure the voltage across each LED Measure the current out of the battery and before each LED

Voltage Split - Series Voltage across each component is different Current through each component is the same

Voltage Divider V out = V in * R 2 / (R 1 + R 2 ) If R 1 is variable, as R 1 increases V out decreases

Calculating Resistance Series R total = R 1 + R R n Paralell 1/R total = 1/R 1 + 1/R 2 + … + 1/R n

Arduino

Arduino – Blinking an LED Connect LED between pin 13 and GND Connect Arduino to computer Upload Code Compile – play button Select port – dev/cu. Or COM Upload – right arrow button

Arduino – Blinking an LED // Example 01 : Blinking LED #define LED 13 // LED connected to // digital pin 13 void setup() { pinMode(LED, OUTPUT); // sets the digital // pin as output } void loop() { digitalWrite(LED, HIGH); // turns the LED on delay(1000); // waits for a second digitalWrite(LED, LOW); // turns the LED off delay(1000); // waits for a second }

Arduino – Fading an LED using PWM PWM – pulse width modulation Approximates analog behavior by turning on and off quickly analogWrite(pin, val); Connect LED between pin 9 and GND Connect Arduino to computer Write and upload code

Arduino – Fading an LED using PWM // Example 04: Fade an LED in and out like on // a sleeping Apple computer #define LED 9 // the pin for the LED int i = 0; // We’ll use this to count up and down void setup() { pinMode(LED, OUTPUT); // tell Arduino LED is an output } void loop(){ for (i = 0; i < 255; i++) { // loop from 0 to 254 (fade in) analogWrite(LED, i); // set the LED brightness delay(10); // Wait 10ms because analogWrite // is instantaneous and we would // not see any change } for (i = 255; i > 0; i--) { // loop from 255 to 1 (fade out) analogWrite(LED, i); // set the LED brightness delay(10); // Wait 10ms }

Arduino – Reading Analog Sensor Data analogRead(pin); Serial.println(val); - debugging for now Build Circuit, connect Arduino, upload code Serial monitor – to view debug values

Arduino – Reading Analog Sensor Data // Example 06B: Set the brightness of LED to // a brightness specified by the // value of the analogue input #define LED 9 // the pin for the LED int val = 0; // variable used to store the value // coming from the sensor void setup() { pinMode(LED, OUTPUT); // LED is as an OUTPUT // Note: Analogue pins are // automatically set as inputs } void loop() { val = analogRead(0); // read the value from // the sensor Serial.println(val); analogWrite(LED, val/4); // turn the LED on at // the brightness set // by the sensor delay(10); // stop the program for // some time }