Zero To Prototyping In A Flash! - SparkFun Electronics

2y ago
81 Views
2 Downloads
4.99 MB
93 Pages
Last View : 17d ago
Last Download : 2m ago
Upload by : Ophelia Arruda
Transcription

Intro to ArduinoZero to Prototypingin a Flash!Material designed by Linz Craig, Nick Poole, Prashanta Aryal,Theo Simpson, Tai Johnson, and Eli Santistevan

Overview of ClassGetting Started:Installation, Applications and MaterialsElectrical:Components, Ohm's Law, Input and Output, Analog and it into groups depending on experienceSerial Communication Basics:Troubleshooting and DebuggingVirtual Prototyping:Schematics and PCB Layout in FritzingThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Arduino Board“Strong Friend” Created in Ivrea, Italyin 2005 by Massimo Banzi & David CuartiellesOpen Source HardwareProcessorCoding is accessible & transferrable (C , Processing, java)This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Arduino is the go-to gear for artists, hobbyists,students, and anyone with a gadgetrydream.rose out of another formidable challenge:how to teach students to createelectronics, he-making-of-arduinoThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Getting Started SW Installation: Arduino (v.1.0 )FritzingSIK Guide CodeDrivers (FTDI) Materials:SIK GuideAnalog I/O, Digital I/O, Serial,& Fritzing handoutsArduino CheatSheetThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

PWR INUSB(to Computer)RESETSCL\SDA(I2C Bus)POWER5V / 3.3V / GNDDigital I\OPWM(3, 5, 6, 9, 10, 11)AnalogINPUTSThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

PWR INUSB(to Computer)RESETSCL\SDA(I2C Bus)POWER5V / 3.3V / GNDDigital I\OPWM(3, 5, 6, 9, 10, 11)AnalogINPUTSThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Go ahead and plug your board in!This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Arduino ShieldsPCBBuilt ShieldInserted ShieldThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Arduino ShieldsMicro SDMP3 TriggerThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.LCD

SIK ComponentsTypeFunctionNotesPush ButtonDigital InputSwitch - Closesor opens circuitPolarized, needsresistorTrimpotentiometerPhotoresistorAnalog InputVariable resistorAlso called aTrimpot.Analog InputLight DependentResistor (LDR)Resistance varieswith light.RelayDigital OutputSwitch driven bya small signalUsed to controllarger voltagesTemp SensorAnalog InputTemp DependentResistorFlex SensorAnalog InputVariable resistorSoft TrimpotAnalog InputVariable resistorCareful of shortsRGB LEDDig & AnalogOutput16,777,216different colorsOoh. So pretty.NameImageThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

SIK ComponentsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

SIK ComponentsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

SIK ComponentsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Electricity \ Electronics Basic ConceptReview Ohms LawVoltageCurrentResistanceUsing a Multi-meterThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Ohm’s LawThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Electrical PropertiesVoltageVCurrentI Defined asthe amountof potentialenergy in acircuit.ResistanceR The rate ofcharge flowin a circuit. Units: Amperes(A) Units: Volts (V)This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Current Flow AnalogyHigh CurrentLow CurrentThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Voltage AnalogyWaterTowerVWaterTowerVMore Energy Higher VoltageLess Energy Lower VoltageThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Resistance AnalogyWaterTowerWaterTowerVBig Pipe Lower ResistanceSmall Pipe Higher ResistanceThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Continuity – Is it a Circuit?The word “circuit” is derived from the circle. AnElectrical Circuit must have a continuous LOOP fromPower (Vcc) to Ground (GND).Continuity is important to make portions of circuits areconnect. Continuity is the simplest and possibly themost important setting on your multi-meter.Sometimes we call this “ringing out” a circuit.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Measuring Electricity – VoltageVoltage is a measure of potential electricalenergy. A voltage is also called a potentialdifference – it is measured between twopoints in a circuit – across a device.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Measuring Electricity -- CurrentCurrent is the measure of the rate of charge flow. ForElectrical Engineers – we consider this to be themovement of electrons.In order to measure this – you must break the circuit orinsert the meter in-line (series).This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Measuring Electricity -- ResistanceResistance is the measure of how much opposition tocurrent flow is in a circuit.Components should be removed entirely from the circuitto measure resistance. Note the settings on the multimeter. Make sure that you are set for the appropriaterange.ResistancesettingsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Prototyping CircuitsSolderless BreadboardOne of the most useful tools in an engineer orMaker’s toolkit. The three most importantthings: A breadboard is easier than soldering A lot of those little holes are connected, which ones? Sometimes breadboards breakThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

What’s a Breadboard?This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Solderless BreadboardEach row (horiz.) of 5holes are connected.Vertical columns –called power bus areconnected verticallyThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Using the Breadboard to built a simplecircuitUse the breadboard towire up a single LEDwith a 330 OhmResistor (OrangeOrange-Brown).Note: the longer leg on theLED is the positive leg andthe shorter leg is thenegativeThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Fritzing View of Breadboard CircuitWhat happenswhen you breakthe circuit?What if youwanted to addmore than oneLED?This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Adding control – let’s use the Arduinoand start programming!!!This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Concepts: INPUT vs. OUTPUTReferenced from the perspective of the microcontroller (electrical board).Inputs is a signal / informationOutput is any signal exiting thegoing into the board.board.Almost all systems that use physical computing will havesome form of outputWhat are some examples of Outputs?This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Concepts: INPUT vs. OUTPUTReferenced from the perspective of the microcontroller (electrical board).Inputs is a signal / informationOutput is any signal exiting thegoing into the board.board.Examples: Buttons Switches,Light Sensors, Flex Sensors,Humidity Sensors, TemperatureSensors Examples: LEDs, DC motor,servo motor, a piezo buzzer,relay, an RGB LEDThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Concepts: Analog vs. DigitalMicrocontrollers are digital devices – ON or OFF.Also called – discrete.analog signals are anything that can be a fullrange of values. What are some examples? Moreon this later 5V5V0V0VThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Open up ArduinoHints:For PC Users For Mac Users 1.Let the installer copyand move the files to theappropriate locations, or1. Move the Arduinoexecutable to the dockfor ease of access.2.Create a folder underC:\Program Files (x86)called Arduino. Move theentire Arduino programfolder here.2. Resist the temptationto run these from yourdesktop.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

ArduinoIntegrated Development Environment (IDE)Two required functions /methods / routines:void setup(){// runs once}error & status messagesvoid loop(){// repeats}

Settings: Tools Serial PortYour computercommunicates to the Arduinomicrocontroller via a serialport through a USB-Serialadapter.Check to make sure that thedrivers are properly installed.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Settings: Tools BoardNext, double-check that the proper board is selected under theTools Board menu.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Arduino & Arduino Compatible BoardsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

BIG 6 () statements / BooleananalogRead()Serial communicationThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Let’s get to coding Project #1 – Blink“Hello World” of Physical ComputingPsuedo-code – how should this work?TurnLED ONWaitTurnLEDOFFWaitThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.Rinse &Repeat

Comments, Comments, CommentsComments are for you – the programmer and yourfriends or anyone else human that might read yourcode.// this is for single line comments// it’s good to put a description at thetop and before anything ‘tricky’/* this is for multi-line commentsLike this And this .*/This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

commentsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Three commands to know pinMode(pin, INPUT/OUTPUT);ex: pinMode(13, OUTPUT);digitalWrite(pin, HIGH/LOW);ex: digitalWrite(13, HIGH);delay(time ms);ex: delay(2500); // delay of 2.5 sec.// NOTE: - commands are CASE-sensitiveThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project #1: Wiring DiagramMove the greenwire from thepower bus to pin13 (or any otherDigital I/O pin onthe Arduino board.Image created in FritzingThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

A few simple challengesLet’s make LED#13 blink!Challenge 1a – blink with a 200 ms secondinterval.Challenge 1b – blink to mimic a heartbeatChallenge 1c – find the fastest blink that thehuman eye can still detect 1 ms delay? 2 ms delay? 3 ms delay?This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Try adding other LEDsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Programming Concepts: VariablesVariable ScopeGlobal---Function-levelThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Programming Concepts: Variable TypesVariable Types:8 bitsbytechar16 bitsintunsigned int32 bitslongunsigned longfloatThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Fading in and Fading Out(Analog or Digital?)A few pins on the Arduino allow for us tomodify the output to mimic an analogsignal.This is done by a technique called:Pulse Width Modulation (PWM)This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Concepts: Analog vs. DigitalTo create an analog signal, the microcontrolleruses a technique called PWM. By varying the dutycycle, we can mimic an “average” analog voltage.Pulse Width Modulation (PWM)This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project #2 – FadingIntroducing a new command analogWrite(pin, val);pin – refers to the OUTPUT pin(limited to pins 3, 5, 6, 9, 10, 11.)– denoted by a symbolval – 8 bit value (0 – 255).0 0V 255 5VThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Move one of your LED pins over to Pin 9In Arduino, open up:File Examples 01.Basics FadeThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Fade - Code ReviewThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Fade - Code ReviewThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project# 2 -- FadingChallenge 2a – Change the rate of thefading in and out. There are at least twodifferent ways to do this – can you figurethem out?Challenge 2b – Use 2 (or more) LEDs – sothat one fades in as the other one fadesout.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

R G BColor MixingTri-color LEDIn the SIK, this is a standard –Common Cathode LEDThis means the negative side ofthe LED is all tied to Ground.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project 3 – RGB LEDNote: The longestleg of the RGBLED is theCommonCathode. Thisgoes to GND.Use pins 5, 6, & 9This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

How many unique colors can you create?Use Colorpicker.com orexperiment on yourown.Pick out a few colors thatyou want to try recreating for a lamp orlighting display.Play around with this withthe analogWrite()command.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

RGB LED Color Mixingint redPin 5;int greenPin 6;int bluePin 9;void setup(){pinMode(redPin, OUTPUT);pinMode(greenPin, OUTPUT);pinMode(bluePin, OUTPUT);}This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

RGB LED Color Mixingvoid loop(){analogWrite(redPin, 255);analogWrite (greenPin, 255);analogWrite (bluePin, 255);}This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project: Mood Lamp / Light SculptureThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

NapkinSchematicsEmphasize theengineering designprocess withstudents. We like toskirt the linebetween formal andinformal with a toolcalled NapkinSchematics.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

NapkinSchematicsEmphasize theengineering designprocess withstudents. We like toskirt the linebetween formal andinformal with a toolcalled NapkinSchematics.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Driving Motors or other High CurrentLoadsNPN Transistor (Common Emitter “Amplifier” Circuit)to DigitalPin 9This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

InputInput is any signal entering an electrical system . Both digital and analog sensors are forms of input Input can also take many other forms: Keyboards, amouse, infrared sensors, biometric sensors, or justplain voltage from a circuitThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Project #4 – Digital InputIn Arduino, open up:File Examples 02.Digital ButtonThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Digital Sensors (a.k.a. Switches)Pull-up Resistor (circuit)to Digital Pin 2This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Digital Sensors (a.k.a. Switches)Add an indicator LED to Pin 13This is just like our1st circuit!This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Digital Input Connect digital input to your Arduino using Pins # 0 – 13(Although pins # 0 & 1 are also used for programming) Digital Input needs a pinMode command:pinMode (pinNumber, INPUT);Make sure to use ALL CAPS for INPUT To get a digital reading:int buttonState digitalRead (pinNumber); Digital Input values are only HIGH (On) or LOW (Off)This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Digital Sensors Digital sensors are more straight forward than Analog No matter what the sensor there are only twosettings: On and Off Signal is always either HIGH (On) or LOW (Off) Voltage signal for HIGH will be a little less than 5V onyour Uno Voltage signal for LOW will be 0V on most systemsThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

igitalread-andThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Programming: Conditional Statementsif()This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Programming: Conditional Statementsif()void loop(){int buttonState digitalRead(5);if(buttonState LOW){// do something}else{// do something else}}This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.DIGINPUT

Boolean Operators(((((( Boolean Description))))))is equal?is not equal?greater thangreater than or equalless thanless than or equal ! (((((())))))This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Trimpot (Potentiometer)Variable ResistorfixedendwiperfixedendThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Analog Sensors3 Pin Potentiometer var. resistor (circuit)a.k.a. Voltage Divider Circuitwiperfixedends1.0 V1.0 VThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Ohms Law (just the basics)Actually, this is the “voltage divider”This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

analogRead()Arduino uses a 10-bit A/D Converter: this means that you get input values from0 to 1023 0V 05 V 1023Ex:int sensorValue analogRead(A0);This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Using Serial CommunicationMethod used to transfer data between two devices.Data passes between the computer and Arduinothrough the USB cable. Data is transmitted as zeros(‘0’) and ones (‘1’) sequentially.Arduino dedicates Digital I/O pin # 0 toreceiving and Digital I/O pin #1 to transmit.This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Serial Monitor & analogRead()Initializes the SerialCommunication9600 baud data rateprints data to serial busThis work is licensed under

Open up Arduino Hints: For PC Users 1.Let the installer copy and move the files to the appropriate locations, or 2.Create a folder under C:\Program Files (x86) called Arduino. Move the entire Arduino program folder here. For Mac Users 1. Move the Arduino executable

Related Documents:

Rapid Prototyping 101 1 Rapid Prototyping 101 Master Basic Prototyping Concepts. 3330 N. State Road North Vernon N 4265 Telephone: (812) 346-5188 Fax: (812) 346-35 mail:fiwesalesdecaturmold.com Rapid Prototyping 101 1 CLASS 105 MOLD: Prototypes Cycles: Not exceeding 500

Thank you for your interest in the CY8CKIT-147 PSoC 4100PS Prototyping Kit. The PSoC 4100PS prototyping kit is designed as an easy-to-use and inexpensive prototyping platform. The PSoC4100PS Prototyping Kit supports the PSoC 4100PS device family, delivering a complete system solution for a wide range of embedded applications at a very low cost.

2017 ZERO S / SR / DS / DSR 2017 ZERO S ZERO SR ZERO DS ZERO DSR TORCYCLES.COM YCLES.COM 88-08708.06 OWNER’S MANUAL OWNER’S MANUAL Zero Owner's Manual (S and

list dimensions of prototyping fidelity and explain how these dimensions may vary explain how these dimensions might differ in low to med to high fidelity prototypes, and give examples of when/why you may use each type make strategic choices about prototyping tools given you

science fiction prototyping on Friday, January 22. He will then return for a working session during the quiz sections on Thursday, February 18. The guest lecture will describe the ideas behind science fiction prototyping in more depth. The essence of science fiction prototyping is the following: (1) identify a proposed new technology or

Rapid Prototyping Technology 3-D printing is a subset of rapid prototyping that is affordable, quick, size constrained, and safe to use in an office environment. As compared with rapid prototyping machines that can cost as much as 500,000, a 3 -D printer can be attained for about 50,000. Typical part build times for

ZERO S ZERO SR ZERO DS ZERO DSR ZERO S / SR / DS / DSR TORCYCLES.COM 2016 2016 YCLES.COM 88-08461.04 OWNER’S MANUAL OWNER’S MANUAL Zero Owner's Manual (S and DS).book Page 1 Thursday, March 15, 2018 4:13 PM

work/products (Beading, Candles, Carving, Food Products, Soap, Weaving, etc.) ⃝I understand that if my work contains Indigenous visual representation that it is a reflection of the Indigenous culture of my native region. ⃝To the best of my knowledge, my work/products fall within Craft Council standards and expectations with respect to