The Arduino Micro-controller G4NAQ SHIREHAMPTON A.R.C.

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

INTRODUCTION TO SERIAL ARM

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

Arduino project. Arduino board. Serial transmission

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

Lab Experiment 1: The LPC 2148 Education Board

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

Arduino Lesson 0. Getting Started

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

Designing VM2 Application Boards

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

Controlling a Dot Matrix LED Display with a Microcontroller

2.0 Command and Data Handling Subsystem

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

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

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Embedded Display Module EDM6070

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

AC-PG-USBASP USBASP AVR Programmer

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

Android Controlled Based Interface

ET-BASE AVR ATmega64/128

Introduction to Arduino

An Introduction To Simple Scheduling (Primarily targeted at Arduino Platform)

SainSmart UNO R3 Starter Kit

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

Intro to Intel Galileo - IoT Apps GERARDO CARMONA

Waspmote. Quickstart Guide

E-Blocks Easy Internet Bundle

Computer Automation Techniques. Arthur Carroll

Cypress Semiconductor: Arduino Friendly PSoC Shield

Microcontrollers and Sensors. Scott Gilliland - zeroping@gmail

Workshop Intel Galileo Board

CAN-Bus Shield Hookup Guide

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

Adafruit SHT31-D Temperature & Humidity Sensor Breakout

Microtronics technologies Mobile:

Surveillance System Using Wireless Sensor Networks

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

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

An Introduction to MPLAB Integrated Development Environment

Board also Supports MicroBridge

MANUAL FOR RX700 LR and NR

SBC8600B Single Board Computer

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

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

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

Adafruit BME280 Humidity + Barometric Pressure + Temperature Sensor Breakout

UniPi technical documentation REV 1.1

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

Testing Robots Using the VEXnet Upgrade

A-307. Mobile Data Terminal. Android OS Platform Datasheet

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

Lesson 10:DESIGN PROCESS EXAMPLES Automatic Chocolate vending machine, smart card and digital camera

Android, Bluetooth and MIAC

EvB 5.1 v5 User s Guide

KTA-223 Arduino Compatible Relay Controller

ECIO40P ECIO28P ECRM40. Page 1. USB programmable microcontrollers. 0.6 DIP footprint. Supplied with a free version of Flowcode. E-blocks compatible

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

PN532 NFC RFID Module User Guide

UPiS - Uninterruptible Power intelligent Supply

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

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

FLYPORT Wi-Fi G

Adafruit MCP9808 Precision I2C Temperature Sensor Guide

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

Work with Arduino Hardware

Firmware version: 1.10 Issue: 7 AUTODIALER GD30.2. Instruction Manual

Arduino Lesson 14. Servo Motors

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

Prototyping Connected-Devices for the Internet of Things. Angus Wong

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

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

IR Communication a learn.sparkfun.com tutorial

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

Chapter 13. PIC Family Microcontroller

Computer and Set of Robots

Lab 6 Introduction to Serial and Wireless Communication

ED-3160 UBIQUITOUS SENSOR NETWORK TRAINER. USN / RFID System > EXPERIMENTS

Display Message on Notice Board using GSM

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

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.

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

Programming Arduino. Getting Started with Sketches. Simon Monk.

RN-52 Bluetooth Hookup Guide

DESIGN OF 6 DOF ROBOTIC ARM CONTROLLED OVER THE INTERNET

C4DI Arduino tutorial 4 Things beginning with the letter i

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

SYSTEM 4C. C R H Electronics Design

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

Ocean Controls RC Servo Motor Controller

Accurate Measurement of the Mains Electricity Frequency

Raspberry Pi. Hans- Petter Halvorsen, M.Sc.

Intelligent Home Automation and Security System

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Internet of Things with the Arduino Yún

Fondamenti su strumenti di sviluppo per microcontrollori PIC

Transcription:

The Arduino Micro-controller G4NAQ SHIREHAMPTON A.R.C.

Topics What is a microcontroller? What is an Arduino? Current Models of Arduino Sensors / Shields Kits Arduino Development Environment Programming the Arduino Compiling Sketches Demonstration Projects A Club Project Amateur Radio and the Arduino Useful Books & Links

What is a microcontroller? A small computer on a single circuit board often referred to system on a chip Contains a CPU, memory and I/O interfaces typically used for embedded control purposes or data analysis. The memory can be RAM, Flash or a one time program ROM Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools and toys. The Raspberry Pi is more of a computer on a board and has more memory and a faster processor

What is an Arduino? A micro-controller board based on the ATMEL AVR RISC chip with an on-board power supply and USB port AVR stands for Alf (Egil Bogen) and Vegard (Wollan)'s RISC processor who were its 2 Dutch inventors The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time An Open Source hardware platform which enables any company to produce versions of the Arduino

Current Models of Arduino All basically the same with a different board dimensions, processors, RAM and I/O configuration a bit like PC s! UNO MEGA LilyPad Nano Mini

Arduino board comparison Name Processor Operating/Input Voltage CPU Speed Analog In/Out Digital IO/PWM EEPROM [kb] SRAM [kb] Flash [kb] USB LilyPad ATmega168V ATmega328P 2.7-5.5 V / 2.7-5.5 V 8MHz 6/0 14/6 0.512 1 16 - Mega ATmega2560 5 V / 7-12 V 16 MHz 16/0 54/15 4 8 256 Regular Type B Uno ATmega328P 5 V / 7-12 V 16 MHz 6/0 14/6 1 2 32 Regular Type B Mini ATmega328P 3.3 V / 3.35-12 V 5 V / 5-12 V 8 MHz 16 MHz 6/0 14/6 1 1 32 6 pin header Nano ATmega168 ATmega328P 5 V / 7-9 V 16 MHz 8/0 14/6 0.512 1 1 2 16 32 Mini

The Arduino UNO R3 This is currently one of the most common types and in its 3 rd revision Atmel ATmega328P Microcontroller 14 digital input/output pins 6 with PWM (next page!) 6 analogue inputs 16 MHz quartz crystal Type B USB connection 2.1mm DC power socket (but can be powered via the USB socket) ICSP header (serial interface) Reset button Typically costs from 3-8 on ebay supplied with a USB cable

Digital I/O Pulse Width Modulation (PWM) Pulse Width Modulation, or PWM, is a technique for achieving analogue results with a digital means Digital control is used to create a square wave, a signal switched between on and off. The on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of time the signal is on versus the time the signal is off The duration of "on time" is called the pulse width. To achieve varying analogue values, you change, or modulate, that pulse width. Only relevant when the pin is used for output e.g. If you repeat this on-off pattern fast enough with an LED the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.

Arduino R3 Board (~ 7)

Sensors and shields Shields are boards that can be plugged on top of the Arduino PCB Sensors are boards or components used in conjunction with the I/O ports

Example Sensors & Shields available Weather Station Gas Humidity Photocell Temperature Water Switching Capacitive touch Joystick Hall effect Push button Reed switch Relays Sound Ultrasonic Misc Cellular shield CNC shield Robot shield Ethernet shield Data Logger (SD card) shield Midi shield Display (LCD, TFT & OLED) WiFi networking shield XBEE networking shield

Dupont Cables / Jumper Wires Essential wiring tool when experimenting & avoids a lot of time with a soldering iron Use with headers pins Strips available 10 30cms typically 99p Easiest way to link sensors to the Arduino pins Used to link breadboards or vero boards

Kits Lots of kits available from ~ 20 on ebay and consist of the microcontroller, shields, patch cables or breadboards with components Normally supplied with a tutorial with sample code provided to demonstrate each of the sensors

Arduino development environment Free software from www.arduino.cc referred to as the IDE (Integrated Development Environment) Constantly being developed Supported on Windows, Mac OS X and Linux Arduino programs or code are referred to as a sketch Written in C A sketch must contain at least the 2 sections of code as per the screen

Arduino \ C Coding Concepts Structure the use of curly brackets { }, ; line terminator, /* block comments */, // line comments and functions Functions a concise block of code normally written to perform a specific function. Arduino sketches contain a setup() and loop() function as a minimum Data types Byte (0-255), Integer (-32767 to 32768), Long (32 bit), Float (32 with a floating point) Character strings and arrays Variables must be declared before you can reference them Variable scope - where you define a variable in the sketch defines where it can be used/referenced Global variables - defined before the setup() can be referenced anywhere Local variables - defined inside a function can only be referenced by that function http://playground.arduino.cc/uploads/main/arduino_notebook_v1-1.pdf Note: C does contain a goto statement but its use is discouraged!

Arduino libraries Libraries provide extra functionality for use in sketches, e.g. working with hardware or manipulating data. A number of libraries come installed with the IDE, but you can also download or create your own. Ethernet GPS LCD Displays SD Card Servos WiFi

First steps.. Install the IDE Download he Arduino IDE from https://www.arduino.cc/en/main/software Install the IDE, no options to worry about

First steps.. Plug in the Arduino Plug in the Arduino to a spare USB port Windows should automatically install a new device In the control panel the Arduino will show up under the next available serial port Launch the IDE and from the tools menu select the type of Arduino you connected and the COM port. The Board Info option will then interrogate it return the following

Serial Interface You can t attach a monitor to the Arduino The easiest way to work around the lack of a monitor is the serial interface which is part of the Arduino IDE This is all a bit antiquated & reminds me of packet radio you basically have to tell the computer which COM port you are going to use & what the speed is for the data between the PC and the Arduino only saving grace is you don t have to set any other COM port settings which historically are a pain.. When you open the interface its basically a separate window & a terminal interface The demonstrations will show you more..

Compiling code Verify (the tick) Checks the syntax of the sketch Checks the presence of any libraries requested Upload (the right arrow) Converts the sketch into a machine language If no errors then uploads the machine code to the Arduino Automatic Execution Arduino resets itself & the code automatically runs! Code will keep running until the Arduino is powered off The next time power is applied it runs again and will keep running until overwritten by a new compiled sketch Other buttons are new sketch, open sketch & save sketch & open the serial terminal

Sample Code Sample code normally the same as required with the kits is installed automatically when you install the IDE.

Learning C / C++ Its inevitable at some point you will have to code something yourself even if its only the logic around how to interpret the results from a sensor. Lots of books but buy / read one specifically for Arduino programming There are lots of web sites for Arduino tutorials, the Arduino programming handbook is free & can be downloaded from http://playground.arduino.cc/uploads/main/arduino_notebook_v1-1.pdf Lots of sample code for use with the Arduino and samples with each sensor The Raspberry Pi Magazine (The MagPI) has created a really useful beginners guide https://www.raspberrypi.org/magpi-issues/essentials_c_v1.pdf

Programming & C / C++ challenges Think about what you are trying to achieve and break it down into blocks this makes it easier to write and test each part rather than a long rambling piece of code (which is also harder to maintain!) Write it down on paper possibly as a flowchart Search the Internet for sample code which may avoid having to invent it all Put comments in your code to make understanding it clearer to you & anyone else who wants to experiment with it Print off and check the code before compiling it checking for missing or extra ;, unbalanced parentheses, undefined or inappropriately defined variables Compiler Errors probably the most challenging to resolve at times, a single mistake can cause the compiler to generate 10 s of error messages most of which are then very misleading Debugging use the serial interface to track where you are in your sketch/program if there are problems

Demo 1 Temperature Sensor Arduino Nano + adapter A DHT11 combined temperature and humidity sensor

Demo 2 Home Alarm PIR A PIR Sensor which measure infrared light from nearby objects. When an object passes in front of the sensor the temperature in the sensor's field of view will change. The sensor converts the resulting change into a change in the output voltage. An LED which lights when the PIR detects movement\heat Ultrasonic sensors which bounce a signal off nearby objects The terminal (window on the PC) used to display results including the distance of the object detected by the ultrasonic sensors

Demo 3 Morse Tutor Fixed 5 character groups just like the old Datong Morse Tutor Vero board with pull down resistors on the digital pins to stop them floating 4 way switch to select A-Z, Numbers, Mixed, Mixed + Punctuation 2 * 10k pots Speaker Speed / Inter character gap Inter group gap Future additions Improve the audio using an external amp Display to replace terminal interface Variable audio tone frequency with another 10k pot + <10 lines of code

Demo 4 Morse Decoder Borrowed code based on a sketch from http://skovholm.com/cwdecoder Modified to support the I2C bus interface I2C Bus with 16*2 line LCD Display Microphone LED which flashes received morse Future additions Understand the code a bit! Connect the audio to receiver & remove the LED

Demo 5 The Finale! Project 3 sends CW Project 4 decodes it!

What next? A club Project? A WSPR Beacon Controller based on article by W3PM / GM4YRE? Weather Station @ SARC displaying information on the club website? (if we fix the Internet link!) DF Controller similar to the device built by Colin and attached to a UV5R? Other ideas?

RSGB / ebay Amateur Radio Arduino Books Recommended ~ 25 Members Price ~ 24 Members Price ~ 18 from Wordery

Useful Arduino Sites https://www.arduino.cc/ https://www.adafruit.com/ https://arduino-info.wikispaces.com/ On ebay search for Keyestudio