Computing Element
Computing Element
OUTPUT
CPU
General-
Purpose Serial
RAM ROM I/O Timer
Micro- COM
Port
processor Port
Micro Computer
Microprocessors
The microprocessor can perform different sets of operations on the data it
receives depending on the sequence of instructions supplied in the given
program.
Depending on its computation of clock frequency and data handling the
generation of microprocessor was evolved to 5th generation of processor
Architecture of 8085
Architecture of ARM Cortex M3
Microcontroller
A smaller computer
void loop() {
// put your main code here, to run
repeatedly:
}
Template code
• setup : It is called only when the Arduino is
powered on or reset. It is used to initialize
variables and pin modes
• analogWrite(2,128);
Digital Write- Blinking of LED
• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
• void setup()
{ // initialize digital pin LED_BUILTIN as an output.
pinMode(9,INPUT);
Serial.begin(9600);
}
• void setup()
{
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
}
ADC Example
• // These constants won't change. They're used to give names to the pins used:
const int analogInPin = A0; // Analog input pin that the potentiometer is attached to
const int analogOutPin = 9; // Analog output pin that the LED is attached to
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(analogOutPin, outputValue);
void loop()
{
int a = analogRead(A0);
Serial.println(a);
delay(100);
}
Analog READ- Accelerometer
• const int buzz=9;
• void setup()
{
Serial.begin(9600);
pinMode(12,OUTPUT);
pinMode(buzz,OUTPUT);
}
if(a<=270 || a>=370)
{
digitalWrite(12,HIGH);
tone(buzz,1000);
}
else
{
digitalWrite(12,LOW);
noTone(buzz);
}
delay(100);
}
PROGRAMMABLE LOGIC
CONTROLLERS
PROGRAMMABLE LOGIC
CONTROLLERS (PLC)
PLC is a digital electronic device that
uses a programmable memory to store
instructions and to implement functions such
as logic, sequencing, timing, counting and
arithmetic in order to control machines and
processes and has been specifically designed
to make programming easy.
LOGIC – The term logic is used because the programming
is primarily concerned with implementing logic and
switching operations.
A+ B+, A- B+
Cylinder sequencing
Mnemonics
In ladder diagram each horizontal rung can be
programmed by the mnemonic code.
For example the operation of adding data to an
accumulator might be represented by ADDA.
Mnemonic code is also known as memory-
aiding code.
Writing a program using mnemonics is easier
because they are an abbreviated version of the
operation performed by the instruction.
Mnemonics
Mnemonics
Timers
COUNTERS
Counters are used when there is a need a count
a specified number of contact operations.
For example where items pass along a
conveyor into boxes, and when the specified
number of items has passed into a box, the
next item is diverted into another box.
Counter circuit are supplied as an internal
feature of PLCs.
up - counter
down - counter
Jump Control
Selection of a PLC
Embedded Boards
Embedded System
Embedded system is a system that has embedded software and
hardware, which makes it a system dedicated for an
application or product or a part of a larger system.
3 main components :
1. Hardware
2. Application Software
3. RTOS
Embedded Board
• For an embedded development, we need two major things
that are development board and an IDE (Integrated
Development Environment).
• A microcontroller development board also known as single
board computer is a printed circuit board (PCB) with circuitry
and hardware designed to facilitate experimentation with a
certain microcontroller boards features.
• The Development boards are combined with a processor,
memory, chipset and on-board peripherals like LCD, Keypad,
USB, serial port, ADC, RTC, Motor Driver ICs, SD card slot,
Ethernet, etc. with debugging features.
• This will save us from messing with the connections with
jumper wires and the board.
General Structure of Embedded Boards
Proprietary
SBC
Open source
Classification of Embedded board
• Proprietary SBCs are generally designed for use in end
applications or as a reference to be evaluated. These are
often industrialized designs that have gone through the
same type of testing that an end product requires and are
often integrated into end product designs.
Memory Processor
Cost Power
The raspberry pi has a small size of a credit card and it works as normal
computer at low price.
It is possible to work as a low cost server to handle web traffic.