BASIC ARDUINO WORKSHOP. Mr. Aldwin and Mr. Bernardo

Similar documents
TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

Arduino Programming. Arduino UNO & Innoesys Educational Shield

ARDUINO. By Kiran Tiwari BCT 2072 CoTS.

More Arduino Programming

Arduino Part 2. Introductory Medical Device Prototyping

USER MANUAL ARDUINO I/O EXPANSION SHIELD

FUNCTIONS For controlling the Arduino board and performing computations.

Arduino - DigitalReadSerial

Arduino Programming and Interfacing

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Arduino Prof. Dr. Magdy M. Abdelhameed

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

analogwrite(); The analogwrite function writes an analog value (PWM wave) to a PWM-enabled pin.

keyestudio Keyestudio MEGA 2560 R3 Board

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

How to Use an Arduino

Robotics/Electronics Review for the Final Exam

Intro to Arduino. Zero to Prototyping in a Flash! Material designed by Linz Craig and Brian Huang

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Arduino and Matlab for prototyping and manufacturing

Introduction to Microcontrollers Using Arduino. PhilRobotics

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Clark College Electrical Engineering & Computer Science

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

Laboratory 1 Introduction to the Arduino boards

Introduction to Arduino

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

Workshop on Microcontroller Based Project Development

Introduction to Arduino. Wilson Wingston Sharon

Electronic Brick Starter Kit

IME-100 Interdisciplinary Design and Manufacturing

IDUINO for maker s life. User Manual. For IDUINO Mega2560 Board(ST1026)

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

Arduino Uno Microcontroller Overview

Clark College. Electrical Engineering & Computer Science. slide # 1

Electronic Projects for Artists II: Programming for Interactivity with Microcontrollers

Introduction to Arduino Diagrams & Code Brown County Library

ARDUINO MINI 05 Code: A000087

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2

Introduction to Arduino Diagrams & Code Brown County Library

Procedure: Determine the polarity of the LED. Use the following image to help:

FUNCTIONS USED IN CODING pinmode()

IME-100 ECE. Lab 4. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Microcontrollers for Ham Radio

User manual. For Keenlon Rarduino.

Introduction to Arduino

ARDUINO LEONARDO WITH HEADERS Code: A000057

ARDUINO LEONARDO ETH Code: A000022

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

IDUINO for maker s life. User Manual. For IDUINO development Board.

EXPERIMENT 7 Please visit to learn all features of arduino before you start the experiments

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

ARDUINO UNO REV3 Code: A000066

IoT Event Box Assembly Manual

What s inside the kit

Schedule. Sanford Bernhardt, Sangster, Kumfer, Michalaka. 3:10-5:00 Workshop: Build a speedometer 5:15-7:30 Dinner and Symposium: Group 2

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Arduino ADK Rev.3 Board A000069

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

ARDUINO M0 PRO Code: A000111

Goal: We want to build an autonomous vehicle (robot)

ARDUINO INDUSTRIAL 1 01 Code: A000126

Arduino Programming Part 4: Flow Control

ARDUINO YÚN MINI Code: A000108

Getting to know the Arduino IDE

PROGRAMMING ARDUINO COURSE ON ADVANCED INTERACTION TECHNIQUES. Luís Carriço FCUL 2012/13

ARDUINO YÚN Code: A000008

EP486 Microcontroller Applications

Monitor your home remotely using the Arduino

Lab 2 - Powering the Fubarino, Intro to Serial, Functions and Variables

Digital Pins and Constants

ARDUINO MEGA ADK REV3 Code: A000069

ARDUINO MEGA 2560 REV3 Code: A000067

Blinking an LED 1 PARTS: Circuit 2 LED. Wire. 330Ω Resistor

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

Arduino. part A. slides rel. 4.3 free documentation. Renato Conte Arduino - 1 /82 -

ARDUINO UNO REV3 SMD Code: A The board everybody gets started with, based on the ATmega328 (SMD).

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

Arduino Uno R3 INTRODUCTION

Arduino For Amateur Radio

FIRE SENSOR ROBOT USING ATMEGA8L

Sten-SLATE ESP. WiFi

Alessandra de Vitis. Arduino

Sten-SLATE ESP Kit. Description and Programming

GOOD MORNING SUNSHINE

Arduino Workshop. Overview. What is an Arduino? Why Arduino? Setting up your Arduino Environment. Get an Arduino based board and usb cable

Introduction To Arduino

Introduction to Arduino Programming. Sistemi Real-Time Prof. Davide Brugali Università degli Studi di Bergamo

ArdOS The Arduino Operating System Quick Start Guide and Examples

CARTOOINO Projects Book

Learn Arduino with the Arno. Learn Electronics, Learn Programming, Learn Arduino!

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

ARDUINO MICRO WITHOUT HEADERS Code: A000093

TANGIBLE MEDIA & PHYSICAL COMPUTING MORE ARDUINO

Lab 2.2 Ohm s Law and Introduction to Arduinos

INDUSTRIAL TRAINING:6 MONTHS PROGRAM TEVATRON TECHNOLOGIES PVT LTD

Prototyping & Engineering Electronics Kits Basic Kit Guide

Transcription:

BASIC ARDUINO WORKSHOP Mr. Aldwin and Mr. Bernardo 1

BASIC ARDUINO WORKSHOP Course Goals Introduce Arduino Hardware and Understand Input Software and Output Create simple project 2

Arduino Open-source electronics platform based on easy-to-use hardware and software. Reads inputs like sensor, button, text Create action as output by activating a motor, turning on an light, sending messages. 3

Founders of Arduino Originally started as a research project by Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca Martino, and David Mellis at the Interaction Design Institute of Ivrea Casey Reas and Ben Fry as well as a thesis project by Hernando Barragan about the Wiring board. 4

Sample projects 5

Software www.arduino.cc 6

Installation https://www.arduino.cc/en/main/software 7

PORT www.arduino.cc 8

BUILT-IN EXAMPLES www.arduino.cc 9

Serial Monitor Serial Monitor www.arduino.cc 10

BASIC STRUCTURE 11

Basic Structure 1 2 3 4 5 6 7 void setup(){ void loop(){ 12

Hardware Reset DIGITAL PINS 0-13 PWM PINS ~ USB ANALOG PIN A0-A5 16MHZ Crystal POWER PINS ATMEGA 328 9V www.arduino.cc 13

pinmode void setup(){ USB pinmode(13, OUTPUT); pinmode(7, INPUT); 9V ATMEL 328 www.arduino.cc 14

Software Digital output Digital input Analog output Analog input 0 HIGH or LOW 0 or 5V HIGH/LOW 0 or 5V 5 Volts PWM 0 to 5V 0 1 2 3 4 5 https://www.arduino.cc 15

Software Digital output Digital input HIGH or LOW 0 or 5V HIGH/LOW 0 or 5V digitalwrite(13,high); digitalwrite(13,low); digitalread(12); Analog output Analog input PWM 5 Volts analogwrite(11); 0 0 to 5V analogread(a1); 0 1 2 3 4 5 https://www.arduino.cc 16

DIGITAL OUTPUT digitalwrite() 17

Digital OUTPUT 1 2 3 4 5 6 7 8 9 void setup(){ pinmode(13, OUTPUT); void loop(){ digitalwrite(13,high); delay(1000); digitalwrite(13,low); delay(1000); Resistor 330 ohms 18

Digital OUTPUT-Motor test 1 2 3 4 5 6 7 8 9 void setup(){ pinmode(13, OUTPUT); void loop(){ digitalwrite(13,high); delay(1000); digitalwrite(13,low); delay(1000); Recommended to use motor driver(l293d). This testing is for small 5volts motor only 19

Sign in www.tinkercad 20

Login thru www.tinkercad.com 21

Activity 1 -OUTPUT 1. Login thru 2. www.tinkercad.com 2. Select Circuits Start the project 22

Activity 1 TRAFFIC LIGHT 1. Red for 5 seconds 2. Red blink for 1 second 3. Yellow for 2 seconds 4. Yellow blink for 1 second 5. Green for 5 seconds 6. Green blink for 1 second 7. Yellow for 5 seconds 8. Yellow blink for 1 second 9. Loop 23

DIGITAL INPUT digitalread() 24

1 2 3 4 5 6 7 8 9 void setup(){ Serial.begin(9600); pinmode(2, INPUT); void loop(){ int buttonstate = digitalread(2); Serial.println(buttonState); delay(1000); PULL UP 25

1 2 3 4 5 6 7 8 9 void setup(){ Serial.begin(9600); pinmode(2, INPUT); void loop(){ int buttonstate = digitalread(2); Serial.println(buttonState); delay(1000); PULL DOWN 26

BUILT-IN PULLUP 1 2 3 4 5 6 7 8 9 void setup(){ Serial.begin(9600); pinmode(2, INPUT_PULLUP); void loop(){ int buttonstate = digitalread(2); Serial.println(buttonState); delay(1000); 27

Digital Input, Output, Serial 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 void setup(){ Serial.begin(9600); pinmode(13, OUTPUT); pinmode(2, INPUT); void loop(){ int buttonstate = digitalread(2); Serial.println(buttonState); if (buttonstate == HIGH) { digitalwrite(13,high); if (buttonstate == LOW) { delay(1000); digitalwrite(13,low); delay(1000); 28

digitalread / pull-down 1 2 3 4 5 6 7 8 9 10 11 12 13 void setup(){ pinmode(13, OUTPUT); pinmode(2, INPUT); void loop(){ int buttonstate = digitalread(2); if (buttonstate == HIGH) { digitalwrite(13,high); else { delay(1000); digitalwrite(13,low); delay(1000); 29

Activity 2 -INPUT 1. Press the button to turn on the red LED on pin 13 2. Release the button to turn on the green LED on pin 7 30

ANALOG INPUT/OUTPUT(PWM) analogread() analogwrite() 31

Analog Input, Output, Serial 1 void setup(){ 2 Serial.begin(9600); 3 pinmode(11, OUTPUT); 4 pinmode(a0, INPUT); 5 6 void loop(){ 7 int input1= analogread(a0); 8 Serial.println(input1); 9 analogwrite(11,input1/4); 10 LED Dimmer 32

Analog Input, Output, Serial 1 void setup(){ 2 Serial.begin(9600); 3 pinmode(11, OUTPUT); 4 pinmode(a0, INPUT); 5 6 void loop(){ 7 int input1= analogread(a0); 8 Serial.println(input1); 9 analogwrite(11,input1/4); 10 33

Serial INPUT void setup() { Serial.begin(9600); pinmode(13,output); void loop() { String msg=""; if (Serial.available()>0){ while (Serial.available()>0){ msg=msg+char(serial.read()); delay(250); Serial.println(msg); if (msg=="1234"){ digitalwrite(13,high); if (msg=="43210"){ digitalwrite(13,low); 34

THANK YOU 35

ARDUINO WORKSHOP ACTIVITY 1 Step 1. Open www.tinkercad.com Step 5. Select resistor and LED Step 8. Write the program Step 2. Select social providers Write the program here Step 6. Select Arduino and complete the circuit DIGITAL INPUT AND OUTPUT PROGRAM Step 9. Select Start simulation Step 3. Sign in using social provider Step 10. Observe the circuit if the output is correct To edit the code, press stop the simulation Step 4. Select Circuits then Create new Circiut Step 7. Select Code to start the program

ARDUINO WORKSHOP ACTIVITY 2 Step 1. Open www.tinkercad.com Step 5. Select resistor and LED Step 8. Write the program Write the program here Step 2. Select social providers Step 6. Select Arduino and complete the circuit Step 9. Select Start simulation Step 3. Sign in using social provider Step 10. Observe the circuit if the output is correct To edit the code, press stop the simulation Step 4. Select Circuits then Create new Circiut Step 7. Select Code to start the program 1. Press the button to turn on the red LED on pin 2. Release the button to turn on the green LED on pin 7 3. Display the button status in the serial monitor

ARDUINO QUICK REFERENCE www.arduino.cc Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs like sensor, button, text and create action as output by activating a motor, turning on an light, sending messages. TINKERCAD.COM- ARDUINO AND ELECTRONIC SIMULATOR www.tinkercad.com Built your project and test different electronic components including Arduino uno using Autodesk online simulator LEARN MORE USING EXAMPLE www.arduino.cc/en/tutorial/builtinexamples www.arduino.cc/en/main/software The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing and other open-source software. //this program blink LED at pin 13 void setup(){ pinmode(13,output); void loop(){ digitalwrite(13,high); //LED on delay(1000); //delay 1 second digitalwrite(13,low); //LED off HARDWARE DIGITAL INPUT digitalread(11); read whether it receive HIGH or LOW ANALOG INPUT analogread(a0) ; read voltage from 0-5 volts (A0-A5) ANALOG OUTPUT analogwrite(10, 0-255); give pwm signal (pwm 3,5,6,9,10,11 pins) Pulse Width Modulation or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in Volts) between full on (5 and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. Serial.println(analogRead(A0)); SERIAL MONITOR EXAMPLE www.arduino.cc/en/main/products //Program will read input and display to serial void setup(){ pinmode(10,input); Serial.begin(9600); //baud rate speed void loop(){ int button1=digitalread(10); Serial.println(button1); read analog pin A0 and display to serial DIGITAL OUTPUT PROGRAM //program to blink LED at pin 13 void setup(){ pinmode(13,output); void loop(){ digitalwrite(13,high); //LED on delay(1000); //delay 1 second digitalwrite(13,low); //LED off DIGITAL INPUT AND OUTPUT PROGRAM // program that reads input and turn on the LED void setup(){ pinmode(10,input_pullup); pinmode(13,output); void loop(){ int button1=digitalread(10); if (button1==1) { // button is pressed digitalwrite(13,high); //LED on else if (button1==0) { // button is not pressed digitalwrite(13,low); //LED off ANALOG INPUT AND OUTPUT (PWM) PROGRAM //LED dimmer or motor speed control void setup(){ pinmode(a1,input); pinmode(9,output); //pwm pin Serial.begin(9600); void loop(){ int button1=analogread(a1); Serial.println(button1); analogwrite(9,button1/4);