0% found this document useful (0 votes)
14 views

IOT BY LED, and LCD

Iot

Uploaded by

shinchen634
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)
14 views

IOT BY LED, and LCD

Iot

Uploaded by

shinchen634
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/ 46

Application Areas

Medical Systems
 pace maker, patient monitoring systems, injection
systems, intensive care units, …
Office Equipment
 printer, copier, fax, …
Tools
 multimeter, oscilloscope, line tester, GPS, …
Banking
 ATMs, statement printers, …
Transportation
 (Planes/Trains/[Automobiles] and Boats)
radar, traffic lights, signalling systems, …
ROBOTICS
Networking Applications
This program provides an introduction

to embedded systems, including


hardware design and software
engineering principles.
This course shows you how to build

solutions to real-world problems using


embedded systems in all the areas.
The course uses a bottom-up approach to problem

solving, building gradually from simple interfacing


of switches and LEDs to complex concepts like
display drivers, digital to analog conversion,
generation of sound, analog to digital conversion,
graphics, interrupts, and communication.
APPLICATION
DESIGN
GP- Input
CLK Reg port
CPU

Processor

CPU
Arithmeti Output
Register
c Logic port
Arrays
Unit

Control Unit

Memory Unit
(RAM, ROM)
Microprocessors
Noyce and Gordon
Moore started Intel
Intel designed he first
calculator
Intel designed the first
programmable calculator
Intel designed the first
microprocessor in 1971
Model 4004
4-bit; 2300 transistors,
640 bytes of memory,
108 KHz clock speed
First Processors
Intel – 8086 16-bit microprocessor, in
1978
Motorola followed with the MC68000 as
their 16-bit processor
The 16-bit processor works with 16 bit words,
rather than 8 bit words
Instructions are executed faster
Provide single instructions for more complex
instructions such as multiply and divide
16 bit processors evolved into 32 bit
processors
Intel released the 80386
Motorola released the MC68020
First Microcontrollers
IBM started using Intel processors in its
PC
Intel started its 8042 and 8048 (8-bit
microcontroller) – using in printers
Apple Macintosh used Motorola
1980 Intel abandoned microcontroller
business
By 1989 Microchip was a major player in
designing microcontrollers
PIC: Peripheral Interface Controller
Basic families of AVRs
Atmel’s
Processor Compiled Code Size Execution Time (cycles)
(bytes)

AVR 46 335

8051 112 9,384

PIC16C74 87 2,492

68HC11 57 5,244
ARDUINO
A microcontroller board, contains on-board power supply,
USB port to communicate with PC, and an Atmel
microcontroller chip.
It simplify the process of creating any control system by
providing the standard board that can be programmed
and connected to the system without the need to any
sophisticated PCB design and implementation.
It is an open source hardware, any one can get the details
of its design and modify it or make his own one himself.
Arduino boards:

UNO Mega LilyPad

Arduino BT Arduino Nano Arduino Mini


ARDUINO UNO
Features of the Arduino UNO:
Microcontroller: ATmega328
Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
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
Flash Memory: 32 KB of which 0.5 KB used by
bootloader
SRAM: 2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
Programming
Procedure:
1. Download & install the Arduino environment
(IDE)
2. Connect the board to your computer via the
UBS cable
3. If needed, install the drivers (not needed in
lab)
4. Launch the Arduino IDE
5. Select your board
6. Select your serial port
7. Open the blink example
Terminology
Status Messages
Blinking LED
(on board LED)
void setup()
{
pinMode(13, OUTPUT);
}
void loop ()
{
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
Blinking LED
EXERCISE:

On bread board LED


Two LEDs at a time
Two LEDs alternatively
 Five LEDs in series
Blinking LED ‘s in Series
void setup()
{
for (int i=2; i<=8; i++)
pinMode(i, OUTPUT);
}
void loop ()
{
for (int i=2; i<=8; i++)
{
digitalWrite(i,HIGH);
delay(500);
digitalWrite(i,LOW);
}
}
Blinking LED ‘s in Series
int smr=500;
void setup()
{
for (int i=2; i<=8; i++)
pinMode(i, OUTPUT);
}
void loop ()
{
for (int i=2; i<=8; i++)
{
digitalWrite(i,HIGH);
delay(smr);
digitalWrite(i,LOW);
}
}
Blinking LED ‘s in Series (Reverse also)
int smr=500;
void setup()
{
for (int i=2; i<=8; i++)
pinMode(i, OUTPUT);
}
void loop ()
{
for (int i=2; i<=8; i++)
{
digitalWrite(i,HIGH);
delay(smr);
digitalWrite(i,LOW);
}
for (int i=7; i>=3; i--)
{
digitalWrite(i,HIGH);
delay(smr);
digitalWrite(i,LOW);
}
}
Serial communication
void setup()
{
Serial.begin(9600); // set up Serial library at
9600 bps
Serial.println("Hello world!"); // prints hello with ending
line break
}

void loop() // run over and over again


{
Serial.println("Hello"); // do nothing!
delay (1000);
}
Math works
int a = 5; Serial.print("a + b = "); // add
int b = 10; Serial.println(a + b);
int c = 20; Serial.print("a * c = "); //
multiply
void setup()
Serial.println(a * c);
{
Serial.print("c / b = "); //
Serial.begin(9600); divide
Serial.println("Hey Iam doing Serial.println(c / b);
math:"); Serial.print("b - c = "); //
Serial.print("a =") subtract
Serial.println(a); Serial.println(b - c);
Serial.print("b = "); }
Serial.println(b); void loop()
Serial.print("c = "); {
Serial.println(c); }
LIQUID CRYSTAL DISPLAY (LCD)
Interfacing:
ARDUINO PINS LCD PINS
2,3,4,5 D4,D5,D6,D7
11 6
12 4
GROUND 1,3,5
GROUND 16
VCC 15
Blinking Cursor
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
lcd.clear();
lcd.blink();
delay(1000);
}
Setting Cursor
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
lcd.clear();
lcd.setCursor(2,1);
lcd.blink();
lcd.cursor();
delay(1000);
}
Display A Word
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print("Hello");
delay(1000);
}
Display A Words
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print("Hello");
lcd.setCursor(5,1);
lcd.print("Welcome");
delay(1000);
}
Display A group of Words
#include<LiquidCrystal.h>
lcd.clear();
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
lcd.setCursor(2, 0);
void setup()
{ lcd.print("To the Todays");
Serial.begin(9600); lcd.setCursor(3,1);
lcd.begin(16, 2); lcd.print(" Workshop on");
}
delay(4000);
void loop()
lcd.clear();
{
lcd.clear(); lcd.setCursor(2,0);
lcd.setCursor(1, 0); lcd.print("Arduino Based");
lcd.print("Hello..!"); lcd.setCursor(3,1);
lcd.setCursor(4, 1); lcd.print("Applicaions");
lcd.print("Welcome");
delay(5000);
delay(3000);
}
Scrolling String Right Side
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
lcd.setCursor(3,0);
lcd.print(" Welcome to ");
lcd.setCursor(0,1);
lcd.print("Arduino Workshop");
delay(2000);
}
void loop()
{
lcd.scrollDisplayRight(); // scroll one position
right:
delay(300); // wait a bit:
}
Scrolling String Left And Right Side
#include<LiquidCrystal.h> for (int positionCounter = 0;
positionCounter <20;
LiquidCrystal lcd(12, 11, 5, 4, 3,
positionCounter++)
2);
{
void setup()
lcd.scrollDisplayRight();
{
delay(300); // wait a bit:
Serial.begin(9600);
}
lcd.begin(16, 2); for (int positionCounter =32;
lcd.setCursor(3,0); positionCounter > 0;
lcd.print(" Welcome to "); positionCounter--)
lcd.setCursor(0,1); {
lcd.print("Arduino Workshop"); lcd.scrollDisplayLeft();
delay(2000); delay(300);
} }
void loop() delay(500);
{ }
References

www.arduino.cc
www.ladyada.net/learn/arduino
www.EarthshineElectronics.com

You might also like