[go: up one dir, main page]

0% found this document useful (0 votes)
7 views90 pages

EEE Unit 2 Peripheral Interface NOTES No

No I will not hdikfmrleodj jekfnnf fjfjjf

Uploaded by

prem16velani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views90 pages

EEE Unit 2 Peripheral Interface NOTES No

No I will not hdikfmrleodj jekfnnf fjfjjf

Uploaded by

prem16velani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Electrical and Electronics Engineering

Unit 2: Peripheral Interface

Prepared By,
Mr. Chinmay V. Deshpande
M.E. (Power System)
Department of Electrical Engineering
Interfacing of LED with Atmega 328P
LEDs are small, powerful lights that are used in many different applications

Arduino UNO has build in LED available at pin 13.


The built in LED is very useful when we want to show
some signal without connecting external LED.

Externally also we can connect LED to arduino.


For that case, we have to use resistor with some
value in between digital pin of arduino to the
LED.
Why Resistor?
Externally also we can connect LED to arduino. For that case,
we have to use resistor with some value in between digital pin
of arduino to the LED.
To limit current coming
Why Resistor R??? from Arduino UNO

LED requires 10-20mA of current but arduino pin gives around


40mA.

Due to excess current, LED may get damaged.


How to find value of Resistor (R)?

Normally, the 5mm RED LED has forward voltage (VF) of 2V


and forward current (IF) of 20mA. We know the supply
voltage (Vs) is 5V that is coming from the Arduino so we can
use the ohm’s law to calculate the value of resistor.

Nearest value we take as 220 ohm

Note: Roughly we use around 100-1kOhm resistor


Interfacing Diagram
Algorithm
In Setup function
1) Initialize digital pin 13 of arduino as OUTPUT.

In Loop function
1) Turn LED ON by using digitalWrite () function.
2) Call the delay
3) Turn LED OFF by using digitalWrite () function.
4) Call the delay
Sketch (Program)
void setup( ) // the setup function runs only once
{

pinMode(13, OUTPUT); // initialize digital pin 13 as an output.

void loop( ) // the loop function runs over and over again
{ forever

digitalWrite(13, HIGH); // Pin 13= LED. Turn LED HIGH i.e. ON

// wait for a second or 1000 milisec.


delay(1000);

digitalWrite(13, LOW); // Pin 13= LED. Turn LED LOW i.e. OFF

// wait for a second or 1000 milisec


delay(1000);
}
Interfacing of LCD with Atmega 328P
LCD stands for Liquid Crystal Display which are used in many devices such as micro
ovens, calculators etc.
Pin description of LCD

Pin no. Symbol Connection Function


1 VSS GND Arduino Signal ground
2 VDD /Vcc 5 V Arduino Logic power for LCD
3 V0 /VEE 10 kΩ potentiometer Contrast adjustment for LCD screen
4 RS Pin 2 Arduino Register select signal
5 R/W GND Arduino Read/write select signal. To print anything on LCD, we use Write. For that case, we
have to give low pulse to it i.e. connected to ground. If we want to use read
operation i.e. something is printed on LCD and if we want to use it in program, give
High pulse i.e. 5V to access it as Read. As we want to print on LCD by using Write,
we have to connect it to GND pin of Arduino.
6 E Pin 3 Arduino Operation enable signal
7 – 14 DB0 – DB7 – Data bus lines used for 8-bit mode
Pin description of LCD

Pin no. Symbol Connection Function


11 – 14 DB4 – DB7 Pin 4 – 7 Arduino Data bus lines used for 4-bit mode
15 A (LED+) 5 V Arduino Anode for LCD backlight
16 K (LED-) GND Arduino Cathode for LCD backlight
Interfacing diagram of LCD LCD pin RS is connected to
digital pin 12 of Arduino.
LCD pin Enable is
connected to digital pin
11 of Arduino.

LCD DB4 pin is connected


to digital pin 5.
LCD DB5 pin is connected
to digital pin 4.
LCD DB6 pin is connected
to digital pin 3.

LCD DB7 pin is connected


to digital pin 2.
Important points related to LCD
Important points related to LCD
Suppose we want to display “Z” in 5th Column and 2nd row. How to do it?

lcd.setCursor (4,1)
lcd.Print (“Z”)

Denotes Denotes
Column Row

As our columns starts from 0, 5th Column will be column number 4 and 2nd row is
denoted as 1. Hence we have used (4,1) here
Functions used in LCD
LiquidCrystal()
Description: This library allows an Arduino board to control Liquid Crystal displays
(LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most
text-based LCDs. The library works with in either 4- or 8-bit mode (i.e. using 4 or 8 data
lines in addition to the rs, enable, and, optionally, the rw control lines).

Syntax: #include<LiquidCrystal.h>
Functions used in LCD
begin()
Description: Initializes the interface to the LCD screen, and specifies the dimensions
(width and height) of the display. begin() needs to be called before any other LCD library
commands.

Syntax: lcd.begin(cols, rows)

A variable of type Liquid Crystal


Number of rows that display has

Number of columns that display has

As we are using 16 X 2 LCD module, in our case it will be

lcd.begin(16,2)
Functions used in LCD
clear()
Description: Clears the LCD screen and positions the LCD cursor in upper left corner

Syntax: lcd.clear()

A variable of type Liquid Crystal


Functions used in LCD
setCursor()
Description: Position the LCD cursor; that is; set the location at which subsequent text
written to LCD will be displayed.

Syntax: lcd.setCursor(col,row)

A variable of type Liquid Crystal Rows at which to position of cursor


(With 0 being the first column)
Column at which to position of cursor
(With 0 being the first column)

Ex: lcd.setCursor(5,1) i.e. Setting the cursor at 6th Column and 2nd row
Functions used in LCD
print()
Description: Print text to LCD.

Syntax: lcd.print(data)

A variable of type Liquid Crystal Data to print, like char, byte, int,
long, or string)

Ex: lcd.print(“hello world”) i.e. It prints hello world on lcd screen


Functions used in LCD
display()
Description: Turns on the LCD display, after it's been turned off with noDisplay(). This will
restore the text (and cursor) that was on the display.

Syntax: lcd.display()

A variable of type Liquid Crystal


Functions used in LCD
nodisplay()
Description: Turns off the LCD display, without losing the text currently shown on it.

Syntax: lcd.nodisplay()

A variable of type Liquid Crystal


Algorithm
Include the library code
#include<LiquidCrystal.h>

Configure the LCD interfacing pins.


Here we have used pins 12,11,5,4,3,2.
• LCD pin RS is connected to digital pin 12 of Arduino.
• LCD pin Enable is connected to digital pin 11 of Arduino.
• LCD DB4 pin is connected to digital pin 5.
• LCD DB5 pin is connected to digital pin 4.
• LCD DB6 pin is connected to digital pin 3.
• LCD DB7 pin is connected to digital pin 2.
Algorithm
In setup function.
1. Setup LCD number of columns and rows.
2. Print message on first line of LCD.

In Loop function
1. Set the cursor to respective column and row
2. Call the delay
Sketch (Program)
#include<LiquidCrystal.h> // Include LCD library

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;


// Initialize the library with number of
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
interface pins

void setup( ) // Setup LCD number of columns and rows.


{

lcd.begin(16,2); // As we have used LCD module of 16 X 2.

// Print a message to LCD.


lcd.print(“hello world”);
This is written in void setup because we want
this message continuously
}
Sketch (Program)
void loop( ) // loops consecutively, allowing your
{ program to change and respond.
lcd.setCursor(0,1); // Set the cursor to column 1 and line 2

delay(500); // Delay of 0.5 seconds.


}
Serial Communication
Communication is nothing but exchange of information between two devices. Here, the
information is nothing but data which can be anything like text documents, images,
audio or video files etc. Data can be sent or received between two systems or devices
and it is in the form of bits i.e. 0’s and 1’s.
Serial Communication
The main purpose of this serial communication is to transfer the sketch (program)
from computer to Arduino, send information to computer etc. The word serial means
"one after the other."

Serial communications provide an


easy and flexible way for your
Arduino board to interact with your
computer and other devices.

The most common type of


serial communication
protocol is UART
(Universal Asynchronous
Receiver Transmitter.)
UART (Universal Asynchronous Receiver Transmitter)
Arduino has built-in support for UART which enable serial communication.

USART (Universal Serial Asynchronous


Receiver Transmitter) is a serial
communication protocol used to
transmit/receive data serially at a specific
baud rate. The Arduino can transmit and
receive data to the PC over USB Cable. This
comes handy when we want to send the sensor
data from controller to PC.

The Arduino IDE has built-in Serial Monitor


window, which displays the data sent from
Arduino to PC. The same way we can send
data/command from Serial Monitor to Arduino.
The serial communication enables us to
control electronic devices connected to
Arduino board from PC.
Types of Serial Communication

Synchronous Serial Asynchronous Serial


Data Communication Data Communication

Devices that uses different clock


Devices that are synchronized use
sources for transmitter and
the same clock and their timing is
receiver. (a process operates
in synchronization with each other.
independently of other processes.)
Arduino USART
Arduino Uno (ATmega328) has an in-built USART which is useful for serial communication. It can be
used to communicate data between PC or various serial devices like GSM, GPS, Bluetooth, etc.

Arduino communicate with serial devices over digital


pins 0 (RXD) and 1 (TXD). Whereas it communicates
with PC/laptop over USB.

It consist of two LED indicators i.e. TX and RX are also


highlighted which are status LED used to indicate serial
transmission and reception w.r.t arduino board.

When PC transmits RX LED glow to


data serially to Arduino indicate data is
UNO over USB received.
When Arduino Uno TX LED glow to
transmits data to PC indicate data is
over USB transmitted.
Baud Rate
The rate at which the bits are transmitted is called baud or transfer rate. The baud rate is reciprocal of
the time to send one bit.

Serial communication occurs between Arduino and computer/serial devices at a same baud rate like
4800, 9600, 115200, 34800, etc. It is bits per second (bps).

One can change baud rate by selecting one of value


highlighted in image given.

If baud rate of two devices mismatched, then we


Serial Monitor Window will get nothing or garbage value.
Serial.begin() function
Description: Serial.begin is a function that is used to begin the serial communication and
also set the data transfer rate for communication i.e. baud rate.

Syntax: Serial.begin(baud_rate);

how many bits we are going to transfer in one second.

The units of baud rate is bits per second (bps) and the common values of baud rate are 9600 bps,
19200 bps, 115200 bps etc.

The preferred baud rate in most devices is 9600 bps and the default value in Arduino’s serial terminal
is also the same.

In the sketch, we will initialize the serial communication by writing Serial.begin (9600); in the setup
function.

Serial.begin(9600); // defines 9600 baud rate for serial


communication
Functions associated with Transmitting data w.r.t
Arduino UNO

1. Serial.write();

2. Serial.print();

3. Serial.println();
Serial.write() function
Description: This is the simplest output command. It is used to write some data on the Serial Port
and it send data in binary form. It sends only one byte of data at a time. A single value of 0-255. The
input to the function can be defined with a numerical value or with a character in single quotes.
This function writes binary data to the serial port.

Syntax: Serial.write (‘val’);

a value to send as a single byte is used in these characters ‘ ‘ .

Serial.write(‘1’); // It will send the byte 1 on the serial port

We can also send a String of byte via Syntax: Serial.write (“val”);


Arduino Serial Write Command.

simple byte and is used in these characters “ “

Serial.write(“CHINMAY”); // It will send the name CHINMAY on the serial


port
Serial.print() function
Description: This function is used to print data to a serial port in a form that is human
readable (character, string, number).

Syntax: Serial.print (“Value, format type (optional)”);

Character, String or number to be printed

Serial.print("The number is "); // It will print as The number is

Serial.print(123); // It will print as 123 i.e. it print the number.


In order to print only answer or number, don’t
put “ ”.

Serial.print(1.23456); // It will print as 1.23456 i.e. it print the


number. In order to print only answer or
number, don’t put “ ”.
Serial.print() function

Serial.print('N‘); // It will print as N

Serial.print(78, BIN); // It will print binary number of 78. It is 1001110

Serial.print(1.23456, 0); // It will print as 1.

Serial.print(1.23456, 2); // It will print as 1.23

Serial.print(1.23456, 4); // It will print as 1.2345

Serial.print(“\t”); // It will provide tab


Serial.println() function
Description: This function is used to print data to a serial port in a form that is human
readable (character, string, number) followed by carriage return (\r) and a new line
character i.e. ln (\n).

Syntax: Serial.println (“Value, format type (optional)”);

Character, String or number to be printed

void setup() {
Serial.begin (9600); //initiate serial communication with 9600
baud rate
}
void loop() {
Serial.println("hello"); //send data to computer
delay(1000);
}
int a = 5;
int b = 15;
int c = 20;

void setup() { // run once, when the sketch starts


Serial.begin(9600); // set up Serial library at 9600 bps

Serial.println("Here is some math: ");

Serial.print("a = ");
Serial.println(a); Here is some math

Serial.print("b = ");
a=5
Serial.println(b);

Serial.print("c = "); b=15


Serial.println(c);

Serial.print("a + b = "); // add c=20


Serial.println(a + b);
a + b=20
Serial.print("a * c = "); // multiply
Serial.println(a * c);
a*c=100
}

void loop() { // we need this to be here even though its empty


}
Functions associated with Receiving data w.r.t
Arduino UNO

1. Serial.read();

2. Serial.available();
Serial.read() function
Description: Reads incoming serial data received on RX pin of arduino.

Syntax: Serial.read()

received_data = Serial.read(); // It will read data and will save it in variable


received_data

Serial.available() function
Description: This function is used to Get the number of bytes (characters) available for
reading from the serial port. This is data that’s already arrived and stored in the serial
receive buffer

Syntax: Serial.available()
Serial.end() function
Description: Disables serial communication, allowing the RX and TX pins to be used for
general input and output. To re-enable serial communication, call Serial.begin().

Syntax: Serial.end()
Algorithm
In Setup function
1) Initialize the serial port with desired baud rate (eg.: 9600).
2) Transmit the initial message

In Loop function
1) Declare the variable with data type integer to hold the received data.
2) Check for any data received for serial port.
3) If YES, read the data into variable and retransmit the data on serial port.
Sketch (Program)

void setup( ) // the setup function runs only once


{
// defines 9600 baud rate for serial
Serial.begin(9600); communication

//It will print sentence and cursor will


Serial.println(“Serial Communication Demo)”;
go to next line.

Serial.println(“Please Send data”); //It will print sentence and cursor will go to
next line.
}
void loop( ) // the loop function runs over and over again forever
{
if(Serial.available( ) ) // Check for any data is received on serial port.

int inByte = Serial.read(); // It Reads the data by Serial.read () function and


stores it in variable inByte which is having data type as
integer.

Serial.write(inByte); // It writes data present on inByte variable to the Serial


Port

}
}
Concept of ADC Used in Arduino328P with Functions

There is a difference between


an on/off sensor (which
detects the presence of an
object) and an analog sensor,
whose value continuously
changes. In order to read this
type of sensor, we need a
different type of pin.

Arduino UNO has 6 analog pins


can be used as digital pins
(Referred as A0,A1,…..,A5)
These special pins not only tell
whether there is a voltage
applied to them, but also its
value.
Concept of ADC Used in Arduino328P with Functions

Microcontroller are called devices which deals with digital information. They only
understand “0” and “1”.

An ADC is very useful feature that converts analog voltage on a pin to digital no. By
converting from analog world to digital world, we can begin to use electronics to
interface to analog world around us.
analogRead() function

We can read analog signal from sensor by using Analog pins of


Arduino.

There are few sensors which will sense only analog values like
temperature, pressure , gas sensor etc.

The analog values send by sensor are in the form of voltages


which ranges from 0 to 5 V.

Analog Pins to connect input


(Sensors like IR, RF)
analogRead() function
It is analog input function.
Description: This function is used to read analog input voltage between 0 to 5V and will
convert this value into decimal value that will range from 0 to 1023.

Why
0 to 1023????

The reason of value 1023 is Analog Value Digital Value


because ADC in arduino works 0V 000 d
on 10 bit binary signals.
(which means max. no. is 2^10 5V 1023 d
= 1024 i.e. from 0 to 1023) 2.5 V 1023/2 =512 d
analogRead() function

Syntax: int val = analogRead (pin)

No. of pin whose mode we want to set

int val = analogRead (A0) Analog input voltage at A0 pin is read by


function. It will get converted to value from 0 to
1023 and it will be stored in variable val
having integer data type.
analogReference() function
It is analog input function.
Description: This function is used to select reference voltage type.

Syntax: analogReference (type)

analogReference (default) Going to select default voltage of arduino


board i.e. from 0 to 5V
analogWrite() function
It is digital output function.
Description: This function is used to
generate PWM waveform at digital
pins D3,D5,D6, D11, D12. (These pins
are able to produce PWM waveforms.)

Note:
Pin numbers with ~ symbol indicates
that it is used for PWM purpose.
E.g.: ~3 ~5 indicates that these pins
can be used for PWM.

~ = tilde symbol
analogWrite() function

Syntax: analogWrite (pin, Duty cycle value)

No. of pin whose mode we want to set Duty cycle


between 0 (always
OFF) to 255
(always ON)

analogWrite(5, 255) Generate PWM waveform of 100% duty


cycle at digital pin 5 of arduino.
analogWrite() function

In analogWrite() syntax, duty cycle scale is from 0 (always OFF) to 255 (always ON)

For 100% duty cycle corresponds to 255.

For 50% duty cycle, corresponding value will be 255/2 = 128

And so on……..

analogWrite(5, 128) Generate PWM waveform of 50% duty


cycle at digital pin 5 of arduino.
Temperature Sensor (LM35)
LM35 is a temperature sensor which can measure temperature in the range of -55°C to
150°C.

It is a 3-terminal device that provides analog voltage


proportional to the temperature. Higher the
temperature, higher is the output voltage.

LM35 is an analog temperature sensor. This


means the output of LM35 is an analog signal.
Arduino don't accept analog signals as their
input directly. We need to convert this analog
output signal to digital before we can feed it to a
Arduino input. For this purpose, we can use an
ADC( Analog to Digital Converter).
Temperature Sensor (LM35)
Our arduino UNO has an in built 10 bit ADC (6 channel). We can make use of this in
built ADC of arduino to convert the analog output of LM35 to digital output. Since
Arduino UNO has a 6 channel inbuilt ADC, there are 6 analog input pins numbered
from A0 to A5. Connect analog out of LM35 to any of these analog input pins of
arduino.

If the output voltage = 10mV —> temperature = 1°C


The LM35 output If the output voltage = 100mV —> temperature = 10°C
has a linear scale If the output voltage = 200mV —> temperature = 20°C
factor of +10mV/°C If the output voltage = 370mV —> temperature = 37°C
and so on.

The LM35, LM335 and LM34 are linear temperature sensors that output a voltage proportional to the
temperature value. They can be powered by the Arduino 5V pin, and to read the voltage, you use an
analog pin.
Interfacing Diagram

Pin 1 (Vcc) of LM35 is


connected to +5V of arduino
board

Since LM35 generates


Analogue value at its output
pin that’s why connect this
pin (pin 2 i.e. o/p pin) to ‘A0’
pin of Arduino board. This
pin of Arduino board is used
to receive analog data from
external source.

Last pin (pin 3: GND pin) is


connected to the GND pin of
Arduino board.
Interfacing Diagram

A0
Algorithm
1) Start

2) Declare variables for storing the temperature values. Here we will use:

float tempc ; // Variable to store temperature in degree Celsius (0C)


float tempf; //Variable to store temperature in Fahrenheit.
float Vout; //Temporary variable to hold sensor reading i.e. voltage value transmitted by LM35

3) Configure arduino A0 pin as an analog input to read LM35 sensor output. Use syntax as

pinMode(A0,INPUT)
Algorithm
5) Read temperature sensor (LM35) value and convert it into degree Celsius.

Vout=analogRead(A0); //It reads the value of specified analog pin (Here A0) and
stores in Vout variable.

Vout= (Vout*5*100)/1023;

tempc= Vout; //Storing Value in Degree Celsius

tempf= (Vout*9/5)+32 ; //Convert Degree Celsius to Fahrenheit (0°C × 9/5) + 32 = 32°F

6) Display values on Serial monitor.

7) END
Arduino analog pins can measure upto +5 volts OR the voltage on
which it is working normally +5 volts.
WHY
Vout= Arduino analog pin resolution is 1023 starting from 0 as it works on
(Vout*5*100)/1023; 10 bit binary resolution (i.e. 2^10=1024). On +5 volts input it counts
to 1023.

Suppose value read by analogRead function is “65” and it is stored in Vout variable.
This value “65” is decimal value because analogRead value reads analog input voltage
between 0 to 5 volt and it gets converted into decimal value that will range from 0 to
1023.

Hence we can write as 5 v analog signal : 1023 decimal value X= (Vout*5)/1023


=(65*5)/1023
=0.31767 V
X volts analog signal : Vout=65 decimal
value
To convert this voltage in to degree Celsius, we know that LM35
output has a linear scale factor of +10mV/°C i.e. we can say that
WHY 0.01V/°C
Vout=
(Vout*5*100)/1023;
Or we can also say that 1V corresponds to 100°C

Hence we can write as 1v : 100°C ???= 0.31767 V


*100 = 31.76°C
Which is room
0.31767 v : ??? temperature
and it is stored
in Vout
Vout= (Vout*5*100)/1023;
Sketch (Program)
const int sensor=A0; // Assigning analog pin A0 to variable 'sensor'

float tempc ; // Variable to store temperature in degree


Celsius (0C)

float tempf ; // Variable to store temperature in Fahrenheit

float Vout ; // Temporary variable to hold sensor reading


i.e. voltage value transmitted by LM35

void setup( ) // the setup function runs only once


{

pinMode(sensor,INPUT); // initialize analog pin A0 as an INPUT.

Serial.begin(9600); // define 9600 baud rate to communicate


arduino with computer.
}
Sketch (Program)
void loop( ) // the loop function runs over and over again
{ forever

Vout=analogRead(sensor); // It reads value from specified analog pin. Here


sensor= A0.
// Getting the Celsius value from 10 bit analog value
Vout=(Vout*5*100)/1023;

tempc=Vout; //Storing value in degree Celsius

//Convert degree Celsius to Fahrenheit


tempf=(Vout*9/5)+32;

Serial.print("TEMPRATURE in Degree Celsius = "); //Display sentence

Serial.print(“\t"); //Provide tab

Serial.print(tempc); //Display temperature value in degree Celsius


Sketch (Program)
Serial.println( ); //advances to the next line after printing what
you give it.

Serial.print("TEMPRATURE in Fahrenheit= "); //Display sentence

Serial.print(“\t"); //Provide tab

Serial.print(tempf); //Display temperature value in F

Serial.println( ); //advances to the next line after printing what


you give it.

delay(1000); //Wait for second.

}
https://youtu.be/9czGfmporjs
LVDT
LVDT is an acronym for Linear Variable Differential Transformer.

A linear variable differential transformer (LVDT) is an absolute measuring device that converts linear
displacement into an electrical signal through the principle of mutual induction. LVDT is used to calculate
displacement.
The main components of an LVDT are a transformer and a core.

The transformer consists of three coils — a primary and two


secondary (S1 and S2) — wound on a hollow form

The core is made of magnetically permeable material and moves


freely inside the bore of the transformer. A non-ferromagnetic shaft,
or push rod, is coupled to the core and connects to the object being
measured.
Construction of LVDT

LVDT is a transformer consisting of one primary winding P and two secondary winding S1 & S2 mounted
on a cylindrical former. The two secondary winding have equal number of turns and placed identically on
either side of the primary winding as shown in figure

A movable soft iron core is placed inside the former. Actually the movable core is made of nickel iron with
hydrogen annealed. Hydrogen annealing is done to eliminate harmonics, residual voltage of core and thus
provides high sensitivity.
Construction of LVDT

The movable core also is laminated in order to reduce eddy current loss. The assembly of laminated core is
placed in a cylindrical steel housing and end lids are provided for electromagnetic and electrostatic
shielding. The displacement to be measured is attached to this movable soft iron core.
LVDT: Working Principal
Since the primary winding of Linear Variable
Differential Transformer (LVDT) is supplied with
AC supply, it produces an alternating magnetic
flux in the core which in turn link with the
secondary winding S1 and S2 to produce emf due
to transformer action.

Emf produced in secondary winding S1 is Es1 and


that in S2 is Es2.

The magnitude of Es1 and Es2 will depend upon the magnitude of
rate of change of flux (dØ / dt) as per the Faraday’s Law.

The lower the value of ‘dt’, the more will be the emf induced. But lower value of ‘dt’
means that core is moving faster. Thus we can say that the faster the movement of
core, the greater will be the magnitude of emf induced in secondary windings.
LVDT: Working Principal

Emf produced in secondary winding S1 is


Es1 and that in S2 is Es2.
LVDT: Working Principal
To get a single output voltage from the Linear
Variable Differential Transformer (LVDT), both the
secondary winding are connected in series but in
phase opposition

Due to this connection, the net output voltage E0 of


the LVDT is given as below.

E0 = Es1 – Es2

Since the secondary windings of LVDT are identical and placed


symmetrically on either side of core, therefore under normal position
the flux linkage of both the secondary winding S1 & S2 will be same.
This means Es1 = Es2 and hence net output voltage E0 of LVDT = 0. This
position of soft iron core is called NULL position. Thus NULL position
of Linear Variable Differential Transformer is the normal position of
movable core where the net output voltage is zero.
LVDT: Working Principal
Case-1: Core is moved left to the NULL position

When core of LVDT is moved to the left of the NULL position


‘O’ as shown in figure, the flux linkage of secondary winding
S1 will become more than that of winding S2.

This means the emf induced in winding S1 will be


more than S2.

Hence Es1 > Es2

net output voltage E0 = (Es1 – Es2) = Positive. This means that


the output voltage E0 will be in phase with the primary
voltage.
LVDT: Working Principal
Case-1: Core is moved left to the NULL position
LVDT: Working Principal
Case-2: Core is moved right to the NULL position

When core of LVDT is moved to the left of the NULL position


‘A’ as shown in figure, the flux linkage of secondary winding
S2 will become more than that of winding S1.

This means the emf induced in winding S2 will be


more than S1.

Hence Es2 > Es1

net output voltage E0 = (Es1 – Es2) = negative. This means


that the output voltage of LVDT will be in phase opposition
(180 degree out of phase) with the primary voltage.
LVDT: Working Principal
Case-2: Core is moved Right to the NULL position
LVDT: Working Principal_Conclusion

The direction of movement of a physical quantity can be identified by the output voltage of LVDT. If the
output voltage E0 is positive, this means the physical quantity is moving toward left.

If the output voltage E0 is negative, this will mean that the physical quantity is moving in the right
direction from the NULL position.

The amount / magnitude of displacement is proportional to the magnitude of output voltage. The more
the output voltage, the more will be displacement. But we can’t take core out of the former; otherwise the
output voltage will become zero.

https://youtu.be/anCnrtjNLQM
LVDT: Working Principal_(In Short)
Sr. No. Core Position Emf induced in winding 2 (S1, S2) output voltage E0
1. At centre (Null Position) Es2 = Es1 E0 = Es1 – Es2=0
NULL position of Linear Variable
Differential Transformer is the
normal position of movable core
where the net output voltage is
zero.
2. Core is moved left to the Es1 > Es2 E0 = (Es1 – Es2) = Positive.
NULL position This means that the output
voltage E0 will be in phase with
the primary voltage.
3. Core is moved right to Es2 > Es1 E0 = (Es1 – Es2) = negative.
the NULL position This means that the output
voltage of LVDT will be in phase
opposition (180 degree out of
phase) with the primary voltage.
Advantages of LVDT
• No Physical Contact Between the Core and the Coils
• Long Operating Life
• Theoretically Infinite Resolution
• Easy Modification
• Low Power Consumption
• High Accuracy
• Fast Response

The distinct advantage of using an LVDT displacement transducer is that the moving core does not
make contact with other electrical components of the assembly, as with resistive types, as so
offers high reliability and long life.
Applications of LVDT
• LVDT is used to measure displacement ranging from fraction millimeter to centimeter.
• Acting as a secondary transducer, LVDT can be used as a device to measure force, weight and pressure,
etc..
LVDT Interfacing
In electronics system, LVDT is used generally with rectifier and signal conditioning device. The rectified
output is given to the signal conditioning circuit and the output of signal conditioning circuit is applied to
the analog input pin of Arduino which has build in ADC.

The displacement in core of LVDT generates analog output voltage. The analog output voltage is in the
range of 0 to 10 V.

The ATMEGA 328P is able to sense the voltage from 0 to 5V. Hence, in order to downgrade the voltage of
LVDT to 0-5V, we have to use voltage divider circuit. The output voltage is then read by analogRead()
function of Arduino. Here we are converting analog input voltage value to appropriate digital value by the
internal ADC of Atmega 328P.

The value measured here is then send to serial monitor window of Arduino IDE through USB to serial
cable. The FT232R is a USB to serial UART interface.
LVDT Interfacing Diagram
Voltage Divider Arrangement

Here, Vout = 0 to 5 V required for Arduino ADC

Here, Vin = 0 to 10 V from LVDT = VLVDT

𝟏
𝑽𝒐𝒖𝒕 = ∗ 𝟏𝟎 = 𝟓 𝑽
𝟏+𝟏
Sketch (Program)
void setup( ) // the setup function runs only once
{

pinMode(A0, OUTPUT); // initialize analog pin A0 as an output.

Serial.begin(9600); // define 9600 baud rate to communicate


arduino with computer.

Serial.println(“LVDT Interface”); //advances to the next line after printing what


you give it.

delay(1000); //Wait for second.

}
Sketch (Program)
void loop( ) // the loop function runs over and over again
{ forever

Serial.print(“Displacement= "); //Display sentence

Serial.print(analogRead(A0)= ); //Display analog value measured at analog pin A0.

delay(1000); //Wait for second.


}
Strain Gauge
A strain gauge is a resistor used to measure strain on an object. A Strain gauge is a sensor whose
resistance varies with applied force; It converts force, pressure, tension, weight, etc., into a change in
electrical resistance which can then be measured.

When an external force is applied on an object, due to which there is a deformation occurs in the shape of
the object. This deformation in the shape is both compressive or tensile is called strain, and it is measured
by the strain gauge.

Stress is defined as the object's internal resisting forces, and strain is defined as the displacement and
deformation that occur.

A strain gauge is a long length of conductor arranged in a zigzag pattern on a membrane. When it is
stretched, its resistance increases and Vice Versa.

https://youtu.be/BH8hAWRDTkA
https://youtu.be/s1WiMFQPFFo
Strain Gauge-Working
A strain gauge works on the principle of electrical conductance and its dependence on the conductor’s
geometry. Whenever a conductor is stretched within the limits of its elasticity, it doesn’t break but, gets
narrower and longer. Similarly, when it is compressed, it gets shorter and broader, ultimately changing its
resistance.

We know, resistance is directly dependent on the length and the cross-sectional area of the conductor
given by:
R= L/A

R = Resistance L = Length A = Cross-Sectional Area


Strain Gauge-Working
A strain gauge depends on the electrical resistivity of any conductor. The resistance in any conducting
device is dependent on its length as well as the cross-section area.

L1 is the original length of wire L2 is the new length after an external force is applied on it

ε = (L2-L1)/L1

Where ε =strain

Whenever an external force changes the physical parameters of an object, its electrical resistivity also
changes. A strain gauge measures this deformity by using the Gauge Factor formula.

The Gauge Factor is the GF = [ΔR / (RG * ε)]


sensitivity coefficient of strain
gauges and, is given by the ΔR = Change in the resistance caused due to strain
formula:
RG = resistance of the undeformed gauge
Interfacing of Strain Gauge with Arduino
INA 128 : Instrumentation
Amplifier

Full bridge configuration


of Strain Gauge.: When
force is applied, it
produces differential
voltage VD in between A
and B. It is order of mV.
(say nearly 10mV)

VD=0; When no force


VD>0; When force applied
Interfacing of Strain Gauge with Arduino
In order to amplify it, we
use INA 128 :
Instrumentation Amplifier

INA 128 has two


terminals –ve and +ve and
it has gain resistor (Rg)

Rg is used to vary gain of


amplifier i.e. adjust it in
such a way that it
produces output voltage
Vo in range of 0 to 5V.
(Analog)
Interfacing of Strain Gauge with Arduino
Force applied is
proportional to strain ε.

strain ε is proportional to
change in resistance.

change in resistance is
proportional to change in
output voltage VD which in
turns proportional to
analog output voltage Vo.
Based on this, we get value
of corresponding digital
output in decimal.
Sketch (Program)
void setup( ) // the setup function runs only once
{

pinMode(A0, OUTPUT); // initialize analog pin A0 as an output.

Serial.begin(9600); // define 9600 baud rate to communicate


arduino with computer.

Serial.println(“Strain Gauge Interface”); //advances to the next line after printing what
you give it.

delay(1000); //Wait for second.

}
Sketch (Program)
void loop( ) // the loop function runs over and over again
{ forever

Serial.print(“Weight= "); //Display sentence

Serial.print(analogRead(A0)= ); //Display analog value measured at analog pin A0.

delay(1000); //Wait for second.


}

Copy protected with Online-PDF-No-Copy.com

You might also like