0% found this document useful (0 votes)
74 views34 pages

Mechatronics: Arduino Board Description

The document describes Arduino boards and their components. It discusses the Arduino Uno and Arduino Mega 2560 boards. For each board, it provides technical specifications like the microcontroller, operating voltage, memory size, number of analog and digital pins. It also explains how to connect each board and use the Arduino programming environment. Functions for digital, analog and serial input/output are defined. The document concludes with review questions to assess understanding of the Arduino boards and programming concepts covered.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views34 pages

Mechatronics: Arduino Board Description

The document describes Arduino boards and their components. It discusses the Arduino Uno and Arduino Mega 2560 boards. For each board, it provides technical specifications like the microcontroller, operating voltage, memory size, number of analog and digital pins. It also explains how to connect each board and use the Arduino programming environment. Functions for digital, analog and serial input/output are defined. The document concludes with review questions to assess understanding of the Arduino boards and programming concepts covered.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 34

MECHATRONICS

Module 2
Arduino Board Description
by
Mr. CH.RAJENDRA PRASAD
Assistant Professor
Department of Electronics and Communication Engineering
Index
 Bread board Connections
 Arduino Board Description
 Arduino Uno
 Arduino Mega 2560
Module Learning Outcomes
 construct prototype circuits with a breadboard
 Explain Arduino boards (UNO & MEGA) and basic components.
 Experiment with Arduino environment (Arduino programming language
and IDE)
Topic Learning Outcomes

S. No. TLO CO BL
Addressed
1 Describe mechatronic system using key elements CO1 L2
2 Identify real time mechatronics systems CO1 L3
3 Explain Arduino boards (UNO & MEGA) and basic CO5 L2
components
4 Develop prototype circuits and connect them to the CO6 L3
Arduino
5 Design low level Smart systems applications CO6 L6
Bread board Connections
Breadboards conduct along the lines
The long lines are usually used for the voltage
source (+) and (-)
ACTIVITY
Connect these circuits on the bread board
VCC 220 ohm VCC
VCC 220 ohm

220 ohm
220 ohm

220 ohm
220 ohm
220 ohm 220 ohm

220 ohm

220 ohm
220 ohm

Assessment Process:

Question TLO Addressed CO Addressed


1 TLO 4 CO 6
2 TLO 4 CO 6
3 TLO 4 CO 6
ARDUINO
Arduino is an open-source electronics platform based on easy-

to-use hardware and software.


Arduino Board Description
Arduino Uno:
Technical Specifications
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (limits) 6-20V
Input Voltage (recommended) 7-9V
Digital I/O Pins 14 (6 - PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB
SRAM 2 KB
EEPROM 1 KB
Clock Speed 16 MHz
Working with Arduino Uno
 Connect Arduino Uno to PC with USB cable
 Select Tools  Board  Arduino/Genuino Uno

 Select Tools  Port  Com8


Arduino Board Description
Arduino Mega 2560:
Technical Specifications
Microcontroller ATmega2560
Operating Voltage 5V
Input Voltage (limits) 6-20V
Input Voltage (recommended) 7-12V
Digital I/O Pins 54 (14 - PWM output)
Analog Input Pins 16
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 256 KB
SRAM 8 KB
EEPROM 4 KB
Clock Speed 16 MHz
Working with Arduino Mega 2560
 Connect Arduino Uno to PC with USB cable
 Select Tools  Board  Arduino/Genuino Mega or Mega 2560

 Select Tools  Port  Com14


Arduino Programming
A program for Arduino is called a sketch.
Arduino programs are written in C, however
many of the details are hidden from the user:
Arduino programming language can be divided
in three main parts:
Functions

Values (variables and constants)

Structure
Functions
Functions allow structuring the programs in segments of code
to perform individual tasks.

Advantages of functions:
codify one action in one place and debugged once

helps to conceptualize the program.

makes the code more readable

make the whole sketch smaller and more compact because

sections of code are reused many times


There are two required functions (called by the system) in an
Arduino sketch. Those are:

 setup(): a function run once at startup that


performs initialization

 loop(): a function called repeatedly until the


board powers off

Other functions must be created outside the brackets of these


two functions.
The structure of arduino programs
common syntax of a function
Digital I/O functions
pinMode( ):
Configures the specified pin to behave either as an input
or an output.

Syntax: pinMode(pin, mode)

Parameters:

pin: The number of the pin

mode: INPUT, OUTPUT,

Returns: Nothing
digitalWrite( ):
Write a HIGH or a LOW value to a digital pin

Syntax: digitalWrite(pin, value)

Parameters:

pin: the number of the digital pin you want to write

value: HIGH or LOW

Returns: Nothing
digitalRead( ):
Reads the value from a specified digital pin,
either HIGH or LOW

Syntax: digitalRead(pin)

Parameters:

pin: The number of the digital pin

Returns: HIGH or LOW


Example Code
Analog I/O functions
analogRead( ):
Reads the value from the specified analog pin.

Syntax: analogRead(pin)

Parameters:

pin: The number of the analog input pin

Returns: int(0 to 1023)


analogWrite( ):
Writes an analog value to a pin .

Syntax: analogWrite(pin, value)

Parameters:

pin: The number of analog pin to write to

value: int(0 to 255)

Returns: Nothing
Example Code
Timer functions
Delay( ):
Pauses the program for the amount of time (in
milliseconds) specified as parameter.

Syntax: delay(ms)

Parameters:

ms: The number of milliseconds to pause

Returns: Nothing
delayMicroseconds( ):
Pauses the program for the amount of time (in
microseconds) specified as parameter.

Syntax: delayMicroseconds(us)

Parameters:

us: The number of microseconds to pause

Returns: Nothing
Serial I/O functions
Serial.begin( ):
Sets the data rate in bits per second (baud) for serial data
transmission.

Syntax: Serial.begin(speed)

Parameters:

speed: in bits per second (baud)

Returns: Nothing
Serial.print( ):
Prints data to the serial port as human-readable ASCII
text.

Syntax: Serial.print(val)

Parameters:

val: the value to print - any data type

Returns: Nothing
Serial.println( ):
Prints data to the serial port followed by a carriage return.
Syntax: Serial.println(val)
Parameters:
val: the value to print - any data type
Returns: Nothing
Review Questions
 Which of the following function runs only once [ ]
a. delay() b. setup() c. delayVal() d. loop()
 In Arduino Mega 2560, analog output pins are of _bit resolution [ ]
(a) 10 (b) 8 (c) 16 (d) 14
 Arduino Mega 2560 operating voltage is _____________ [ ]
(a) 10V (b) 15V (c) 5V (d) 12V
 Operating frequency of ATMega 2560 is [ ]
(a) 16 KHz (b) 16 MHz (c) 16GHz (d) 16THz
 Arduino Mega 2560 has ________numbers of analog inputs [ ]
(a) 10 (b) 8 (c) 16 (d) 14
Review Questions Cntd.
 ________Function is used to configure the digital pins of

arduino.

 Arduino Mega 2560 has _______ number of analog pins.

 Arduino Mega 2560 has _____number of digital I/O pins.

 Arduino Uno has _____________ number of analog pins.

 Arduino Uno has __________ number of digital I/O pins.

Assessment Process:
Question TLO Addressed CO Addressed
1- 10 TLO 3 CO 5
THANK YOU

Questions…..?

You might also like