40
ARDUINO AND ACCESSORIES O RGANIZED BY: D I GITRONIX, WRC www.digitronixnepal.blog spot.com

Arduino Workshop Day 2

Embed Size (px)

DESCRIPTION

Day 2 Presentation topic on Arduino

Citation preview

Page 1: Arduino  Workshop Day 2

ARDUINO AND

ACCESSORIES

ORGA

NIZE

D BY

:DI

GITR

ONIX

, WRC

www.digitronixnepal.blogspot.com

Page 2: Arduino  Workshop Day 2

SOFTWARE REQUIREMENTSArduino IDE

Serial Port Driver

MATLAB

Page 3: Arduino  Workshop Day 2

INTRODUCTION TO ARDUINO

- Open Source Hardware and Software Platform

-Self Contained Computer in an IC

=INTEL 286

Arduino Diecimila

Page 4: Arduino  Workshop Day 2

INTRODUCTION TO ARDUINO

- Based on AVR microcontrollers that are widely popular for their RISC architecture, hight flash memory, inbuilt different features

- Arduino Uses C programming(E A S Y)……

Page 5: Arduino  Workshop Day 2

WHY ARDUINO?

- Inbuilt ADC, Serial Interface, PWM, IO pins

-Programming so easy……(Can be used available libraries)

-Open Source platform

Page 6: Arduino  Workshop Day 2

HARDWARE

I/O PORTS ========== 14PWM ========== 6Analog ========== 6

8 bit =======25610 bit ======= 1023

ADC

Page 7: Arduino  Workshop Day 2

DIFFERENT B0ARDS

DUE

ELEVENUNO

Page 8: Arduino  Workshop Day 2

DIFFERENT B0ARDS

DUE

LILYPAD MEGANANO

Page 9: Arduino  Workshop Day 2

ARDUINO PROGRAMMING BASICS

Void setup(){//your initialization code}

GLOBAL Variables1.

2.

Void loop(){//your repeating code}

3.

Page 10: Arduino  Workshop Day 2

Functions used in setup()1. pinMode(13, OUTPUT); makes pin 13 as output pin2. pinMode(8, INPUT); makes pin 8 as input pin3. Serial.begin(9600) ; starts serial communication with Baudrate 9600Functions used in loop()1. digitalWrite(13, HIGH): makes pin 13 high ie pin13=ON;2. delay(500) : delays system by 500 ms.3. analogRead() : Reads analog value4. analogWrite() : writes anlog value(PWM)5. Serial.print() : Prints at serial monitor6. Serial.println() : prints at serial monitor with line break

WRITE Down!

Page 11: Arduino  Workshop Day 2

Now Real Program Starts

Page 12: Arduino  Workshop Day 2

Serial Programming==In Serial communication , data is transmitted one bit at a time on a single path. ==To establish serial

communication , both sender and receiver must define set of rules known as protocol. ==The protocol should define:

=>Data Transfer Rate=>How to Begin and End

Page 13: Arduino  Workshop Day 2

Serial ProgrammingDon’t worry about TMOD, SCON…..as you seen on other microcontrollersWrite down these functions:

=>Serial.begin()=>Serial.available()=>Serial.print()=>Serial.write()=>Serial.flush()

Page 14: Arduino  Workshop Day 2

Lets control the LED at pin 13 using commands ‘H’ or ‘L’

from your LAPTOP…Any IDEA!!!!???????

Page 15: Arduino  Workshop Day 2
Page 16: Arduino  Workshop Day 2

Lets control the LED at pin 13 using commands ‘1’ for hIGH and ‘0’ for LOW and show

Invalid for other input from your LAPTOP

Page 17: Arduino  Workshop Day 2

Sensors InterfacingDisplaying POT values at Serial

Monitor

Page 18: Arduino  Workshop Day 2

Useful FunctionsanalogRead();analogWrite();map();

Reads Analog ValueWrites Analog Value at PWM PINSMapping Digital data in Certain

Range

Page 19: Arduino  Workshop Day 2

CONNECTION:DIGITRONIX

POT=====A0

Page 20: Arduino  Workshop Day 2
Page 21: Arduino  Workshop Day 2

LED Brightness control using POT

Page 22: Arduino  Workshop Day 2

LCD INTERFACING

Arduino Shields

Page 23: Arduino  Workshop Day 2
Page 24: Arduino  Workshop Day 2

#include<LiquidCrystal.h>

lcd.print()lcd.display();lcd.noDisplay();

Header File

Functions

Page 25: Arduino  Workshop Day 2
Page 26: Arduino  Workshop Day 2

Group WorkGroup 1:

Interface Ultrasound and display various distances

Group 2:Interface IR sensor and use it for obstacle detection of the range 10

to 20 cmGroup 3:

Use PIR sensor for the motion detection and make sound at buzzer on detection of the motion

Page 27: Arduino  Workshop Day 2

MATLAB+

ARDUINO=

MATDUINO

Page 28: Arduino  Workshop Day 2

LOAD GIVEN MATLAB CODEMake Simple GUI

Write Matlab Code

Perform

Page 29: Arduino  Workshop Day 2

www.mathworks.com>>Arduino Support Package

>>Load Arduino with Arduino Digital IO server

>>Open Matlab>>Type GUIDE on command Window

Page 30: Arduino  Workshop Day 2

*****At Openingclear all;global a;a=arduino(‘COM3’);

Page 31: Arduino  Workshop Day 2

*****at Push Button 2****a.digitalWrite(12, 0);a.digitalWrite(13, 1);

*****at Push Button 1****a.digitalWrite(12, 1);a.digitalWrite(13, 0);

Page 32: Arduino  Workshop Day 2

Introduction to AmarinoConnection of Android phone and Arduino PlatformSensors in Android like (G sensor, GPS, Microphone) with advanced software platform can be united to produce advanced prototypes.

Page 33: Arduino  Workshop Day 2

Different modules

Page 34: Arduino  Workshop Day 2

ETHERNET SHIELD W/MICRO-SD READER

Page 35: Arduino  Workshop Day 2

EXTREME SHIELD STACKING

Page 36: Arduino  Workshop Day 2

BLUETOOTH TO TTL 5V MODULE

Page 37: Arduino  Workshop Day 2

USB TO TTL MODULE

Page 38: Arduino  Workshop Day 2

RS-232 TO TTL MODULE

Page 39: Arduino  Workshop Day 2

REVIEW:Sensor InterfacingLCD interfacingSerial programmingPWM programming

Page 40: Arduino  Workshop Day 2

THANK

YOU!