Gary Sutcliffe, W9XT Copyright © 2012 Gary C. Sutcliffe.

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 6 Digital Inputs
Advertisements

EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Lab7: Introduction to Arduino
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
How to use Arduino By: Andrew Hoffmaster.
Embedded Sumo 1T4 – 1T5 UTRA.
In this presentation you will:
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
Ballooning Bundle. What is a Microcontroller? Small computer with a processor core, memory and programmable input/output Continuously repeats software.
Arduino Josh Villbrandt February 4, Digital Circuits Analog versus digital – What’s the difference? – How to represent an analog signal in a computer?
Objectives How Microcontroller works
Microprocessors Tutorial 1: Arduino Basics
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Introduction to the Arduino
Khaled A. Al-Utaibi  The Push Button  Interfacing Push Buttons to Arduino  Programming Digital Inputs  Working with “Bouncy”
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Introduction to Arduino Microcontrollers. What is a Microcontroller ? What is a Microprocessor ? A Microcontroller (8 bit) does one task very fast and.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
Microprocessors Tutorial 1: Arduino Basics
Arduino A free development system based on Atmel AVR 8 bit microcontrollers. LB8X Tom.
Microcontrollers, Microcomputers, and Microprocessors
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
ARDUINO OVERVIEW Bob Wilton – KF5TPQ. ARDUINO UNO.
Week 5: Microcontrollers & Flow Control Bryan Burlingame 2 March 2016.
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Arduino.
Assist. Prof. Rassim Suliyev - SDU 2017
Dr. Kyung Eun Park Summer 2017
Val Manes Department of Math & Computer Science
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
Arduino & its hardware interfacing
UTA010 : Engineering Design – II
European Robotic LABoratory
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
Introduction to Arduino Microcontrollers
Arduino and the Radio Amateur
How to avoid catching things on fire.
Analog Input through POT
Introduction to Arduinos
Roller Coaster Design Project
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Arduino : Introduction & Programming
Manual Robotics ..
Arduino Uno circuit basics
Introduction to Arduinos
Introduction to arduino
Introduction to Arduino IDE and Software
Interrupts.
Presentation transcript:

Gary Sutcliffe, W9XT Copyright © 2012 Gary C. Sutcliffe

Microcontroller Development System Low cost - ~$30 Free development software USB connection to Arduino Runs under Windows, Mac, Linux Easily expand hardware with stackable “Shields” Huge user community Software Designs Tutorials Forums

MicroprocessorMicrocontroller Multipurpose PC MAC Memory is external Extra circuitry to outside world Usually has OS (Windows) Single purpose Microwave Oven TV remote Memory inside chip Peripherals to outside world built in Usually does not have OS

Microcontroller Peripherals Communications Serial (RS-232) SPI I2C USB Ethernet CAN Bus LIN Bus Timing Timers Counters PWM Analog A/D Converter Digital I/O Ports LCD control

There are a number of Arduino models and Arduino clones. The UNO is the current standard model. It costs about $30.

Stackable shields expand I/O lists nearly 300 available shields Motor control WiFi LCD Displays Ethernet Sensors Bluetooth Memory LED matrix Relay GPS Prototype/development Many, many more! The Unified Microsystems ATS-1 shield adds LCD, push buttons, programmable LED & buzzer. This boards only use two of the Arduino I/O lines leaving the rest available for your project.

“Wiring Language” - C/C++ Based, simplified Fast - compiled, not interpreted Built in functions make it easy to use peripherals Digital Input/Output Analog/Digital Converters Serial Ports I2C & SPI interface Thousands of programs & examples on web

Made up of a series of instructions Make a calculation Control the output pins Check state of input pins Configure & control the microcontroller peripherals Make decisions and control program direction

1. Lather 2. Rinse 3. Repeat !

X Name Switch_State Dave ON (1, HIGH) RAM memory locations you can put information into and check later You need to define what type of data goes into variables Contents of RAM are lost when power is lost! !

Digital signals can have only 2 states ON “1” True High 5V at I/O pin OFF “0” False Low 0V at I/O pin Arduino has 14 digital lines that can be configured to be inputs or outputs. !

Think of a digital output line as a switch. Setting it HIGH is like turning the switch ON. Setting it LOW is like turning the switch OFF. digitalWrite(5, HIGH); //Set Output #5 High Output will put 5V at the pin which can drive a relay, LED, transistor or other external device digitalWrite(7, LOW); //Set Output #7 Low Output pin will be 0V, turning off external device !

An external switch, sensor or other device can be connected to an input pin. The program can make decisions based on the value in X X= digitalRead(12); // Reads Input #12 and set X to: “1” if Input pin #12 is HIGH (5V) “0” if Input pin #12 is LOW (0V) !

Simple I/O Circuits Input: Read State of Switch Output: Turn LED On/Off

//Turn on LED when switch closed int sw; // variable to hold state of switch void setup() //do this 1 time when power is applied { pinMode(10, OUTPUT); //set pin to output to drive LED pinMode(11, INPUT); //set pin to input to read switch digitalWrite(11,HIGH); //Turns on internal pull up resistor } void loop() //loop runs forever (or at least until we turn it off) { sw = digitalRead(11); if(sw == 0) digitalWrite(10,HIGH); //turn on LED else digitalWrite(10,LOW); //turn LED off } /*** end of loop() ***/

 Google Ham Radio + Arduino gets 1,500,000 hits CW Keyers APRS TNC Antenna Switching Satellite Tracking Repeater Control Rotor control Voice keyer Beacons QRSS

// W9XT Simple Arduino Keyer // Give pins names – easier to remember what they are for: const int Dit = 3; // Pin for Dit input const int Dah = 4; // Pin for Dah input const int KeyOut = 5; //Pin for keyer output // variables will change: int ditTime = 120; // Dit time in msec for 10 WPM int padState; //holds state of paddle contact void setup() { //do this once at power up // initialize the pins as inputs and outputs pinMode(Dit, INPUT); pinMode(Dah, INPUT); pinMode(KeyOut, OUTPUT); digitalWrite(KeyOut,LOW); //Make sure we start out key up }

void loop(){ padState = digitalRead(Dit); // Check for the dit paddle pushed if(padState == 0){ //pin low if paddle pressed. If low do this: digitalWrite(KeyOut,HIGH); //set Key down state delay(ditTime); //stay that way for 1 dit time digitalWrite(KeyOut,LOW); // now have to be key up for 1 dit time delay(ditTime); } padState = digitalRead(Dah); //now check for the dah paddle pushed if(padState == 0){ //pin low if paddle pressed. If low, do this: digitalWrite(KeyOut,HIGH); //set Key down state delay(ditTime* 3); //stay that way for 3 dit times digitalWrite(KeyOut,LOW); // now have to be key up for 1 dit time delay(ditTime); } } // end of loop()

The Arduino has Analog to Digital converter inputs An A/D converter is like a digital voltmeter 10 bit A/D – gives a value between With 5V reference, actual voltage = returned value *.0049V We will use a potentiometer as a voltage divider to vary the voltage at an A/D pin. The voltage will determine the CW speed.

Morse Timing – Dit Period Tmsec = 1200/WPM 5 WPM: T = 240msec 40 WPM: T = 30msec AD 0V = 0 AD 5V = 1023 Equation to cover ~5 to ~40 WPM T = AD/5 +30 Note: Fastest speed is at 0V, slowest at 5V

void loop(){ //do forever int rawAnalog; //holds A/D reading //update the CW speed – new!! rawAnalog = analogRead(analogPin); //measure the voltage ditTime = (rawAnalog/5) +30; //Calculate the new dit time // Check for the dit paddle pushed padState = digitalRead(Dit); if(padState == 0) //pin low if paddle pressed { digitalWrite(KeyOut,HIGH); //set Key down state delay(ditTime); //stay that way for 1 dit time digitalWrite(KeyOut,LOW); // now have to be key up for 1 dit time delay(ditTime); } //now check for the dah paddle pushed – code not shown for clarity } //end of loop

The speed control is not very good. Not much resolution at high speed. Could fix with software Could add weight control – change dit/dah ratio Add “Mode B” operation Could add stored messages Could add ability to swap dit/dah inputs for lefties Add just about anything you can think of...

Historical Development Programming knowledge Electronics knowledge Computer architecture knowledge Expensive development software & equipment Arduino Development Very little experience to start – hard work done Low cost hardware ~$30 Free Software Concentrate on learning one area at a time Lots of resources on web

Great for beginners Inexpensive Much of the hard work is already done Lots of learning resources on the web Start simple and grow as you learn What neat Arduino project will you come up with?

- Main Arduino site – list of available shields Arduino sources Radio Shack – LCD Shield – micro interfacing tutorial This program will be available on