Introduction to the Arduino

Slides:



Advertisements
Similar presentations
Why won’t my Arduino work???? living with the lab © 2012 David Hall.
Advertisements

temperature system wiring
Using the servo library living with the lab Libraries are computer programs written to add functionality to Arduino programs. A library to control hobby.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Waterproofing a thermistor ENGR 121 living with the lab © 2013 David Hall.
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
User-defined functions in Arduino sketches living with the lab © 2012 David Hall.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Assembly of conductivity flow loop living with the lab (in preparation for calibrating conductivity sensor)
Switches & whiskers on the Arduino living with the lab lever arm switches mounted to Arduino © 2012 David Hall.
Using fixed-cell references and built-in functions in Excel living with the lab © 2012 David Hall.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Introduction to Microsoft Excel living with the lab © 2012 David Hall.
Using for loops to control LEDs living with the lab 1 1 arduino.cc the for statement allows us to repeat a block of commands a limited number of times.
Building Circuits.
Pump Fabrication Day Group A will draw their pump
Controlling Servos with the Arduino
Connecting Switches.
Series and Parallel Resistors
Pump Project Requirements
Pump Efficiency Fluid Energy Out + - Electrical Energy In.
Why Won’t My Arduino Work?
Troubleshooting Your Multimeter
Using servos.
Servo Library and Functions
Line Following Tips photoresistor circuits
What’s in your kit?.
Robot Assembly.
How to Use Dial Calipers
Controlling a Motor with Cascading Switches
Introduction to Transistors
Introduction to the Fishtank
RGB LEDs.
Conservation of Mass Problem
Maxbotix Ultrasonic Distance Sensor
Conductivity Sensor.
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Introduction to Transistors
Servo Library and Functions
Troubleshooting Your Multimeter
a few of my favorite sensors
Relays.
using for loops to control LEDs
using the Arduino to make LEDs flash
Acquiring Data from an ADXL335 Accelerometer
Using Photoresistors with an Arduino
Introduction to Mathcad
Line Following Tips photoresistor circuit
Torque and RPM of Gears
Conservation of Mass Problem
Data Types.
analog and digital measurements
Finishing your Project
Using “if” statements.
Controlling the Heater
Design Project Forecast
Digital Input from Switches
Implementing Switches Using Interrupts
Arduino: For Loops.
Non-Concurrent Force Systems
IR Object Detection IR detector IR LED IR light reflected off object
Interfacing a Rotary Encoder with an Arduino
Conservation of Mass Problem
Non-Concurrent Force Systems
Evaluating Design Alternatives
Counting Servo Gear Teeth (FS90R Servos)
Static Equilibrium Problem
Reservoir Loop.
Freshman Design Expo Presentations
Gearmotor Efficiency W table top gearmotor pulley string.
Presentation transcript:

Introduction to the Arduino

DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended for students attending Louisiana Tech University only. The authors of this information do not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in damage and injury. Louisiana Tech University, its officers, employees, agents and volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. The Living with the Lab logos should remain attached to each slide, and the work should be attributed to Louisiana Tech University. If you do not agree, then please do not view this content. boosting application-focused learning through student ownership of learning platforms

What is an Arduino? Arduinos contain microcontrollers that are programmed to read inputs and perform various tasks. What is a microcontroller? A microcontroller is a small computer. Microcontrollers contain processor cores with memory and are able to be programed for input/output.

Arduino 14 Digital Input/Output Pins USB Cable Plug Integrated Circuit “Brains” of the Arduino External Power Supply Jack Power Pins 6 Analog Input Pins

If the Arduino is a computer, why do I need my computer to work with it? You use your computer to write a program, called a sketch. You upload the sketch to the Arduino. The sketch is processed (or run) on your Arduino, not your computer. Send to Arduino

Arduino IDE (Integrated Development Environment) Contains the components to help you successfully write a sketch. Open New Sketch Upload Save Serial Monitor Menus Tab Control Verify Toolbar Text Editor Serial Monitor (prints out information from the Arduino) Message Area

How is the code structured? Open the example sketch: Blink (File  Examples  Basics  Blink) Header Section – contains information/comments on preceding sketch. It can sometimes contain code. Loop Function – Repeated indefinitely. This section contains code that tells the Arduino what to do. Setup Function – executed only once at the start. Initialize variables, pin modes, and start using libraries in this section.

How does the code work? Note: HIGH = 5V LOW = 0V (Always) voltage (V) time (ms) voltage (V) 0V 5V 1000 ms

Lighting an LED Build the circuit on your breadboard. Use the 5V and ground on your Arduino. 5V 220Ω + - 220Ω 5V same

Make LED blink repeatedly blink every half second. Rebuild the circuit to be powered by pin 8. Open the Arduino IDE. Load the blink sketch (File  Examples  Basics  Blink) Pin number is arbitrary as long as the physical pin matches the pin number written in your sketch. We will adapt this program to control the LED circuit on your breadboard. Pin 8 220Ω 220Ω same V of Pin 8

What needs to change? 8 8 8 500 8 500

Play around with Arduino. Some ideas: Change the time to 1.5 seconds on and 1 second off. Change the circuitry to be connected to digital pin 5 and adjust the program accordingly. Blink out SOS in Morse code (dot-dot-dot-dash-dash-dash-dot-dot-dot) three short pulses (0.25 seconds each) followed by . . . three long pulses (0.75 second each) followed by . . . a brief pause (1 second) repeat a through d using an infinite loop