Arduino Microcontrollers. By Norm Berls

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

Arduino Lesson 0. Getting Started

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

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

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

Arduino Lesson 1. Blink

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

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

revolution Contents: Introduction Power 28-pin Project Board with input/output cables

The self-starting solar-powered Stirling engine

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

Arduino Lesson 14. Servo Motors

Final Design Report 19 April Project Name: utouch

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

Arduino Lesson 16. Stepper Motors

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

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

Arduino Lesson 13. DC Motors. Created by Simon Monk

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

Work with Arduino Hardware

Hardware Connections between Arduino and IMU Nori Wilkins Apr. 5, 2013

Lecture 7: Programming for the Arduino

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

Designing VM2 Application Boards

KTA-223 Arduino Compatible Relay Controller

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

SYSTEM 45. C R H Electronics Design

SYSTEM 4C. C R H Electronics Design

Introduction to Arduino

Arduino project. Arduino board. Serial transmission

Arduino Lesson 5. The Serial Monitor

Special Lecture. Basic Stamp 2 Programming. (Presented on popular demand)

INTRODUCTION TO SERIAL ARM

Board also Supports MicroBridge

Basic Pulse Width Modulation

Lab Experiment 1: The LPC 2148 Education Board

Renewable Energy Monitor User Manual And Software Reference Guide. (979)

Arduino Motor Shield (L298) Manual

UniPi technical documentation REV 1.1

A REST API for Arduino & the CC3000 WiFi Chip

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

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

Controlling a Dot Matrix LED Display with a Microcontroller

How to read this guide

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

Introduction to Arduino

Tutorial for MPLAB Starter Kit for PIC18F

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

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

Programming the Arduino

Table of Contents Getting Started... 3 The Motors... 4 The Control Board... 5 Setting up the Computer with Mach Starting up the Equipment...

STEPPER MOTOR SPEED AND POSITION CONTROL

Surveillance System Using Wireless Sensor Networks

POCKET SCOPE 2. The idea 2. Design criteria 3

Microcontroller Programming Beginning with Arduino. Charlie Mooney

DS1307 Real Time Clock Breakout Board Kit

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

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

FTDI VCP DRIVER (free) (WIN/MAC/LINUX)

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

RAMPS 1.4 Assembly Guide

Internet of Things with the Arduino Yún

Massachusetts Institute of Technology

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

EasyC. Programming Tips

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

Embedded Software Development: Spottbillige Hardware + OSS = Zum Spielen zu Schade!

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

Data Sheet. Adaptive Design ltd. Arduino Dual L6470 Stepper Motor Shield V th November L6470 Stepper Motor Shield

GLOLAB Two Wire Stepper Motor Positioner

Workshop Intel Galileo Board

Tutorials Drawing a 555 timer circuit

Easy! Smooth! GP/ST-3500 Series->GP4000 Series Replacement Guidebook

SainSmart UNO R3 Starter Kit

Advanced LED Controller (LED Chaser)

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

The Programming Interface

A Practical Guide to Free Energy Devices

Constructing a precision SWR meter and antenna analyzer. Mike Brink HNF, Design Technologist.

STEELSERIES FREE MOBILE WIRELESS CONTROLLER USER GUIDE

PN532 NFC RFID Module User Guide

GLOLAB Universal Telephone Hold

Arduino DUE + DAC MCP4922 (SPI)

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

Microcontrollers and Sensors. Scott Gilliland - zeroping@gmail

Pololu DRV8835 Dual Motor Driver Shield for Arduino

Arduino Shield Manual

Measuring Resistance Using Digital I/O

ECEN 1400, Introduction to Analog and Digital Electronics

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

Microtronics technologies Mobile:

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Selecting and Implementing H-Bridges in DC Motor Control. Daniel Phan A

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

4/Really Getting Started with Arduino

RLC Series Resonance

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Transcription:

Arduino Microcontrollers By Norm Berls

Back in the day Arduino invented in 2005 Art students at the Interaction Design Institute Ivrea in Ivrea, Italy, needed controller for kinetic art Invention worked so well, they went into the digital controller business Open Source design is public and anyone can copy and do they ever Many enhancements since then Arduino brought electrical engineering down to the level of the hobbyist

A Microcontroller More than an on/off switch. Less than a computer Programmable: you must write a program. About the size of a credit card. Usually small project or hobby applications. Possibly limited CNC.

How It Works Hook up your choice of electronic devices to the Arduino board. You can buy devices ready made for Arduino You can wire components together on a solderless breadboard and connect to Arduino Connect the Arduino to a USB port on a PC Write an Arduino program with a special program on the PC and download it into the Arduino. Your program will immediately begin to execute and keep on executing, and executing Disconnect the Arduino from the PC Connect a battery up to the Arduino The Arduino will remember the last program you loaded and will immediately execute it when you turn the battery power on Your program will only stop executing when the power is turned off to the Arduino

You gotta have PC Windows, IOS, Linux Multimeter Soldering Iron

You gotta know something about PCs and the Internet Programming (C, C++) Electronics Arduinos

Arduino Devices and Features

A Connected Microcontroller Connects to electronic components: Switch Resistor Capacitor Diode Transistor LED (Light Emitting Diode) Solenoid Relay Potentiometer IC chip

Fancy Sensor Connections Sensors: Heat (IR) Humidity CO2 Contact Proximity Tilt (gyroscope) Motion (inertia) Light Sound Key Pad Real Time Clock GPS

Sensor Input Sensor input comes in the form of variable: Voltage Resistance Capacitance

Fancy Graphical Connections 1 LCD Liquid Crystal Display 2 colors 2 X 16 most common 4 X 20 available Count those connections!

Fancy Graphical Connections 2 TFT Thin Film Transistor Color Graphics Choice of fonts. Fast way to use up Arduino IO pins SPI serial bus requires just 2 pins

Fancy Graphical Connections 3 TFT (Color) Touch sensitive Are we all thinking DRO?

Inductance Anyone?

Mostly DC Motors, if you please. W and WO brushes Arduino powered by computer Motor powered by battery or other external power source Arduino controls motor or additional motor controller. Faster/Slower Forward/Backward Contact sensors for precise control.

Stepper Motors Arduino Breadboard Controller 24V, 10A power supply Stepper Motor NEMA 34 5.5 A, 132 W 40 in-lb 0.179 HP 180 rotation

Servo Motors Most examples involve only small motors. Feedback allows precise control and checking.

No Way, Jose At least a transistor Maybe a relay Maybe a controller Any motor pulling over 1 A is going to need a heat sink or fan on the Arduino side

About CNC gshield by Synthetos touted as the CNC solution Works on Arduino Uno the smallest Arduino Apparent compatibility problems with Mega GRBL-Arduino-Library needed a G-code interpreter (subset only) 2.5 Amps per winding 12-30 Input Voltage TI DRV8818 Stepper Drivers

Micro SD Instead of cramming all your data into memory at once Non-volatile memory card Megabytes 16, 32 Read/Write M codes G codes Limited CNC instruction set Or data collection weather station, jogger mileage

Communications Various Serial Ports (Standard, SPI, I2C) USB Ethernet WiFi Blue Tooth RFID

Insanity works better on Arduino

Harass the Cat

3D Printer $800

Millie?

Incoming!!! Motion shield Gyroscope shield Altitude shield GPS Shield You still have to know how to pilot a plane and navigate through cross winds

DIY DRO

The Devilish Details or What It Is

Geography USB plug for program development Program stays in Arduino even when power is off. 7-12 V power plug 40 ua per pin, 200 ua total Reset Button Timing crystal Digital IO pins Analog Input pins Power & Ground pins Serial Ports Some digital pins double as analog output (PWM) Pulse Width Modulation.

Stacking Add on boards are called Shields Shields are designed for stacking Pins pass through from board to board Pins cannot be reused Lack of clearance can cause short circuits Shield conflicts can arise when two shields want to use the same IO pin

Add More Pins Uno 5.5 volts 4 KB flash memory 14 pins 8 bit addresses Mega 2560 R3 5.5 volts 256 KB flash memory 66 pins 8 bit addresses Due 3.3 volts 512 KB flash memory 66 pins 32 bit addresses

DIY Shield Prototype on breadboard Move to prototype shield Solder in place Add it to the stack

When an Arduino gets Bored It talks to itself Arduinos can talk to each other through the I2C serial bus. When you run out of IO pins, you split the work onto multiple Arduinos One Arduino is the master The others are slaves

Versioning Dilemmas Most shields that are compatible with Uno will work on Mega. Many versions of Arduino are now obsolete and no longer made. Compatibility? Pin assignment and functionality can change between versions. Voltage can be a compatibility issue for shields.

Digital IO WRT the Uno and the Mega +5 volts is considered the input voltage 0 volts is the ground. +5 volts is the HIGH setting or digital 1 0 volts is the LOW setting or digital 0 Any digital pin can be declared as input or output, but not both.

Analog Input Arduino has certain designated pins for analog input named A0, A1, A2, A3.. analogread method returns integer values between 0 and 1023 input = analogread(a0); constrain method clips analog values to fit in a certain range input = constrain(analogread(a0),250,750); map method scales analog values from one range to another range Input = map(analogread(a0),0,1023,0,255);

Pulse Width Modulation or Analog Output PWM output is done via specially designated digital pins It is really on/off digital output but, the duration is precisely controlled in a duty cycle Used to control motors by creating the illusion of variable voltage

Serial IO One bit at a time, one after the other Standard Serial SPI serial bus (2 wires) send, receive I2C serial bus (2 wires) send-receive, timer Specialized libraries needed to support serial IO You can have a several devices working off the same I2C serial bus because each one has to have a unique address.

Programming the Arduino

Bits and Bytes Arduino calls a program a sketch Arduino language is based on C Some C++ mixed in Libraries special program functions written for use with Arduino extensions to the Arduino language Libraries and Shields go together If you need a library, copy from Internet and install Sketches are written with the Arduino IDE (Integrated Development Environment) IDE is a Java-based program that runs on a PC Download the IDE off the Internet for free!

How much C? Floating point numbers and arithmetic Trig functions etc. Logic If, Else Case Comparison operators < > ==!= And, Or && Loops While Indexed Dynamic memory allocation Arrays Text strings

Beyond C Arduino supports events You can write your own libraries if you know C++ The Arduino IDE is written in Java

The IDE What to do with it? Integrated Development Environment a program for the PC that lets you write Arduino sketches. https://www.arduino.cc/en/main/software Or just search for Arduino IDE Download and install Run an A cable from a USB port to the connector on the Arduino board. Tell the IDE which COM port your are connecting with. Tell the IDE which kind of Arduino board you are plugged into. Different boards have different chips and hence speak different versions of the Arduino language

The Arduino IDE

IDE Tools Menu Pulled down the tools menu Board option controls board type Port option controls which COM port the Arduino board is connected to Remember, this is a USB port

IDE Load Open an existing sketch Menu will show example sketches of how Arduino interacts with various devices. First menu item brings up list of sketches you have saved.

IDE Edit Sketch traffic_light_1 has been loaded. Slider allows scroll to bottom of sketch. Cursor can be placed anywhere in sketch. Typing enters new text or replaces old Enter creates a new line Copy to clipboard and paste will work

IDE Compile Clicked on the check icon Sketch compiled without error Note Done compiling message Compiling means translating program text into the machine language of the Arduino chip The compile option will report any syntax errors in your code

IDE Load/Run Note that load icon is highlighted This option compiles the sketch and loads it to the Arduino Then the sketch immediately starts to run on the Arduino

IDE Load/Run Note Done uploading message The sketch has been loaded to the Arduino and is running Clicked on the serial output icon This sketch contains instructions to write messages to the standard serial port. Clicking the serial icon makes the serial port output visible in a window. This only happens under the IDE.

IDE Serial Output

IDE Save Clicked on the save icon Sketch was saved to disk

traffic_light_1 Arduino Sketch int gg = 6; int yy = 2; int ss = 6; void setup() { Serial.begin(9600); pinmode(10, OUTPUT); pinmode(11, OUTPUT); pinmode(12, OUTPUT); digitalwrite(10, LOW); digitalwrite(11, LOW); digitalwrite(12, LOW); } void loop() { golight(gg); yieldlight(yy); stoplight(ss); } void stoplight(int time) { digitalwrite(10, LOW); digitalwrite(11, LOW); digitalwrite(12, HIGH); Serial.println("Light mode: Stop"); delay(time * 1000); } void yieldlight(int time) { digitalwrite(10, LOW); digitalwrite(11, HIGH); digitalwrite(12, LOW); Serial.println("Light mode: Yield"); delay(time * 1000); } void golight(int time) { digitalwrite(10, HIGH); digitalwrite(11, LOW); digitalwrite(12, LOW); Serial.println("Light mode: Go -"); delay(time * 1000); }

Electronics

Watt Amp, Volt? Keep track of which side of any device has the most + voltage A multimeter with automatic scaling is a good tool for isolating circuit problems Most every device will have some amount of voltage across it A device with no measurable voltage across it is suspect

Getting Zapped Some devices are sensitive to polarity LEDs have a long wire and a short wire. The long wire must connect to the + input or the LED will not light. Arduino outputs +5 V at 40 ua. This is enough to burn out a micro LED. 1000 Ohm resistor in series with the LED is necessary to keep LED from burning out. Some capacitors will explode if connected to the wrong polarity.

iphone App Motors are confusing Amps x Volts = Watts How many HP? iphone app Units Plus does units conversions Including power Watts HP

iphone App Color band codes on resistors are troublesome iphone app Resistor converts colors to Ohms Does both 4 band and 5 band resistors.

Arduino School

Books & Books Title Author Sams Teach Yourself Arduino Programming in 24 Hours Arduino for Dummies Arduino Projects for Dummies Richard Blum John Nussey Brock Craft Make: Electronics Charles Platt Make: Arduino Bots and Gadgets Programming Arduino Next Steps Kimmo Karvinen Tero Karvinen Simon Monk

Tutorial Websites Name Arduino Learn Arduino Arduino Tutorial Sparkfun YouTube URL www.arduino.cc learn.adafruit.com/category/learn-arduino http://www.ladyada.net/learn/arduino/ learn.sparkfun.com/tutorials/tags/arduino?page=all www.youtube.com

Price Comparison Merchant Price Arduino Uno R3 Adafruit $24.95 Amazon $15.67 Arduino Store, USA $24.95 Sparkfun $24.95 Ebay $ 3.95 Sain Smart $ 8.89 Radioshack $34.99 GearBest $10.99 Micro Center $ 9.99

Raspberry Pi A computer and not a controller Megabytes of memory Connections to keyboard and mouse Much faster than an Arduino Connections to peripheral sensors and actuators generally more difficult Programming in Python Runs Linux OS Raspberry Pi and Arduino can talk to each other through the I2C serial bus

Future Project Real time clock Westminster chimes Components Tubular wind chimes Real time shield TFT shield for time/date Key pad shield Solenoids LCD shield for reset On/off switch for chimes Arduinos

The End