Microcontroller Programming Beginning with Arduino. Charlie Mooney



Similar documents
Lab 6 Introduction to Serial and Wireless Communication

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

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

Introduction to Arduino

Basic Pulse Width Modulation

Arduino Lesson 5. The Serial Monitor

Computer Architectures

Connecting Arduino to Processing a

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

Arduino project. Arduino board. Serial transmission

INTRODUCTION TO SERIAL ARM

Arduino Lesson 16. Stepper Motors

Work with Arduino Hardware

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Hand Gestures Remote Controlled Robotic Arm

GM862 Arduino Shield

Application Note IMU Visualization Software

Arduino Lesson 13. DC Motors. Created by Simon Monk

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

Basic DC Motor Circuits. Living with the Lab Gerald Recktenwald Portland State University

DEPARTMENT OF ELECTRONICS ENGINEERING

Basic DC Motor Circuits

Home Security System for Automatic Doors

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

Arduino Shield Manual

Android Controlled Based Interface

Lecture 7: Programming for the Arduino

FRC WPI Robotics Library Overview

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

Lab Experiment 1: The LPC 2148 Education Board

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:

Introduction to Arduino

ANDROID BASED FARM AUTOMATION USING GR-SAKURA

Arduino Shield Manual

Android Application Development and Bluetooth Technology

Programming the Arduino

Servo Info and Centering

Servo Motor API nxt_motor_get_count nxt_motor_set_count nxt_motor_set_speed

Embedded Systems Design Course Applying the mbed microcontroller

Electronic Brick of Current Sensor

Arduino Motor Shield (L298) Manual

Pulse width modulation

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

Microcontrollers and Sensors. Scott Gilliland - zeroping@gmail

Arduino-Based Dataloggers: Hardware and Software David R. Brooks Institute for Earth Science Research and Education V 1.2, June, , 2015

Display Message on Notice Board using GSM

Welcome to the tutorial for the MPLAB Starter Kit for dspic DSCs

Board also Supports MicroBridge

How To Control A Car With A Thermostat

Tire pressure monitoring

A Surveillance Robot with Climbing Capabilities for Home Security

C4DI Arduino tutorial 4 Things beginning with the letter i

Tutorial. replace them with cell-phone operated module. The advantages of a cell-phone operated bot are:-

Android based Alcohol detection system using Bluetooth technology

Example Connection between USB Host and Android

Embedded Component Based Programming with DAVE 3

ESP 8266: A BREAKTHROUGH IN WIRELESS SENSOR NETWORKS AND INTERNET OF THINGS

2.0 Command and Data Handling Subsystem

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

ZX-NUNCHUK (# )

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

CanSat Program. Stensat Group LLC

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

DESIGN OF 6 DOF ROBOTIC ARM CONTROLLED OVER THE INTERNET

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

STEPPER MOTOR SPEED AND POSITION CONTROL

cs281: Introduction to Computer Systems Lab08 Interrupt Handling and Stepper Motor Controller

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

FTC Android Based Control System

Chapter 6: From Digital-to-Analog and Back Again

Sharp IR Range Finder (GP2D12,GP2D120)

If an occupancy of room is zero, i.e. room is empty then light source will be switched off automatically

Software Development to Control the Scorbot ER VII Robot With a PC

PWM IN AVR. Developed by: Krishna Nand Gupta Prashant Agrawal Mayur Agarwal

EVAL-UFDC-1/UFDC-1M-16

Ultrasonic Distance Measurement Module

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Sensors Collecting Manufacturing Process Data

AC : PRACTICAL DESIGN PROJECTS UTILIZING COMPLEX PROGRAMMABLE LOGIC DEVICES (CPLD)

Mobile Robot Temperature Monitoring System Controlled by Android Application via Bluetooth

DS1104 R&D Controller Board

Serial Communications

Self-Balancing Robot Project Proposal Abstract. Strategy. Physical Construction. Spencer Burdette March 9, 2007

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

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

Using Xbee in Serial Communication

AP Series Autopilot System. AP-202 Data Sheet. March,2015. Chengdu Jouav Automation Tech Co.,L.t.d

ABACOM - netpio.

Surveillance System Using Wireless Sensor Networks

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

Lab 3 Microcontroller programming Interfacing to Sensors and Actuators with irobot

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

PROJECT PRESENTATION ON CELLPHONE OPERATED ROBOTIC ASSISTANT

A highly integrated UAV avionics system 8 Fourth Street PO Box 1500 Hood River, OR (541) phone (541) fax CCT@gorge.

Solar Cybertech: A Competition of Digitally Controlled Vehicles Poweredby Solar Panels

KTA-223 Arduino Compatible Relay Controller

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

Transcription:

Microcontroller Programming Beginning with Arduino Charlie Mooney

Microcontrollers Tiny, self contained computers in an IC Often contain peripherals Different packages availible Vast array of size and power availible

Sensory Input Robots need to be able to recieve input from the world in the form of sensory input. Microcontrollers handle this input. Thousands of sophisticated sensors availiable

Pressure/Force Sensors

GPS Locators

Gyroscopes

Wheel Encoders

Infared Proximity Detectors

Accelerometers

Ultrasonic Rangefinders

Alcohol Vapor Density Detectors

Arduino Development board for the ATMega328 Inludes Programmer, Voltage Regulators Seral to USB Converter CHEAP $30! Has everything you need!

Arduino C Template void setup() { } // Setup stuff to only run once at the beginning void loop() { // This function gets called indefinatly }

Peripherals Analog to Digital Converters (ADC) Counters/Timers (TMRx) PWM Modules (CCP/PWM) Serial Ports (UART) Many, many more...

Digital I/O Only HIGH and LOW values Each pin configurable to do input or output pinmode(pinnumber, pinstate) pinmode(13, INPUT) pinmode(13, OUTPUT)

Digital I/O (Part II) Output Input digitalwrite(pinnumber, HIGH/LOW) int val = digitalread(pinnumber)

Arduino Digital I/O Example int ledpin = 13; void setup() { // Set the digital pin as output: pinmode(ledpin, OUTPUT); } void loop() { // Bring the pin high (1) digitalwrite(ledpin, HIGH); }

Serial Interface (UART) Communicate with other microcontrollers or PC's Asynch. communication Arduino libraries make it extremely easy Serial.begin(baudRate) Serial.println( String To Send ) int byteswaiting = Serial.Availible() Char incomingdata = Serial.read()

Arduino Serial Example void setup() { Serial.begin(9600); // Setup baud rate } void loop() { Serial.println( Give me input ); // output data while(serial.availible() < 1) { // if there's data waiting char input = Serial.read(); // get a byte of data } }

Analog to Digital Converter (ADC) Take analog voltage as input on one of the pins Return digital representation to program Different numbers of bits change precision.

Light Sensors Photoresistors Extremely Simple to Use Resistance changes with light Measure voltage over the sensor with an ADC, and you're done Many more complicated sensors simulate this behavior for simplicity

Arduino ADC Example int sensorpin = 0; void setup() { Serial.begin(9600); // Turn on Serial Connection } void loop() { // read the value from the sensor: sensorvalue = analogread(sensorpin); } // Print sensor value to the Serial Serial.println(sensorValue);

PWM Modules (CCP) Create PWM signals on output pins Measure PWM signals on input pins CCP stands for Capture/Compare What is PWM, anyway?

Pulse Width Modulation (PWM) Transmit analog values using a single digital input/ output pin through careful timing. A PWM signal consists of two values Period: how long before the signal repeats Pulse Width: how long the signal is HIGH before it goes LOW. Duty Cycle: % of time the signal is HIGH, or (Pulse Width / Period)

PWM In Robotics The average voltage (Duty Cycle * Voltage) can be used to control the speed of DC motors. Innaccurate, poor strength, braking, and other problems exist. Servo Motors and Speed Controllers.

Servo Motors DC Motor with gears allow for high torque Embedded microcontroller monitors PWM input and motor position. Vary pulse width to change position of motor

Speed Controllers Embedded microcontroller varies voltage on output lines based on PWM input. Results in constant voltage to motors rather than intermittent. Allow a second, more powerful, power supply to drive large motors. Alter pusle width to change the speed of the motor

Arduino PWM Command AnalogWrite(Pin, DutyCycle) DutyCycle = 0 0%, 127 50%, 255 100% Pin can be 3, 5, 6, 9, 10, or 11 Frequency of about 490Htz Other periods are possible, but not with AnalogWrite

Arduino PWM Example int Pin = 9; void setup() { pinmode(pin, OUTPUT); } void loop() { analogwrite(pin, 127); // Generate 50% duty cycle on Pin }

Useful Resources Robot Parts and Excellent Forums www.trossenrobotics.com Electrical parts, sensors, and microcontrollers www.sparkfun.com Arduino Development Platform www.ardiono.cc