2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering.

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

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)
ELECTRICAL. Circuits Outline Power Hub Microcontroller Sensor Inputs Motor Driver.
How to Build a Digital-Physical System-Lab Assegid Kidané Fall 2014.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Khaled A. Al-Utaibi  What is Arduino?  Arduino Boards  Arduino Shields  Arduino Uno Hardware.
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Arduino John Marcoux Christopher Lesch Thomas Dodge Unless otherwise noted, all information and pictures came from:
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
328eForth for Arduino Uno C. H. Ting February 16, 2012 SVFIG.
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?
Ryan Courtney Senior Design II Advisor: Junkun Ma.
Daniel Pickem and Rowland O’Flaherty 12/04/2012 Mechatronics (ME 6405) Student Lecture On Arduinos *Some slides courtesy of Eoin Brazil
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Microcontroller Presented by Hasnain Heickal (07), Sabbir Ahmed(08) and Zakia Afroze Abedin(19)
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
Designing with Components Wilmer Arellano. How to chose a Microcontroller Choose one that you are familiar with or that is easy to learn.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 1 Getting Started to Arduino.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Unconventional User Interface // // Mood Based Navigation Sheo // 1Haring, Naderer, Zachhuber Arduino  Open Source Project (HW u. SW)  Analog.
Samuel John Vinod Kumar CG Ganesh Raam K. Introduction  The need for health consciousness has increased in the recent past and so is the need to monitor.
QUAD POD TRANSFORMABLE VEHICLE Supervisor: Dr. Samer Mayaleh Ala’ Lahham Basmah AbdAlrahman Leena Talalweh Department of Electrical Engineering Quadpod.
智慧電子應用設計導論(1/3) Arduino MEGA 2560
Microcontrollers, Microcomputers, and Microprocessors
Internet of everything
MICROCONTROLLER INTERFACING WITH STEPPER MOTOR MADE BY: Pruthvirajsinh Jadeja ( ) COLLEGE:DIET BRANCH:EC.
Microcontroller basics Embedded systems for mortals.
Pulse-Width Modulation: Simulating variable DC output
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.
Application Case Study Christmas Lights Controller
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
Obstacle avoiding robot { pixel }
Scrolling LCD using Arduino.
Arduino Based Industrial appliances control system by decoding dual tone multi frequency signals on GSM / CDMA network. Submitted by:
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
Home automation using Arduino & ‘PIR sensor’
Microcontroller basics
Automatic human detector garbage can.
Microprocessors Tutorial 1: Arduino Basics
UTA010 : Engineering Design – II
UCD ElecSoc Robotics Club 2017/2018
Lab 1: Arduino Basics Topics: Arduino Fundamentals, First Circuit
ARDUINO LINE FOLLOWER ROBOT
Arduino Part 1 Topics: Microcontrollers Programming Basics
‘SONAR’ using Arduino & ultrasonic distance sensor
The Arduino Microcontroller: Atmel AVR Atmega 328
Introduction to Arduinos
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.
Introduction to Microprocessors and Microcontrollers
Journey: Introduction to Embedded Systems
CSCI1600: Embedded and Real Time Software
Arduino : Introduction & Programming
8051 Micro Controller.
CSCI1600: Embedded and Real Time Software
Manual Robotics ..
Introduction to Arduino
Arduino Board.
Arduino म्हणजे काय?.
Introduction to Arduinos
Introduction to arduino
Presented By,  Mamata Yadav (BE Elex & Comm.) Vice R&D Coordinator(HW), PCRT  Payal Shah (BE Elex & Comm.)  Ananta Das (BE Elex & Comm.) R&D Team,PCRT.
Presentation transcript:

2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering   

Course Contents A.Microcontroller Overview B.Arduino Uno C.Software Sketch D.Application 1 – LED Blinking E.Application 2 – LED and Button F.Application 3 – Analog Input G.Application 4 – LCD Keypad H.Demonstration – Line Following Mobile Robot

Learning Outcome At the end of this course the participant will be able to: Recognize the variety of open microcontroller system. Familiar with Arduino Uno microcontroller configuration. Construct an application of Arduino-based microcontroller system.

Microcontroller System What is a microcontroller? It has Processor, ROM, RAM, and other peripheral such as input/output digital, analog to digital convertor (ADC), timer/counter, pulse width modulation (PWM), interrupt, Universal Synchronous Asynchronous Receiver Transmitter (USART), inter-integrated circuit (I2C), serial peripheral interface (SPI). Can be differentiate with processing size: 8, 16 and 32 bits. Processing speed: Hz – needs internal or external clock generator to be executed.

Microcontroller Prototyping Platform Arduino (arduino.cc) Pinguino (pinguino.cc) Maple (leaflabs.com) Sparkcore (spark.io) mbed (mbed.org) Raspberry pi (raspberrypi.org) Beaglebone (beagleboard.org) HARDWARE SOFTWARE follow Arduino Technology

MicrocontrollerAtmel AVR - ATmega328 Operating Voltage5V Input Voltage (recommended) 7-12V Input Voltage (limits)6-20V Digital I/O Pins14 (of which 6 provide PWM output) Analog Input Pins6 DC Current per I/O Pin40 mA DC Current for 3.3V Pin50 mA Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader SRAM2 KB (ATmega328) EEPROM1 KB (ATmega328) Clock Speed16 MHz Length68.6 mm Width53.4 mm Weight25 g Arduino Uno

7

8

Software Sketch A sketch: uses for a program by Arduino community that contains the unit of code would be uploaded to and run on an Arduino board. It relies on C language. Therefore, we have to familiar on how to create Structure Variables Functions or subroutines or Refer to Arduino Cheat Sheet

Application 1 – LED Blinking 1.Problem Definition: Construct a system for LED blinking (ON and OFF) every 1s on D13 pin of Arduino Uno microcontroller 2.Knowledge needed: Sinking or sourcing mode for digital output interface. 3.Identify the suitable components and construct its circuit. 4.Need to use Digital Output and Delay Functions: pinMode(pin,direction) digitalWrite(pin,value) delay(value in ms) using Sequential Programming method

Application 2 – LED and Button 1.Problem Definition: Create a system for LED ON when a button is pressed and LED OFF whenever the button is released by using Arduino Uno microcontroller. 2.Knowledge needed: Sinking or sourcing mode for digital output interface and pull-up or down resistor for digital input interface. 3.Identify the suitable components and construct its circuit. 4.Need to use Digital I/O Functions: pinMode(pin,direction) digitalWrite(pin,value) digitalRead(pin) using Sequential Programming method

Application 3 – Analog Input 1.Problem Definition: Construct a temperature indication system which has LM35 that connected to an analog pin of Arduino Uno microcontroller. When temperature reading over than 30°C, a LED indicator will be ON. 2.Knowledge needed: ADC and digital output interface mode. 3.Identify the suitable components and construct its circuit. 4.Need to use Analog Input and Digital I/O Functions: pinMode(pin,direction) digitalWrite(pin,value) analogRead(pin) using Sequential Programming method

Application 4 – LCD Keypad 1.Problem Definition: Develop an user interface shield which consists of an Alphanumeric LCD and analog keypad for Arduino Uno microcontroller. 2.Knowledge needed: Analog keypad input and LCD interface. 3.Identify the suitable components and construct its circuit. 4.Need to use Analog Input and LCD Functions: #include LiquidCrystal(rs, enable, d4, d5, d6, d7) lcd.begin(cols, rows) lcd.setCursor(col, row) lcd.print(data) analogRead(pin) Further Information For_Arduino_SKU:_DFR0009 using Sequential Programming method

Arrow- bot A Teaching Tool A line following differential wheel mobile robot LabelComponents 15 Voltage Battery Supply 2L293DNE Motor Driver 3Power ON/OFF Switch 4LED Indicator 52 x Motors DC 6Programmer Pin 7Inter-integrated Communication 8ATmega328P with Arduino Uno Bootloader 9Serial Peripheral Interface 10Start Button 11Reset Button TOP VIEW BOTTOM VIEW

System Architecture Arduino Pin Assignment

PCB – using Proteus Ares

Software Algorithm (Procedure) 1.setup() 1.Configure output and input pins 2.Wait for user button activation. During waiting activity, read analog sensor data and send to UART for debugging purpose. 2.loop() 1.Read or update analog sensor data 2.Convert analog sensor data to Boolean data and update LED indicator 3.Control motor based on Boolean data as in the table. MOVEMENTIRLIRMIRR Straight Left110 Heavy Left100 Right011 Heavy Right001 Stop000 using Sequential Programming method

Arduino Sketch = Program Code #define LEDL 7 #define LEDM 4 #define LEDR 8 #define IRL 1 #define IRM 2 #define IRR 3 #define LEDL_ON digitalWrite(LEDL,HIGH) #define LEDM_ON digitalWrite(LEDM,HIGH) #define LEDR_ON digitalWrite(LEDR,HIGH) #define LEDL_OFF digitalWrite(LEDL,LOW) #define LEDM_OFF digitalWrite(LEDM,LOW) #define LEDR_OFF digitalWrite(LEDR,LOW) boolean IRL_STATUS, IRM_STATUS, IRR_STATUS; //status for line detection or not. using Sequential Programming method

void Motor(uint8_t speed1, uint8_t speed2) { speed1=map(speed1,0,100,0,255); speed2=map(speed2,0,100,0,255); //=======================MOTOR1 analogWrite(3,0); //PWM1 analogWrite(5,speed1); //PWM2 //=======================MOTOR2 analogWrite(6,speed2); //PWM3 analogWrite(9,0); //PWM4 } void setup() { pinMode(LEDL,OUTPUT); pinMode(LEDM,OUTPUT); pinMode(LEDR,OUTPUT); pinMode(2,INPUT); Serial.begin(9600); while(digitalRead(2)==HIGH) //Wait for user button and used for debugging { Serial.print(analogRead(IRL)); Serial.print("\t"); Serial.print(analogRead(IRM)); Serial.print("\t"); Serial.println(analogRead(IRR)); } using Sequential Programming method

void loop() { //READ SENSOR======================================== int data_IRL = analogRead(IRL); int data_IRM = analogRead(IRM); int data_IRR = analogRead(IRR); //UPDATE SENSOR STATUS AND LED INDICATOR============= if((data_IRL > 154)&&(data_IRL < 460)) {IRL_STATUS=HIGH; LEDL_ON;} else {IRL_STATUS=LOW; LEDL_OFF;} if((data_IRM > 154)&&(data_IRM < 460)) {IRM_STATUS=HIGH; LEDM_ON;} else {IRM_STATUS=LOW; LEDM_OFF;} if((data_IRR > 154)&&(data_IRR < 460)) {IRR_STATUS=HIGH; LEDR_ON;} else {IRR_STATUS=LOW; LEDR_OFF;} //MOTOR CONTROL====================================== if((IRL_STATUS&&IRM_STATUS&&IRR_STATUS)||(!IRL_STATUS&&IRM_STATUS&&!IRR_STATUS)) Motor(100,70); //STRAIGHT else if(IRL_STATUS&&IRM_STATUS&&!IRR_STATUS) Motor(60,70); //MOVE LEFT else if(IRL_STATUS&&!IRM_STATUS&&!IRR_STATUS) Motor(0,70); //MOVE HEAVY LEFT else if(!IRL_STATUS&&IRM_STATUS&&IRR_STATUS) Motor(100,40); //MOVE RIGHT else if(!IRL_STATUS&&!IRM_STATUS&&IRR_STATUS) Motor(100,0); //MOVE HEAVY RIGHT else if(!IRL_STATUS&&!IRM_STATUS&&!IRR_STATUS) Motor(0,0); //STOP } using Sequential Programming method

Conclusion Hope that you have: Know the variety of open microcontroller system available in the market. Familiar with Arduino Uno microcontroller pin mapping configuration. {Main business} Confident in designing, developing and testing any application of Arduino-based microcontroller system by referring closely in Arduino website. Tips for starting the system design are draw the system architecture, identify the microcontroller pin assignment and draw software algorithm before sketch the program.