Physics 120/220. Microcontrollers Extras. Prof. Anyes Taffard

Similar documents
THE COMPLETE ALL IN ONE ROBOT 360 NANO BOT

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

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

Sanguino TSB. Introduction: Features:

Project 16 Using an L293D Motor Driver IC

Digital Pins and Constants

L298N Dual H-Bridge Motor Driver

GUIDE TO SP STARTER SHIELD (V3.0)

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

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

keyestudio Keyestudio MEGA 2560 R3 Board

Pridgen Vermeer Robotics ATmega128 Revision 0

Lab 8: Sensor Characterization Lab (Analog)

STEPD StepDuino Quickstart Guide

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

Project 17 Shift Register 8-Bit Binary Counter

How to Use an Arduino

Advance Robotics with Embedded System Design (ARESD)

Rover 5. Explorer kit

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

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

ARDUINO LEONARDO WITH HEADERS Code: A000057

Arduino Robotic Car. The result is a low cost and effective project for the Union Pacific Railroad grant.

ARDUINO MINI 05 Code: A000087

ARDUINO LEONARDO ETH Code: A000022

ARDUINO MEGA ADK REV3 Code: A000069

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 13. Serial Temperature Sensor

Create moving images in forward and reverse with your Arduino when you connect a motor to an H-bridge and some still images BATTERY POTENTIOMETER

ARDUINO MEGA 2560 REV3 Code: A000067

Arduino ADK Rev.3 Board A000069

ARDUINO MICRO WITHOUT HEADERS Code: A000093

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

Pridgen Vermeer Robotics Xmega128 Manual

Arduino Prof. Dr. Magdy M. Abdelhameed

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Arduino Lesson 15. DC Motor Reversing

Explorer V1.20. Features

RoboClaw 2x30A Dual Channel Motor Controller

DEV-1 HamStack Development Board

Make your own secret locking mechanism to keep unwanted guests out of your space!

Web Site: Forums: forums.parallax.com Sales: Technical:

AlphaBot2 robot building kit for Arduino

Power Supply, Arduino MEGA 2560, and Stepper Motors Connections

User Guide v1.0. v1.0 Oct 1, This guide is only available in English Ce manuel est seulement disponible en Anglais

SECOND EDITION. Arduino Cookbook. Michael Margolis O'REILLY- Tokyo. Farnham Koln Sebastopol. Cambridge. Beijing

8:1 Serial Port Expander

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 15. Shift Register 8-Bit Binary Counter

HDBB Breakout board user s manual

ARDUINO M0 PRO Code: A000111

Introduction To Arduino

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

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

Motor driver board. EB022

Adafruit TB A DC/Stepper Motor Driver Breakout Board

ARDUINO UNO REV3 Code: A000066

ARDUINO UNO R3 BASED 20A ROBOT CONTROL BOARD [RKI-1580] Page 1

Omega-328 SB. Rapid Prototyping tool with Shield Base for Atmel AtmegaXX8 Microcontrollers. User Manual

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

Adafruit Metro Mini. Created by lady ada. Last updated on :12:28 PM UTC

RedBoard Hookup Guide

CS12020 (Computer Graphics, Vision and Games) Worksheet 1

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

How-To #3: Make and Use a Motor Controller Shield

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

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

Introducting Itsy Bitsy 32u4

Arduino Programming and Interfacing

UNIT 10: Driving motors

Halloween Pumpkinusing. Wednesday, October 17, 12

ARDUINO WORKSHOP A HANDS-ON I N T R O D U C T I O N W I T H 65 PROJECTS JOHN BOXALL

Introduction to Arduino (programming, wiring, and more!)

RoboClaw 120A/160A/200A Dual Channel Motor Controller

Prototyping & Engineering Electronics Kits Basic Kit Guide

ARDUINO PRIMO. Code: A000135

Introducing Pro Trinket

Index. Jeff Cicolani 2018 J. Cicolani, Beginning Robotics with Raspberry Pi and Arduino,

Autonomous, Surveillance Fire Extinguisher Robotic Vehicle with Obstacle Detection and Bypass using Arduino Microcontroller

Cookie User Manual. For NuMicro Edition 1.0. Rev. 1.0 Release: forum.coocox.org.

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

GSM Shield SIM900. Get Starting

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

FUNCTIONS For controlling the Arduino board and performing computations.

DC3IOB Revision User Guide Updated 3/29/10. Overview

Arduino Cookbook O'REILLY* Michael Margolis. Tokyo. Cambridge. Beijing. Farnham Koln Sebastopol

4 CHANNEL RELAY BOARD- BLUETOOTH

Exen Mini. Setup Guide - V1. nerdonic.com

Physical Computing Self-Quiz

TANGIBLE MEDIA & PHYSICAL COMPUTING INTRODUCTION TO ARDUINO

WAVETEK BLE-WT51822AA/AB. Revision History. Bluetooth low energy Module WT51822AA (256k) /AB (128k) (Bluetooth Low Energy BT4.0) PRODUCT SPECIFICATION

Introducing Pro Trinket

Page 1 / 14. Dear Makerspace User,

Welcome to Apollo. For more information, please visit the website and select Apollo. Default Code

Blue Point Engineering

Controlling a fischertechnik Conveyor Belt with Arduino board

Alessandra de Vitis. Arduino

AndyMark Arduino Tutorial

Getting Started Manual for CODIBOT

Exen Mini. Setup Guide - V2. nerdonic.com

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Grove - Mini I2C Motor Driver v1.0

Transcription:

Physics 120/220 Microcontrollers Extras Prof. Anyes Taffard

Introduction 2 There are an infinite amount of applications for the Arduino. Lots of interfaces that can be controlled with it. Extension boards (aka shield) that can be used to get more pins and/or work with specific interfaces Lots of libraries and examples Ultimately, the code must be yours and adapted to your application If you plan to use Arduino for your project, here are few (not exhaustive) considerations: Will there will be enough pin of the appropriate type (analog/digital) to drive your interface(s)? If not, consider using a shift register Always document which pins on the device is connected to which pins on the Arduino Some libraries may disable some pin feature (eg PWM on some pins) Some interface only plug to certain pins (eg Bluetooth) Whatever interface you wish to use, you must download the datasheet and understand how it works Would you need an independent power source? (eg: battery pack, solar panel) Would you have enough current to drive the load? Use transistor or relay with a protecting diode to increase current output from Arduino Recall: common ground, 10X rule, voltage dividers

Reference voltage An analog voltage on an Arduino analog pin (A0àA5) is converted to a 10-bit integer (0 to 1023) using a successive ADC 5V/1024 = 4.9mV If your max voltage is eg 2V, you can increase the precision by changing the reference voltage (5V) to 2V: 2V/1024 = 1.9mV 3 1. Use Arduino external AREF pin: connect the new reference voltage to AREF and match its GND to the Arduino GND ü ü ü You can then use a voltage divider on the 5V PS to get the reference voltage You can also add a low value Cap between AREF & GND to reduce noise, and prevent unstable analog reading In void setup(), you ll need to add analogreference(external) 2. Use Arduino internal 1.1V reference analogreference(internal)

Displays 4 7 segments LED (or LED matrix) 7 LED segments all connected to a common cathode (anode) Always check datasheet to get the pin assignment eg for HDSP-313E: Connect pin 3 & 8 to -5V via a 220 res Test each segment by connecting them to +5V LED labeled A to G and DP for decimal point eg: display 7: turn on A, B & C Use a shift register (eg 74HC595) with outputs Q0àQ7 Drive shift register using Arduino For 7: Set Q0, Q1 & Q2 to HIGH ie send 1110000

Displays Liquid crystal display Use datasheet & see https://www.arduino.cc/en/reference/liquidcrystal 5

Servo 6 Little motor that can be controlled to rotate to a specific angular position When selecting a Servo, consider: Speed: time it takes to rotate (second/degrees) Rotation range: 0-180 o or 0-360 o Current the servo draws (may need external PS) Torque: Greater the torque, the heavier the object it can rotate On boards other than the Mega, use of the library disables analogwrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins.

Driving motor(s) Some considerations: Operating voltage (3V-12V) Current w/o load Current the motor uses to spin freely Stall current ie nothing connected to the motor s shaft Amount of current used by motor when tries to rotate but can t because of the load on the motor Speed at the operating voltage (RPM) You can use a Darlington Transistor (eg TIP120) that can pass up to 5A at 60V You ll need a separate PS (eg battery). Can also be used to power the Arduino. Motor speed can be controlled via PWM However, cannot control motor direction with this setup 7

Driving motor(s) 8 Alternatively, if you need to drive multiple motors, you can use a motor driving board (eg L298N). The dual H-Bridge allows to drive current in either polarities Can handle higher current draw Easily interface with Arduino Speed via PMW (use Arduino digital ~) If your motor wires are not color coded, you ll need to figure out the forward/backward direction Motor A is control by ENA, IN1 IN2 Motor B is control by ENB, IN3 IN4 ENA IN1 IN2 Description 0 N/A N/A Motor off 1 0 0 Motor is stopped (brake) 1 0 1 Motor is on & goes backwards 1 1 0 Motor is on & goes forwards 1 1 1 Motor is stopped (brake) http://geekonfire.com/wiki/index.php?title=dual_h-bridge_motor_driver Connect L298N pins to the Arduino digital pins. Alternatively, ENA and ENB have jumper caps. By removing these, and connecting ENA/ENB to analog pins, you can use PWM to control speed int speed = 255/2; digitalwrite(en1,1); digitalwrite(en2,0); analogwrite(ena, speed);

Infrared receiver/transmitter 9 Controlling an Arduino with an infrared remote control is made easy with the library provided: To add a library to your sketch: SketchàInclude libraryàirremote Use the Serial port to figure out the code transmitted for each key. Downside of infrared is the range and potential to miss receiving/transmitting packets if not aligned between Rx/Tx

Bluetooth 10 Using a Bluetooth with Arduino is again relatively easy thanks to the library: #include <SoftwareSerial.h> Note: Compatibility between BT and device (eg phone, tablet) The communication is done on via Serial port Arduino serial communication via USB is done on Rx=0 & Tx=1 pins So you if you need to debug with Serial.print(), make sure to define 2 separate ports, using different pins Unplug the BT to upload code to Arduino. Otherwise get error: avrdude: stk500_getsync()

BACKUP 11