Galileo Tutorial I/Os, Sensing and Actuation Senzations 2014

Similar documents
Lab 6 Introduction to Serial and Wireless Communication

Microcontroller Programming Beginning with Arduino. Charlie Mooney

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

Work with Arduino Hardware

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

UPS PIco. to be used with. Raspberry Pi B+, A+, B, and A. HAT Compliant. Raspberry Pi is a trademark of the Raspberry Pi Foundation

Lab Experiment 1: The LPC 2148 Education Board

Arduino project. Arduino board. Serial transmission

UniPi technical documentation REV 1.1

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

GM862 Arduino Shield

Arduino Wifi shield And reciever. 5V adapter. Connecting wifi module on shield: Make sure the wifi unit is connected the following way on the shield:

Yun Shield Quick Start Guide VERSION: 1.0 Version Description Date 1.0 Release 2014-Jul-08 Yun Shield Quick Start Guide 1 / 14

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

Arduino Lesson 5. The Serial Monitor

Basic Pulse Width Modulation

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Microprocessor Project Laboratory

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Serial Communications

Arduino Shield Manual

Accurate Measurement of the Mains Electricity Frequency

Servo Motors (SensorDAQ only) Evaluation copy. Vernier Digital Control Unit (DCU) LabQuest or LabPro power supply

KTA-223 Arduino Compatible Relay Controller

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

MANUAL FOR RX700 LR and NR

Wireless Communication With Arduino

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

1602 LCD adopts standard 14 pins(no backlight) or 16pins(with backlight) interface, Instruction of each pin interface is as follows:

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

Digital I/O: OUTPUT: Basic, Count, Count+, Smart+

CAN-Bus Shield Hookup Guide

INTRODUCTION TO SERIAL ARM

RPLIDAR. Low Cost 360 degree 2D Laser Scanner (LIDAR) System Development Kit User Manual Rev.1

Software User Guide UG-461

Arduino Shield Manual

TCP/IP MODULE CA-ETHR-A INSTALLATION MANUAL

UPiS - Uninterruptible Power intelligent Supply

ABACOM - netpio.

PN532 NFC RFID Module User Guide

In-System Programmer USER MANUAL RN-ISP-UM RN-WIFLYCR-UM

SenseLink TM. End-Point Controller. Addendum

Using Xbee in Serial Communication

SainSmart UNO R3 Starter Kit

NHD-0420D3Z-FL-GBW-V3

EARTH PEOPLE TECHNOLOGY SERIAL GRAPH TOOL FOR THE ARDUINO UNO USER MANUAL

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Board also Supports MicroBridge

Flight Controller. Mini Fun Fly

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

Model 5511 Filler Controller User s Manual Version 1.1 October 2011

Ultrasonic Distance Measurement Module

Introduction. Getting familiar with chipkit Pi

DATASHEET. ADAM Arduino Display Adaptor Module. Arduino Compatible Shield P/N: 4Display-Shield-FT843 For the 4D Systems 4DLCD-FT843 Display

Introduction to Arduino

Computer Architectures

1. SAFETY INFORMATION

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

DISCONTINUED. AtlasScientific. as of 10/21/13. E.C. Circuit. Biology Technology. Features

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

FLYPORT Wi-Fi G

Radio sensor powered by a mini solar cell the EnOcean STM 110 now functions with even less light

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

A RF18 Remote control receiver MODULE

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

The Answer to the 14 Most Frequently Asked Modbus Questions

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

PolyBot Board. User's Guide V1.11 9/20/08

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

STIM202 Evaluation Kit

Advanced Data Capture and Control Systems

Lecture 7: Programming for the Arduino

Single channel data transceiver module WIZ2-434

Arduino Microcontroller Guide W. Durfee, University of Minnesota ver. oct-2011 Available on-line at

WEA-Base. User manual for load cell transmitters. UK WEA-Base User manual for load cell transmitters Version 3.2 UK

1 Mi kołaj Z Mik ar ołaj Z zyc arzy ki cki

GPS/GLONASS SiRFstarV Evaluation Kit EVA5100-A

Scripting Language Reference. SimpleBGC 32bit

USER GUIDE EDBG. Description

1. Learn about the 555 timer integrated circuit and applications 2. Apply the 555 timer to build an infrared (IR) transmitter and receiver

USB / Data-Acquisition Module NOW LEAD-FREE

Software Manual RS232 Laser Merge Module. Document # SU Rev A

Arduino Lesson 16. Stepper Motors


A REST API for Arduino & the CC3000 WiFi Chip

JNIOR. Overview. Get Connected. Get Results. JNIOR Model 310. JNIOR Model 312. JNIOR Model 314. JNIOR Model 410

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015

EDI Distributor Control Interface Wiring and Setup Instructions

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Digital and Analog I/O

Electronic Brick of Current Sensor

INTELLIGENT CONTROL MODULE SA-2000-II HARDWARE MANUAL. Access Technologies International, Inc.

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

Crazy Alarm Clock L A K S H M I M E Y Y A P P A N J A M E S K A Y E W I L L I A M D I E H L C O N G C H E N

Fingerprint Based Biometric Attendance System

Transcription:

Galileo Tutorial I/Os, Sensing and Actuation Senzations 2014 Biograd na Moru 1. September 2013 Alex Gluhak Intel Labs Europe 1 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Learning goals I/O Basics Available I/O options on the Galileo Serial I/O Sensing and actuating Grove starter kit Digital I/O Analog I/O 2 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Available I/O options on the Galileo 3 Galileo Tutorial I/Os, Sensing and WHAT Actuation WILL YOU MAKE? WHAT WILL YOU MAKE? 3

I/O options on the Galileo RS232 Serial USB client USB host 14 Digital I/Os I2C/TWI SPI Arduino Uno 3 Compatible Headers JTAG 6 Analog Inputs 4 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial communications on the Galileo 5 Galileo Tutorial I/Os, Sensing and WHAT Actuation WILL YOU MAKE? WHAT WILL YOU MAKE? 5

Serial communications (1/2) Arduino platforms have at least one serial port (also known as a UART or Universal Asynchronous Receiver/Transmitter) Useful for communications between the Arduino board and a computer or other devices Galileo provides several serial communication options Via RS232 serial port on 3.5mm phone jack connector (Linux console) Via USB client port (Sketches) Via UART on digital pins 0 (RX) & 1 (TX) Linux Console Serial Sketches Serial1 6 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial communications (2/2) Initialising serial read and/or write interactions Arduino Syntax: Serial.begin(baudrate) Serial.begin (9600) // opens a serial port with 9600 bauds per sec Baud rates supported on Galileo: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200. 7 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial write (1/2) Print data as human readable ASCII to serial port Arduino Syntax: Serial.print(val) or Serial.print(val, format) Arduino Syntax: Serial.println(val) or Serial.println(val, format) Serial.print ( Senzations 2014 ) // prints Senzations 2014 Serial.println (3.14159265359, 2) // prints 3.14 with CR/LF Parameters Val data to be printed (any type) Format number base or number of decimal places to be printed 8 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial write (2/2) Write binary data to serial port Arduino Syntax: Serial.write(val) Serial.write ( Senzations 2014 ) // writes Senzations 2014 Data is sent as byte or series of bytes 9 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial read (1/2) Data sent to serial arrives into the serial receive buffer Size: 64 bytes Good practice is to check first the availability of data Syntax: Serial.available() Return number of bytes Data can be read either byte by byte Arduino Syntax: Serial.read() Returns a byte that has been read 10 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Serial read (2/2) Data can also be read in chunks into a buffer Arduino Syntax: Serial.readBytes(buffer, length) Parameters Buffer: to store the read data, a char[] or byte[] Length: number of char to read Returns the number of char/bytes placed in the buffer Terminates when length is reached or time out occurs, you can set the timeout as follows: Arduino Syntax: Serial.setTimeout(time) // in milisec 11 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

User built-in serial monitor Select Tools -> Serial Monitor or click Serial Monitor Icon Note: Sketch must be loaded first; else, Serial Monitor will close on Sketch upload 12 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Exercises Store your name(s) in a variable and write it character by character with a delay using all different serial write options Write all prime numbers between 1 and 50 via the serial interface in a single coma separated line Write a simple echo server that returns all data send via serial port (char by char and all at once) Try to use an alternative terminal for receiving data, not the built in one 13 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Grove starter kit Sensors and actuators used in the tutorial 14 Galileo Tutorial I/Os, Sensing and WHAT Actuation WILL YOU MAKE? WHAT WILL YOU MAKE? 14

Grove starter kit 15 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Sensors / input devices Sound sensor Analog Rotary angle sensor Button Digital Temperature sensor Light sensor Touch sensor 16 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Actuators / output devices Relay switch LCD display (I2C) Buzzer LED Servo 17 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Base shield 7 Digital I/Os (D2.D8) 1 UART (1 port) 4 Analog inputs (A0.A3) ISP (1 port) Power 3.3/5V switch Reset button 1 I2C (4 ports) 18 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Principles HW interfacing Select appropriate port to plug in the sensor 4 wire interconnects (GND, VCC, data1, data 2) SW support Most sensors work out of the box with standard Arduino I/O Additional libraries needed for Servo LCD display 19 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Digital I/O on the Galileo 20 Galileo Tutorial I/Os, Sensing and WHAT Actuation WILL YOU MAKE? WHAT WILL YOU MAKE? 20

Digital I/Os 14 Digital I/O pins which can be configured as either input or output 12 can serve as GPIOs (Pins 2-13) 2 can support UART (Pin 0 and 1) 6 can serve as PWM (Pins 3,5,6,9,10,11) - ~ Operating parameters Can work at both 3.3V and 5V (jumper to configure) Max (out/in): 10mA / 25mA Max total on all digital (out/in): 40mA/100mA 21 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Configuring GPIOs GPIOs can be configured as either input or output Arduino Syntax: pinmode (pin, mode) pinmode(13, OUTPUT) // set pin 13 to output mode pinmode(4, INPUT) // set pin 4 to input mode 22 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Digital write Allows pins configured as output to be set either HIGH or LOW Arduino Syntax: digitalwrite(pin, value) digitalwrite (9, HIGH) // 3.3/5V available on Pin9 digitalwrite (9, LOW) // 0V available on Pin9 23 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Exercise 1 Digital write Write a sketch that toggles the LED every 2 seconds Hints: LED is connected to Pin 13 Use: Delay ( [ms] ) for waits 24 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Digital read Allows pins configured as input to be read Arduino Syntax: digitalread(pin) Returns value either LOW or HIGH Example digitalread (8) // returns either low or high state available on Pin8 25 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Exercise 2 Digital read/write Variation 1: Turn on a led if a button has been pressed + Variation 2: Turn on buzzer if a the touch sensor is pressed + Hint: Use any of the digital PINs D2-D8 26 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Solution 27 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Analog I/O on the Galileo 28 Galileo Tutorial I/Os, Sensing and WHAT Actuation WILL YOU MAKE? WHAT WILL YOU MAKE? 28

Analog I/O 6 Analogue inputs (Pins A0-A5) AD7298 analog-to-digital (A/D) converter, 12bit Measures from 0 to 5V by default, controlled by IOREF Resolution is limited to 10bits by default 1024 units -> at 5V = 4.9mV per unit Readings mapped into integer values from 0 1023 Analog pins can be configured to act as digital pins A0 -> PIN14. A5->PIN19 Analog output via PWM 29 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Analog read Reading voltage level attached to a analogue pin Arduino Syntax: analogread(pin) Returns integer value between 0 1023 analogread (A1) // reads analog value of pin AP1 Mapping values to other voltage ranges Arduino Syntax: map(value, fromlow, fromhigh, tolow, tohigh) map(545, 0,1023, 0, 255) // reads analog value of pin AP1 30 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Exercise Analog read Connect analog sensor to an analog input and read out Available options: Light sensor Noise sensor Temp sensor Rotation sensor Hint: Use any of the analog PINs A0-A3 31 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Solution 32 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Pulse Width Modulation (PWM) Technique for getting analog results with digital means PWM is supported on Pin 3, 5, 6, 9, 10, and 11 marked with a ~ Usage examples Light a LED at varying brightness Drive a motor at various speeds 33 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

PWM principles Digital pins are switched between HIGH and LOW to generate a square wave This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends between the two states To get varying analog values, you change, or modulate, that pulse width Source: http://arduino.cc/en/tutorial/pwm 34 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Analog write Invoke analog write on a PWM pin to generate an analog value, which depends on the pulse width Arduino Syntax: analogwrite(pin, value) analogwrite (10, 32) // send PWM with 12.5% duty cycle to PIN10 Range of value parameter is 0 255: analogwrite of 255 requests a 100% duty cycle (always on) analogwrite of 127 is a 50% duty cycle (on half the time) analogwrite of 0 is a 0% duty cycle (Always off) 35 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Exercise Analog write Modulate the intensity of the LED light Use the following options Light sensor Rotation sensor Hint: Use map to adjust output to input values 36 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Solution Analog write 37 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?

Resources and further reading Grove Starter Kit Wiki: http://www.seeedstudio.com/wiki/grove_-_starter_kit_v3 Grove starter kit sketch book https://github.com/seeed-studio/sketchbook_starter_kit_v3.0 38 Galileo Tutorial I/Os, Sensing and Actuation WHAT WILL YOU MAKE?