Microcontroller
● It is designed to perform specific Applications
● It has got fixed amount of RAM, ROM and other
peripheral components on a single chip
● Applications: Keyboards, Mouse, Washing machine,
Digicam etc
1
Arduino
Arduino Boards
Arduino Nano Arduino Mini Arduino Mega
Wi-Fi Enabled Boards
Node MCU ESP8266
Raspberry pi
Arduino UNO
Arduino Components
• Microcontroller
ATmega328
• Operating Voltage 5V
• Input Voltage
(recommended)7-12V
• Digital I/O Pins 14
• (of which 6 provide
PWM output)
• Analog Input Pins 6
• DC Current per I/O Pin
40 mA
• DC Current for 3.3V
Pin 50 mA
Arduino Software
• Download Software
• unzip the folder.
• launch the programming environment.
• install a driver that comes with Arduino -
communication
http://arduino.cc/en/Main/Software
Compile
(verify)
Upload
ode
al C r)
c tu ito
A Ed
(
Message Box
Configuring IED
e
C od
t u a l o r)
Ac Edit
(
Board Name
&
Port No.
Serial Monitor
Serial Monitor
ode
al C r)
c tu ito
A Ed
(
Instructions
1. pinMode( pin number, state );
state- INPUT/OUTPUT
pin number- pin you are using
2. digitalWrite( pin number , state );
state- HIGH/LOW
3. digitalRead( pin number);
4. analogRead( pin number);
pin number- 3,5,6,9,10,11
analog value- 0 to 255 (depends on speed)
Arduino Programing
Two mandatory functions:
1. void setup()
{
// the setup routine runs once when you press reset or
when you powered it ON.
}
2. void loop()
{
// the loop routine runs continuously
}
PROGRAM TO BLINK AN LED
int led = 13;
// the setup routine runs once when you press reset
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage
level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage
LOW
delay(1000); // wait for a second
}
Ultrasonic Sensor
Ultrasonic Sensor
Infrared Sensor
Infrared Sensor
PIR Sensor
PIR Sensor
LDR Sensor
*Some LDR sensors Might only have DO port
LDR Sensor
DHT11 temperature and Humidity Sensor
DHT11 temperature and Humidity Sensor
DHT11 temperature and Humidity Sensor
DHT11 temperature and Humidity Sensor
Sound Sensor
Sound Sensor
Thank You