Exploring more with LED’s and Arduino

Slides:



Advertisements
Similar presentations
Resistors.  An electrical component that opposes the flow of electrons ?...!
Advertisements

MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Living with the Lab Using Your Arduino, Breadboard and Multimeter EAS 199A Fall 2011 Work in teams of two!
Intro to Programming and Microcontrollers. Activity Group into pairs and sit back-to-back. Pick one person who is going to draw. The other person will.
Or how to read those little resistors!
Understanding the Resistor Color Code
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 2 Arduino and Sensors Xmedia Spring 2011.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
ETEC 4824 Analogue Electronics Resistors and Ohms Law.
14.4 CONDUCTION, INSULATION AND PROTECTION P
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
Boe-Bot Review.
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.
Digital Multimeter (DMM) Used to measure the following: Voltage – DC and AC Current – DC and AC Resistance Capacitance Temperature – w/ extra probe Also.
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.
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.
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.
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.
Resistors Foundations of Technology Resistors © 2013 International Technology and Engineering Educators Association, STEM  Center for Teaching and Learning™
Final Term Project Hi-Tek Smoke Detektor By: Rohan Sharma.
CONDUCTION, INSULATION AND PROTECTION. CONDUCTION Energy (eg. Electrical) transfer from one material to another by direct contact. Conductors are materials.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Pulse-Width Modulation: Simulating variable DC output
ECE Group Members Samantha Starr BME Arduino Arianna Weinshel BME Sensors, Circuits Eden Woldemichael CE AM Radio Taylor Brooke EE Instrumentation,
Controlling an LED with a switch. 2 breadboard place where you can build electric circuits really quickly the magical breadboard.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Resistors Communication Systems. Reading the color stripes n Color stripes are printed at one end of the insulating body, which is usually tan. n Reading.
NOCTI Review Lesson 1 Objectives: Discuss resistor color band and determine resistor values and tolerance. Compute values using formulas for series, parallel,
Resistance. Resistor A resistor is part of an electric circuit that resists the flow of electric current. As current flows through a resistor, some of.
8.3 – RESISTANCE AND OHMS LAW. SECTION 8.3 – RESISTANCE AND OHM’S LAW Resistance – is the property of any material that slows down the flow of electrons.
Experiment #1 Measurement of Resistance
Electronics Ohm’s law & Resistance..
Or how to read those little resistors!
Breadboards and LED’s with Arduino
CU ATLAS Practical electronics Motion and Servos
Microcontroller basics
More on LED’s with Arduino
Exploring lighting effects with LED’s and Arduino
Microprocessors Tutorial 1: Arduino Basics
How to read the strength of a resistor
Cascade switching of an LED
Get Your Project Started with Arduino
RESISTANCE AND OHM’S LAW
UCD ElecSoc Robotics Club 2017/2018
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
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.
Continuing with LED’s and Arduino
Resistance Resistance Gateway To Technology
IoT Programming the Particle Photon.
RESISTOR COLOR CODE GUIDE
Arduino 101 Credit(s):
Digital Multimeter (DMM)
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
JC Technology Resistors.
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Chapter 1 Introduction of Arduino
Arduino : Introduction & Programming
Arduino Part 4 Let there be more light.
Sensors and actuators Sensors Resistive sensors
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Electronics Resistance Practice Problems R LabRat Scientific © 2018.
SECTION 8.3 – Resistance and ohm’s Law
Pulse-Width Modulation: Simulating variable DC output
Buttons.
2019 Investing Now Summer Program
Presentation transcript:

Exploring more with LED’s and Arduino A Microcontroller

Exploring a relevant topic; resistors Resistors (revision of Year 10 electronics) What do they do? Colour coded so we can read them K = kilo = 1,000 (thousand) M = mega = 1,000,000 (million) Tolerance = how accurate What happens when they ‘resist’ = energy given off as heat Think of it as approximately a pipe that restricts how much voltage can flow through a circuit

The Gold or Silver band is always set to the right, then you read from left to right. Sometimes there will be no tolerance band -- simply find the side that has a band closest to a lead and make that the first band. Tolerance Rating Red = 2% Gold = 5% Silver = 10% No band = 20% So gold band to the right, then read it: Brown, Black, Red, Gold: So the maths is first digit, second digit, third digit (if noted) with the multiplier being the number of zero’s…. 1, 0, 100, 5% tolerance = 1000 Ω (or 1K Ω)

The rules for reading resistors Orient the resistor so you can read the stripes properly. You should read the stripes from left to right. If noted, set the tolerance band (gold or silver normally) to the right. No tolerance band? - the first stripe is the one that's closest to one end of the resistor (often it is thicker). If this stripe is on the right side of the resistor, turn the resistor around so the first stripe is on the left. Look up the color of the first stripe to determine the value of the first digit. Look up the color of the second stripe to determine the value of the second digit. Look up the color of the third stripe to determine the multiplier. Multiply the two-digit value by the multiplier to determine the resistor's value.

2, 5, x1000, ± 5% = 25kΩ 4, 6, 0 x1000, ± 1% = 460kΩ 2, 7, 6, x1, ± 5% = 276Ω

Get an APP calculator! Electrodroid (Android, Windows, Blackberry phones) http://electrodroid.it/electrodroid/ iCircuit http://icircuitapp.com/

Exercise 6 - Simple Traffic light

Simple Traffic lights script //Exercise 6 - Simple Traffic light // Next lesson will add a button to this, for a pedestrian crossing type of effect // Sourced from McRoberts, Michael. 'Beginning Arduino. 2nd Ed.' int ledDelay = 10000; //delay between changes int redPin = 10; int yellowPin = 9; int greenPin = 8; void setup() { pinMode(redPin, OUTPUT); pinMode(yellowPin, OUTPUT); pinMode(greenPin, OUTPUT); } void loop() { digitalWrite(redPin, HIGH); //turn the light red on delay(ledDelay); //wait 10 seconds as per the ledDelay time digitalWrite(yellowPin, HIGH); //turn the yellow on delay(2000); //wait 2 seconds digitalWrite(greenPin, HIGH); //turn the green on digitalWrite(redPin, LOW); //turn the red off digitalWrite(yellowPin, LOW); //turn the yellow off delay(ledDelay); //delay in milliseconds digitalWrite(greenPin, LOW); //turn the green off delay(2000); //delay in milliseconds for 2 seconds

Notes on the code: Basically an expanded and more complicated Blink sketch We use ‘int’ (integers) to set names for things We then call those ‘int’ names in the code later

Exercise 7 - PWM – Pulse with Modulation Note: we are using Pin 11 It is noted with a ~ This is a PWM connector Out of Pins 8-13 which ones could we use?

PWM script //Exercise 7 using PWM (Pulse width modulation) // Sourced from McRoberts, Michael. 'Beginning Arduino. 2nd Ed.' project 7 Pulsating lamp int ledPin =11; float sinVal; int ledVal; void setup() { pinMode(ledPin, OUTPUT); } void loop() { for (int x=0; x<180; x++) { //convert degrees to radians then obtain a Sin value sinVal = (sin(x*(3.1412/180))); //note the value for Pi for converting to radians ledVal = int (sinVal*255); //note the 255 for converting to computer binary based numeracy analogWrite(ledPin, ledVal); delay(25);

Notes on the code: PWM - Pulse Width Modulation, or PWM, is a technique for getting analogue results with digital means. https://www.arduino.cc/en/Tutorial/P WM A call to analogWrite() is on a scale of 0 - 255, such that analogWrite(255) requests a 100% duty cycle (always on)

Notes on the code: Float – floating point data type (more on this 2 lessons) Sinval – Sine wave value Sin() is an inbuilt mathematical function for the Arduino Ledval – will hold the integer value to send out to the PWM pin (which pin?) We need to ‘cast’ the floating point into an integer, basically we drop the decimal places A very short delay time means it appears continuous to the human eye