RAGHU ENGINEERING COLLEGE
(AUTONOMUS)
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING
SEMINAR
TOPIC: ARDUINO
Under the guidance of :
Mr.Lal Babu Prasad Presented by:
M.TECH T. GOUTHAM KRISHNA
18981A04H4
Associate professor
ARDUINO
WHAT IS A MICRO CONTROLLER
Microcontrollers are small computers integrated into a single chip
They contain
1. Processing core
2. Flash Memory for program
3. I/O peripherals
4. RAM
5. Peripherals such as clocks, timers, PWM etc
Microprocessors are used for general purpose applications, while
microcontrollers are self sufficient and are used for specific tasks.
Microcontrollers are an example of embedded systems.
WHAT IS ARDUINO?
Arduino is an open-source physical computing platform.
It is a small microcontroller board with a USB plug.
Arduino can be used to develop stand-alone interactive objects or can be
connected to software on your computer.
Easy-to-use hardware and software.
It’s intended for students, artists, designers, hobbyists and anyone who tinker
with technology.
It is programmed in Arduino Programming language(APL) similar to C/C++.
Way more easy to program compared to other microcontroller packages.
The Arduino is a microcontroller development platform(not a microcontroller….)
It is the winner of “worlds best interaction award 2012” sponsored by google.
ARDUINO
Digital or Analog?
All physical quantities are analog.
Analog means that the quantity can take any value between its
minimum value and maximum value.
Digital means that the quantity can take specific levels of values
with specific offset between each other.
Ex: 1- Digital:
English alpha consists of 26 letter, there is no letter between A
and B.
- Square waves are Digital.
Ex.: 2- Analog:
Temperature, can take any value[-1,12.8,25.002,… etc.].
- Sine waves are analog.
DIFFERENT TYPES
There are many versions of Arduino board.versions differ by
size,microcontroller,etc
shields
Printed circuit boards that sit atop an arduino
Plug into the normally supplied pin-headers of arduino.
These are expansions to the base Arduino.
For example:Arduino Ethernet shield,Xbee Shield,Touch Shield etc
Photo Resistor:
- The value of the resistance depends on
the incident light density.
- 1 K-Ohm at light, 10 K-Ohm at
darkness.
Photo Diode:
- The current is controlled by the incident light density.
Photo Transistor:
- Base-emitter junction is controlled
by the incident light density, has an
amplification effect.
ARDUINO:Software
Arduino boards can be controlled
Using an implementation of Wiring,
Which is a version of Processing
developed specifically for electronic
I/O.
Arduino looks like Processing,but
is actually built in C, so there are a
few differences to look out for.
The Arduino IDE
The arduino is programmed in C language.
The language is very simple and provides many abstraction
for simplicity of reading and writing powerfull applications.
It provides a serial monitor to see the serial data from the USB
virtual COM port.
Allows one click compiling,verification and burning of code
onto the arduino.
Arduino Programming language v/s Processing
Arduino has two reserved functions:
1. void setup()
2. void loop()
There is no pop-up display window, hence void draw() is not special.
Loop() can be considered to do the same thing as draw() for the arduino.
There are three types of variable in Arduino:
i. char
ii. int
iii. long
Arduino has a few reserved constants,which donot need to be defined:
1. HIGH//5 volts
2. LOW//0 volts
3. INPUT//pin is input
4. OUTPUT//pin is output
Conditional statements are the same as in Processing.
Functions can be defined the same as in Processing
Arduino Programming language v/s Processing
Data Types and operators
Integer: used with integer variables with value between
2147483647 and -2147483647.
Ex: int x=1200;
Character: used with single character, represent value from -
127 to 128.
Ex. char c=‘r
’;
Long: Long variables are extended size variables for number
storage, and store 32 bits (4 bytes), from -2,147,483,648 to
2,147,483,647.
Ex. long u=199203;
Floating-point numbers can be as large as 3.4028235E+38
and as low as -3.4028235E+38. They are stored as 32 bits (4
bytes) of information.
Ex. float num=1.291; [The same as double type]
Statement and operators:
Statement represents a command, it ends with ;
Ex:
int x;
x=13;
Operators are symbols that used to indicate a specific
function:
- Math operators: [+,-,*,/,%,^]
- Logic operators: [==, !=, &&, ||]
- Comparison operators: [==, >, <, !=, <=,
>= ]
Syntax:
; Semicolon, {} curly braces, //single line
comment, /*Multi-line comments*/
Statement and operators:
Compound Operators:
++ (increment)
-- (decrement)
+= (compound addition)
-= (compound subtraction)
*= (compound multiplication)
/= (compound division)
Control statements:
If Conditioning:
if(condition)
{
statements-1;
…
Statement-N;
}
else if(condition2)
{
Statements;
}
Else{statements;}
Control statements:
Switch case:
switch (var) {
case 1:
//do something when var equals 1
break;
case 2:
//do something when var equals 2
break;
default:
// if nothing else matches, do the default
// default is optional
}
Loop statements:
Do… while:
do
{
Statements;
}
while(condition); // the statements are run at least once.
While:
While(condition)
{statements;}
for
for (int i=0; i <= val; i++){
statements;
}
Use break statement to stop the loop whenever needed.
Code structure:
Void setup(){}
Used to indicate the initial values of system on starting.
Void loop(){}
Contains the statements that will run whenever the
system is powered after setup.
Input and output:
Led blinking example:
Used functions:
pinMode();
digitalRead();
digitalWrite();
delay(time_ms);
other functions:
analogRead();
analogWrite();//PWM.
Steps in Arduino programming
Open the IDE
Write code and logic
Click the verify/compile button to check your program for errors
Attach the arduino via USB to the PC
Install drivers if first time
Setup serial port being used.
Setup board which we need to program.
Click upload code to send code to arduino.
Why Arduino?
It is Open Source,both in terms of Hardware and Software.
It is cheap,(about $20,the cost of going out for pizza).
USB connectivity(MacBooks don’t have serial ports).
Simple and easy to use by someone without formal electronics
training.Editing and rewriting is often easier than writing from
scratch.That’s where the BeagleBoard falls short.”It has virtually no
example application that you can just copy and hack to learn from”.
We know simple is attractive.
CONCLUSION
Over the years, Arduino has went out to become a huge
success and a common name among students. With google
deploying it, people’s imagination has went out to much
higher level than before.
I think a study on arduino and practical experiments on
arduino must be added for UG courses of engineering, to
help students to leverage their talents, and imagination.