SlideShare a Scribd company logo
1 of 54
Download to read offline
UNIT-2
Peripheral Interface
Prof. K. R. Rane
Electrical Department
K.K.W.I.E.E.R
Learning Outcomes-
➔ What is LED?
➔ Interfacing of LED with Arduino UNO Board
➔ Coding or Algorithm
➔ What is LCD?
➔ Interfacing of LCD with Arduino UNO Board
➔ Serial communication using Arduino IDE
➔ Concept of ADC in ATMEGA 328
➔ Interfacing of temperature sensor with Arduino board, LVDT, Strain
gauge
What is LED?
● A light-emitting diode (LED) is a semiconductor device that emits light when an
electric current flows through it.
● Features: Long lifespan, Low cost & size, high luminance, low power
consumption, Energy Efficiency.
Interfacing of ATMEGA 328 based Arduino board with LED
● LED cathode is connected to GND.
● GPIO pin no. 9 of board is connected
With LED anode through resistor
(It’s value is inversely proportional to
current & brightness of LED).
Program or Code:
void setup()
{
pinMode(9, OUTPUT); // initialize digital pin 9 as an output.
}
void loop() // the loop function runs over and over again forever
{
digitalWrite(9, HIGH ); // turn the LED ON by making the voltage
HIGH
delay(1000); // Wait for a second
digitalWrite(9, LOW); // turn the LED ON by making the voltage
LOW
delay(1000); // Wait for a second
}
To connect 3 LED’s with Arduino:
Code:
void setup()
{
pinMode (5, OUTPUT);
pinMode (6, OUTPUT);
pinMode (7, OUTPUT);
}
void loop()
{
digitalWrite (5, HIGH);
digitalWrite (6, HIGH);
digitalWrite (7, HIGH);
delay (5000);
digitalWrite (5, LOW);
digitalWrite (6, LOW);
digitalWrite (7, LOW);
delay (5000);
}
What is LCD?
● LCD is a flat display technology, stands for "Liquid Crystal Display”.
● Used in computer monitors, instrument panels, cell phones, digital cameras, TVs,
laptops, tablets, and calculators.
● It is a thin display device that offers support for large resolutions and better picture
quality.
● 16×2 LCD display is shown below:
Interfacing of LCD with ATMEGA 328 based Arduino board:
Figure: Circuit diagram of connecting 16*2 LCD with Arduino board
Code or algorithm:
#include <LiquidCrystal.h> // initialize the library
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup()
{
lcd.begin(16, 2);
lcd.print("hello, world!");
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print(“Hello,world!” );
serial.println (“Hello,world!”);
lcd.setCursor(0, 1);
lcd.print(“Hi….”);
serial.println (“Hi…”);
}
Example to blink the output on LCD:
#include <LiquidCrystal.h> // initialize the library
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup()
{
lcd.begin(16, 2);
}
void loop()
{
lcd.clear();
delay(1000);
lcd.setCursor(0, 0);
lcd.print(“Hello….! );
lcd.setCursor(0, 1);
lcd.print(“Hi….”);
delay(1000);
}
Serial communication using Arduino IDE:
● Arduino UNO pins 0 &1 are of UART used for serial communication.
● UART requires two pins for communication: Tx & Rx.
● Connection of Atmega328 on Arduino Uno board to PC:
Algorithm:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(“Hello!, Welcome to the Arduino world”);
delay(1000)
}
Concept of ADC in Atmega328 based arduino board:
ADCSRA – ADC Control and Status Register A:-
Bit 7 6 5 4 3 2 1 0
0x7A ADEN ADSC ADATE ADIF ADIE ADPS2 ADPS1 ADPS0
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 0
● Bit 7 – ADEN: ADC Enable: Writing this bit to one enables the ADC. By writing it to
zero, the ADC is turned off. Turning the ADC off while a conversion is in progress, will
terminate this conversion.
● Bit 6 – ADSC: ADC Start Conversion: In Single Conversion mode, write this bit to one
to start each conversion. In Free Running mode, write this bit to one that will take 25
ADC clock cycles instead of the normal 13 This first conversion performs initialization of
the ADC. ADSC will read as one as long as a conversion is in progress. When the
conversion is complete, it returns to zero.
● Bit 5 – ADATE: ADC Auto Trigger Enable: When this bit is written to one, Auto
Triggering of the ADC is enabled. The ADC will start a conversion on a positive edge of
the selected trigger signal. The trigger source is selected by setting the ADC Trigger Select
bits, ADTS in ADCSRB.
● Bit 4 – ADIF: ADC Interrupt Flag:
This bit is set when an ADC conversion completes and the Data Registers are updated.
The ADC Conversion Complete Interrupt is executed if the ADIE bit and the I-bit in
SREG are set. ADIF is cleared by hardware when executing the corresponding interrupt
handling vector.
● Bit 3 – ADIE: ADC Interrupt Enable:
When this bit is written to one and the I-bit in SREG is set, the ADC Conversion
Complete Interrupt is activated.
● Bits 2:0 – ADPS[2:0]: ADC Prescaler Select Bits: These bits determine the division
factor between the system clock frequency and the input clock to the ADC.
● ADPS2 ADPS1 ADPS0 Division Factor
0 0 0 2
0 0 1 2
0 1 0 4
0 1 1 8
1 0 0 16
1 0 1 32
1 1 0 64
1 1 1 128
ADCSRB – ADC Control and Status Register B:
Bit 7 6 5 4 3 2 1 0
– ACME – – – ADTS2 ADTS1 ADTS0
Read/Write R R/W R R R R/W R/W R/W
Initial Value 0 0 0 0 0 0 0
0
● Bit 7,5,4 ,3:Reserved bits:Input
This bits are used for future purpose.
● Bit 6-ACME:
ACME=1 & ADC is switched off, ADC multiplexer selects input connected at
ADC channels as negative input to the analog comparator.
ACME=0 AIN1 acts as negative terminal of analog comparator.
Bit 2:0 – ADTS[2:0]: ADC Auto Trigger Source selection
If ADATE in ADCSRA is written to one, the value of these bits selects which source will trigger an ADC
conversion.
ADTS2 ADTS1 ADTS0 Trigger Source
0 0 0 Free Running mode
0 0 1 Analog Comparator
0 1 0 External Interrupt Request 0
0 1 1 Timer/Counter0 Compare Match A
1 0 0 Timer/Counter0 Overflow
1 0 1 Timer/Counter1 Compare Match B
1 1 0 Timer/Counter1 Overflow
1 1 1 Timer/Counter1 Capture Event
ADMUX – ADC Multiplexer Selection Register:
Bit 7 6 5 4 3 2 1 0
0x7C REFS1 REFS0 ADLAR – MUX3 MUX2 MUX1 MUX0
Read/Write R/W R/W R/W R R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 0
Bit 7:6 – REFS[1:0]: Reference Selection Bits:
Bit 5 – ADLAR: ADC Left Adjust Result
The ADLAR bit affects the presentation of the ADC conversion result in the ADC Data
Register. Write one to ADLAR to left adjust the result. Otherwise, the result is right
adjusted.
• Bits 3:0 – MUX[3:0]: Analog Channel Selection Bits
The value of these bits selects which analog inputs are connected to the ADC.
MUX[3:0]
Single Ended
Input
0000 ADC0
0001 ADC1
0010 ADC2
0011 ADC3
0100 ADC4
0101 ADC5
0110 ADC6
0111 ADC7
1000
ADC8(for internal temperature
sensor)
1001 (reserved)
1010 (reserved)
1011 (reserved)
1100 (reserved)
1101 (reserved)
1110 1.1V (VBG)
1111 0V (GND)
ADCL and ADCH – The ADC Data Register: ADLAR = 1 :When
an ADC conversion is complete, the result is found in these two registers. A total of 10 bits
of conversion result is stored in these two registers.
Bit 15 14 13 12 11 10 9 8
0x79 ADC9 ADC8 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2
Read/Write R R R R R R R R
Bit 7 6 5 4 3 2 1 0
0x78 ADC1 ADC0 – – – – – –
Read/Write R R R R R R R R
Bit 15 14 13 12 11 10 9 8
0x79 – – – – – – ADC9 ADC8
Read/Write R R R R R R R R
Bit 7 6 5 4 3 2 1 0
0x78 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2 ADC1 ADC0
Read/Write R R R R R R R R
ADLAR = 0
DIDR0 – Digital Input Disable Register 0:
Bit 7 6 5 4 3 2 1 0
0x7E – – ADC5D ADC4D ADC3D ADC2D ADC1D ADC0D
Read/Write R R R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0
0
Bit 5:0 – ADC5D…ADC0D: ADC5…0 Digital Input Disable
When this bit is written logic one, the digital input buffer on the corresponding
ADC pin is disabled. The corresponding PIN Register bit will always read as zero
when this bit is set. When an analog signal is applied to the ADC5…0 pin and the
digital input from this pin is not needed, this bit should be written logic one to
reduce power consumption in the digital input buffer.
What is temperature sensor?
● The Temperature Sensor LM35 series are precision
integrated-circuit temperature devices with an output
voltage linearly proportional to the Centigrade
temperature.
● The LM35 device calibrated in Kelvin.
● The LM35 device does not require any external
calibration or trimming to provide typical accuracies
of ±¼°C at room temperature and ±¾°C over a full
−55°C to 150°C temperature range.
Features:
● Calibrated Directly in Celsius (Centigrade)
● Linear + 10-mV/°C Scale Factor.
● 0.5°C Ensured Accuracy (at 25°C)
● Rated for Full −55°C to 150°C Range.
● Suitable for Remote Applications.
● Low-Cost Due to Wafer-Level Trimming.
● Operates From 4 V to 30 V.
Interfacing of LM35 with arduino:
Program:
Float T;
void setup() {
pinMode(A1,INPUT);
Serial.begin(9600);}
void loop() {
temp = (4.882* analogRead(A1))/10;
Serial.print("Temperature = ");
Serial.print((float)T);
Serial.println("degree C");
delay(1000); }
What is LVDT?
● The term LVDT stands for the Linear
Variable Differential Transformer.
● It is the most widely used inductive
transducer that converts the linear motion into
the electrical signal.
● The output across secondary of this
transformer is the differential.
● The transformer consists of a primary winding P and two secondary windings S1 and S2
wound on a cylindrical former (which is hollow in nature and contains the core).
● Both the secondary windings have an equal number of turns and we place them on either
side of primary winding
● The primary winding is connected to an AC source which produces a flux in the air gap
and voltages are induced in secondary windings.
● A movable soft iron core is placed inside the former and displacement to be measured is
connected to the iron core.
● The iron core is generally of high permeability which helps in reducing harmonics and
high sensitivity of LVDT.
● The LVDT is placed inside a stainless steel housing because it will provide electrostatic
and electromagnetic shielding.
● The both the secondary windings are connected in such a way that resulted output is the
difference between the voltages of two windings.
Principle of Operation and Working:
● CASE I When the core is at null position (for no displacement)
When the core is at null position then the flux linking with both the secondary windings is
equal so the induced emf is equal in both the windings. So for no displacement the value of
output eout is zero as e1 and e2 both are equal. So it shows that no displacement took place.
● CASE II When the core is moved to upward of null position (For displacement to the
upward of reference point)
In the this case the flux linking with secondary winding S1 is more as compared to flux
linking with S2. Due to this e1 will be more as that of e2. Due to this output voltage eout is
positive.
● CASE III When the core is moved to downward of Null position (for displacement to the
downward of the reference point). In this case magnitude of e2 will be more as that of e1.
Due to this output eout will be negative and shows the output to downward of the reference
point.
Advantages of LVDT:
● High Range – The LVDTs have a very high range for measurement of
displacement.they can used for measurement of displacements ranging from 1.25
mm to 250 mm
● No Frictional Losses – As the core moves inside a hollow former so there is no
loss of displacement input as frictional loss so it makes LVDT as very accurate
device.
● High Input and High Sensitivity – The output of LVDT is so high that it doesn’t
need any amplification. The transducer possesses a high sensitivity which is
typically about 40V/mm.
● Low Hysteresis – LVDTs show a low hysteresis and hence repeatability is
excellent under all conditions
● Low Power Consumption – The power is about 1W which is very as compared
to other transducers.
● Direct Conversion to Electrical Signals – They convert the linear displacement
to electrical voltage which are easy to process.
Disadvantages of LVDT:
● LVDT is sensitive to stray magnetic fields so it always requires a setup to
protect them from stray magnetic fields.
● LVDT gets affected by vibrations and temperature.
Applications of LVDT
1. We use LVDT in the applications where displacements to be measured
are ranging from a fraction of mm to few cms.
2. The LVDT can also act as a secondary transducer. E.g. the Bourbon tube
which acts as a primary transducer and it converts pressure into linear
displacement and then LVDT coverts this displacement into an electrical
signal which after calibration gives the readings of the pressure of fluid.
Circuit diagram of LVDT with Arduino board: (For low
output LVDT)
LVDT
Precision Amplifier
Interfacing of LVDT with Arduino Board:(For 0-5 V output
LVDT)
Interfacing of LVDT with Arduino Board:(For 0-10 V output
LVDT)
Code or Algorithm:
Float D;
void setup()
{
pinMode(A0,INPUT);
Serial.begin(9600);
}
void loop()
{
D = (2*4.882* analogRead(A0))/8000;
Serial.print("Displacement is = ");
Serial.println((float)D);
delay(1000);
}
What is strain gauge?
● Strain Gauge is a transducer which generates an electrical signal whose
magnitude is proportional to the force applied.
● Strain gauge is used to measure strain.
Strain gauge in wheatstone bridge:
gauge factor Gf = (∆R/R)/( ∆l/l) R1 / R2 = Rx / R3
Strain Gauge Working Principle:
● The foil type strain gauges (Figure1) are very common in which a resistive foil
is mounted on a backing material. These are available in a variety of shapes
and sizes for different applications. The resistance of the foil changes as the
material to which the gauge is attached undergoes tension or compression due
to change in its length and diameter.
● This change in resistance is proportional to the applied strain. As this change in
resistance is very small in magnitude so its effect can be only sensed by a
Wheatstone bridge. This is the basic strain gauge working principle.
● A circuit diagram is shown in Figure 2. In this circuit diagram, a strain gauge is
connected into a Wheatstone bridge. This circuit is so designed that when no force
is applied to the strain gauge, R1 is equal to R2 and the resistance of the strain
gauge is equal to R3. In this condition the Wheatstone bridge is balanced and the
voltmeter shows no deflection.
● But when strain is applied to the strain gauge, the resistance of the strain gauge
sensor changes, the Wheatstone bridge becomes unbalanced, a current flows
through the voltmeter. Since the net change in the resistance is proportional to the
applied strain, therefore, resultant current flow through the voltmeter is
proportional to the applied strain. So, the voltmeter can be calibrated in terms of
strain or force.
Advantages:
● In the strain gauge you will find no moving parts.
● Most of the strain gauge are cheap and quite inexpensive
● Strain gauge are usually small so these are easy to handle.
Disadvantages:
● Strain gauges biggest disadvantage is that they are non-linear.
● It needs regular calibration in order to use perfectly and take perfect
reading.
● Highly Sensitive
Applications:
● Strain measurement
● Residual stress measurement
● Vibration measurement
● Torque measurement
● Bending and deflection measurement
● Compression and tension measurement
Interfacing of strain gauge with Arduino board using
H*711:
Interfacing of strain gauge with Arduino board using
INA128:
Program or Code:
void setup() {
pinMode(A0,INPUT);
Serial.begin(9600);
}
void loop()
{
Serial.print("Weight = ");
Serial.print(analogRead(A0);
delay(1000);
}

More Related Content

What's hot

Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC AbhayDhupar
 
Unit-2 AC-DC converter
Unit-2 AC-DC converter Unit-2 AC-DC converter
Unit-2 AC-DC converter johny renoald
 
Buck-Boost Converter
Buck-Boost ConverterBuck-Boost Converter
Buck-Boost ConverterSagar Patil
 
Differentiator OP Amp
Differentiator OP AmpDifferentiator OP Amp
Differentiator OP AmpDr.Raja R
 
Single phase transformer
Single phase transformerSingle phase transformer
Single phase transformerMahendra Rajput
 
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuittaranjeet10
 
Universal motor/sanjeet-1308143
Universal motor/sanjeet-1308143Universal motor/sanjeet-1308143
Universal motor/sanjeet-1308143sanjeet kumar
 
SCR~ Two Transistor Analogy
SCR~ Two Transistor AnalogySCR~ Two Transistor Analogy
SCR~ Two Transistor AnalogyParas Trivedi
 
Types of snubber circuits | Design of snubber for flyback converter | Simulat...
Types of snubber circuits | Design of snubber for flyback converter | Simulat...Types of snubber circuits | Design of snubber for flyback converter | Simulat...
Types of snubber circuits | Design of snubber for flyback converter | Simulat...Kaushik Naik
 
ANALYSIS OF FLYBACK CONVERTER
ANALYSIS OF FLYBACK CONVERTERANALYSIS OF FLYBACK CONVERTER
ANALYSIS OF FLYBACK CONVERTERshiv kapil
 
Op amp comparator
Op amp comparatorOp amp comparator
Op amp comparatorAhmadoof
 
Rotating magnetic field
Rotating magnetic fieldRotating magnetic field
Rotating magnetic fieldASHISH RAJ
 
DC MOTORS-UNIT-II.pdf
DC MOTORS-UNIT-II.pdfDC MOTORS-UNIT-II.pdf
DC MOTORS-UNIT-II.pdfKUMARS641064
 
Lecture 9 synchros - transmitters, differentials, governing equations
Lecture 9   synchros - transmitters, differentials, governing equationsLecture 9   synchros - transmitters, differentials, governing equations
Lecture 9 synchros - transmitters, differentials, governing equationsManipal Institute of Technology
 

What's hot (20)

Cycloconverters
CycloconvertersCycloconverters
Cycloconverters
 
Successive Approximation ADC
Successive Approximation ADC Successive Approximation ADC
Successive Approximation ADC
 
Stepper motor
Stepper motorStepper motor
Stepper motor
 
Unit-2 AC-DC converter
Unit-2 AC-DC converter Unit-2 AC-DC converter
Unit-2 AC-DC converter
 
Mosfet
MosfetMosfet
Mosfet
 
Buck-Boost Converter
Buck-Boost ConverterBuck-Boost Converter
Buck-Boost Converter
 
Differentiator OP Amp
Differentiator OP AmpDifferentiator OP Amp
Differentiator OP Amp
 
Single phase transformer
Single phase transformerSingle phase transformer
Single phase transformer
 
Ic 555 timer 0
Ic 555 timer 0Ic 555 timer 0
Ic 555 timer 0
 
Schmitt trigger circuit
Schmitt trigger circuitSchmitt trigger circuit
Schmitt trigger circuit
 
3.magnetically coupled circuit
3.magnetically coupled circuit3.magnetically coupled circuit
3.magnetically coupled circuit
 
Universal motor/sanjeet-1308143
Universal motor/sanjeet-1308143Universal motor/sanjeet-1308143
Universal motor/sanjeet-1308143
 
SCR~ Two Transistor Analogy
SCR~ Two Transistor AnalogySCR~ Two Transistor Analogy
SCR~ Two Transistor Analogy
 
Types of snubber circuits | Design of snubber for flyback converter | Simulat...
Types of snubber circuits | Design of snubber for flyback converter | Simulat...Types of snubber circuits | Design of snubber for flyback converter | Simulat...
Types of snubber circuits | Design of snubber for flyback converter | Simulat...
 
ANALYSIS OF FLYBACK CONVERTER
ANALYSIS OF FLYBACK CONVERTERANALYSIS OF FLYBACK CONVERTER
ANALYSIS OF FLYBACK CONVERTER
 
Op amp comparator
Op amp comparatorOp amp comparator
Op amp comparator
 
Rotating magnetic field
Rotating magnetic fieldRotating magnetic field
Rotating magnetic field
 
DC MOTORS-UNIT-II.pdf
DC MOTORS-UNIT-II.pdfDC MOTORS-UNIT-II.pdf
DC MOTORS-UNIT-II.pdf
 
Lecture 9 synchros - transmitters, differentials, governing equations
Lecture 9   synchros - transmitters, differentials, governing equationsLecture 9   synchros - transmitters, differentials, governing equations
Lecture 9 synchros - transmitters, differentials, governing equations
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 

Similar to Peripheral Interface and Sensors

Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxasolis5
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Omkar Rane
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosps6005tec
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Daman Singh
 
project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded systemram avtar
 
lab_ADC.pdf
lab_ADC.pdflab_ADC.pdf
lab_ADC.pdfboukomra
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjmangala jolad
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalTony Olsson.
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsPallavi Bharti
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using ArduinoBalajiK109
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converterCorrado Santoro
 
analog to digital converter seminar
analog to digital converter seminaranalog to digital converter seminar
analog to digital converter seminargayatrigayu1
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
 

Similar to Peripheral Interface and Sensors (20)

Lpc 17xx adc
Lpc 17xx adcLpc 17xx adc
Lpc 17xx adc
 
Anup2
Anup2Anup2
Anup2
 
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptxVhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
Vhdl-Code-for-Adc0804-Comparator-and-Parity-Generator.pptx
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148
 
STM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicosSTM_ADC para microcontroladores STM32 - Conceptos basicos
STM_ADC para microcontroladores STM32 - Conceptos basicos
 
Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)Pic ppt 13104022(4th_year)
Pic ppt 13104022(4th_year)
 
project report on embedded system
project report on embedded systemproject report on embedded system
project report on embedded system
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
lab_ADC.pdf
lab_ADC.pdflab_ADC.pdf
lab_ADC.pdf
 
Mc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msjMc module5 lcd_interface_ppt_msj
Mc module5 lcd_interface_ppt_msj
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and robotics
 
Automatic irrigation system using Arduino
Automatic irrigation system using ArduinoAutomatic irrigation system using Arduino
Automatic irrigation system using Arduino
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
Analog to digital converter
Analog to digital converterAnalog to digital converter
Analog to digital converter
 
Módulo adc 18f4550
Módulo adc   18f4550Módulo adc   18f4550
Módulo adc 18f4550
 
analog to digital converter seminar
analog to digital converter seminaranalog to digital converter seminar
analog to digital converter seminar
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 

Recently uploaded

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Peripheral Interface and Sensors

  • 1. UNIT-2 Peripheral Interface Prof. K. R. Rane Electrical Department K.K.W.I.E.E.R
  • 2. Learning Outcomes- ➔ What is LED? ➔ Interfacing of LED with Arduino UNO Board ➔ Coding or Algorithm ➔ What is LCD? ➔ Interfacing of LCD with Arduino UNO Board ➔ Serial communication using Arduino IDE ➔ Concept of ADC in ATMEGA 328 ➔ Interfacing of temperature sensor with Arduino board, LVDT, Strain gauge
  • 3. What is LED? ● A light-emitting diode (LED) is a semiconductor device that emits light when an electric current flows through it. ● Features: Long lifespan, Low cost & size, high luminance, low power consumption, Energy Efficiency.
  • 4. Interfacing of ATMEGA 328 based Arduino board with LED ● LED cathode is connected to GND. ● GPIO pin no. 9 of board is connected With LED anode through resistor (It’s value is inversely proportional to current & brightness of LED).
  • 5. Program or Code: void setup() { pinMode(9, OUTPUT); // initialize digital pin 9 as an output. } void loop() // the loop function runs over and over again forever { digitalWrite(9, HIGH ); // turn the LED ON by making the voltage HIGH delay(1000); // Wait for a second digitalWrite(9, LOW); // turn the LED ON by making the voltage LOW delay(1000); // Wait for a second }
  • 6. To connect 3 LED’s with Arduino:
  • 7. Code: void setup() { pinMode (5, OUTPUT); pinMode (6, OUTPUT); pinMode (7, OUTPUT); } void loop() { digitalWrite (5, HIGH); digitalWrite (6, HIGH); digitalWrite (7, HIGH); delay (5000); digitalWrite (5, LOW); digitalWrite (6, LOW); digitalWrite (7, LOW); delay (5000); }
  • 8. What is LCD? ● LCD is a flat display technology, stands for "Liquid Crystal Display”. ● Used in computer monitors, instrument panels, cell phones, digital cameras, TVs, laptops, tablets, and calculators. ● It is a thin display device that offers support for large resolutions and better picture quality. ● 16×2 LCD display is shown below:
  • 9. Interfacing of LCD with ATMEGA 328 based Arduino board: Figure: Circuit diagram of connecting 16*2 LCD with Arduino board
  • 10. Code or algorithm: #include <LiquidCrystal.h> // initialize the library const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { lcd.begin(16, 2); lcd.print("hello, world!"); } void loop() { lcd.setCursor(0, 0); lcd.print(“Hello,world!” ); serial.println (“Hello,world!”); lcd.setCursor(0, 1); lcd.print(“Hi….”); serial.println (“Hi…”); }
  • 11. Example to blink the output on LCD: #include <LiquidCrystal.h> // initialize the library const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { lcd.begin(16, 2); } void loop() { lcd.clear(); delay(1000); lcd.setCursor(0, 0); lcd.print(“Hello….! ); lcd.setCursor(0, 1); lcd.print(“Hi….”); delay(1000); }
  • 12. Serial communication using Arduino IDE: ● Arduino UNO pins 0 &1 are of UART used for serial communication. ● UART requires two pins for communication: Tx & Rx. ● Connection of Atmega328 on Arduino Uno board to PC:
  • 14. Concept of ADC in Atmega328 based arduino board:
  • 15. ADCSRA – ADC Control and Status Register A:- Bit 7 6 5 4 3 2 1 0 0x7A ADEN ADSC ADATE ADIF ADIE ADPS2 ADPS1 ADPS0 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0
  • 16. ● Bit 7 – ADEN: ADC Enable: Writing this bit to one enables the ADC. By writing it to zero, the ADC is turned off. Turning the ADC off while a conversion is in progress, will terminate this conversion. ● Bit 6 – ADSC: ADC Start Conversion: In Single Conversion mode, write this bit to one to start each conversion. In Free Running mode, write this bit to one that will take 25 ADC clock cycles instead of the normal 13 This first conversion performs initialization of the ADC. ADSC will read as one as long as a conversion is in progress. When the conversion is complete, it returns to zero. ● Bit 5 – ADATE: ADC Auto Trigger Enable: When this bit is written to one, Auto Triggering of the ADC is enabled. The ADC will start a conversion on a positive edge of the selected trigger signal. The trigger source is selected by setting the ADC Trigger Select bits, ADTS in ADCSRB.
  • 17. ● Bit 4 – ADIF: ADC Interrupt Flag: This bit is set when an ADC conversion completes and the Data Registers are updated. The ADC Conversion Complete Interrupt is executed if the ADIE bit and the I-bit in SREG are set. ADIF is cleared by hardware when executing the corresponding interrupt handling vector. ● Bit 3 – ADIE: ADC Interrupt Enable: When this bit is written to one and the I-bit in SREG is set, the ADC Conversion Complete Interrupt is activated.
  • 18.
  • 19. ● Bits 2:0 – ADPS[2:0]: ADC Prescaler Select Bits: These bits determine the division factor between the system clock frequency and the input clock to the ADC. ● ADPS2 ADPS1 ADPS0 Division Factor 0 0 0 2 0 0 1 2 0 1 0 4 0 1 1 8 1 0 0 16 1 0 1 32 1 1 0 64 1 1 1 128
  • 20. ADCSRB – ADC Control and Status Register B: Bit 7 6 5 4 3 2 1 0 – ACME – – – ADTS2 ADTS1 ADTS0 Read/Write R R/W R R R R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0
  • 21. ● Bit 7,5,4 ,3:Reserved bits:Input This bits are used for future purpose. ● Bit 6-ACME: ACME=1 & ADC is switched off, ADC multiplexer selects input connected at ADC channels as negative input to the analog comparator. ACME=0 AIN1 acts as negative terminal of analog comparator.
  • 22. Bit 2:0 – ADTS[2:0]: ADC Auto Trigger Source selection If ADATE in ADCSRA is written to one, the value of these bits selects which source will trigger an ADC conversion. ADTS2 ADTS1 ADTS0 Trigger Source 0 0 0 Free Running mode 0 0 1 Analog Comparator 0 1 0 External Interrupt Request 0 0 1 1 Timer/Counter0 Compare Match A 1 0 0 Timer/Counter0 Overflow 1 0 1 Timer/Counter1 Compare Match B 1 1 0 Timer/Counter1 Overflow 1 1 1 Timer/Counter1 Capture Event
  • 23. ADMUX – ADC Multiplexer Selection Register: Bit 7 6 5 4 3 2 1 0 0x7C REFS1 REFS0 ADLAR – MUX3 MUX2 MUX1 MUX0 Read/Write R/W R/W R/W R R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0
  • 24. Bit 7:6 – REFS[1:0]: Reference Selection Bits:
  • 25. Bit 5 – ADLAR: ADC Left Adjust Result The ADLAR bit affects the presentation of the ADC conversion result in the ADC Data Register. Write one to ADLAR to left adjust the result. Otherwise, the result is right adjusted. • Bits 3:0 – MUX[3:0]: Analog Channel Selection Bits The value of these bits selects which analog inputs are connected to the ADC.
  • 26. MUX[3:0] Single Ended Input 0000 ADC0 0001 ADC1 0010 ADC2 0011 ADC3 0100 ADC4 0101 ADC5 0110 ADC6 0111 ADC7 1000 ADC8(for internal temperature sensor) 1001 (reserved) 1010 (reserved) 1011 (reserved) 1100 (reserved) 1101 (reserved) 1110 1.1V (VBG) 1111 0V (GND)
  • 27. ADCL and ADCH – The ADC Data Register: ADLAR = 1 :When an ADC conversion is complete, the result is found in these two registers. A total of 10 bits of conversion result is stored in these two registers. Bit 15 14 13 12 11 10 9 8 0x79 ADC9 ADC8 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2 Read/Write R R R R R R R R Bit 7 6 5 4 3 2 1 0 0x78 ADC1 ADC0 – – – – – – Read/Write R R R R R R R R
  • 28. Bit 15 14 13 12 11 10 9 8 0x79 – – – – – – ADC9 ADC8 Read/Write R R R R R R R R Bit 7 6 5 4 3 2 1 0 0x78 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2 ADC1 ADC0 Read/Write R R R R R R R R ADLAR = 0
  • 29. DIDR0 – Digital Input Disable Register 0: Bit 7 6 5 4 3 2 1 0 0x7E – – ADC5D ADC4D ADC3D ADC2D ADC1D ADC0D Read/Write R R R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0
  • 30. Bit 5:0 – ADC5D…ADC0D: ADC5…0 Digital Input Disable When this bit is written logic one, the digital input buffer on the corresponding ADC pin is disabled. The corresponding PIN Register bit will always read as zero when this bit is set. When an analog signal is applied to the ADC5…0 pin and the digital input from this pin is not needed, this bit should be written logic one to reduce power consumption in the digital input buffer.
  • 31. What is temperature sensor? ● The Temperature Sensor LM35 series are precision integrated-circuit temperature devices with an output voltage linearly proportional to the Centigrade temperature. ● The LM35 device calibrated in Kelvin. ● The LM35 device does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full −55°C to 150°C temperature range.
  • 32. Features: ● Calibrated Directly in Celsius (Centigrade) ● Linear + 10-mV/°C Scale Factor. ● 0.5°C Ensured Accuracy (at 25°C) ● Rated for Full −55°C to 150°C Range. ● Suitable for Remote Applications. ● Low-Cost Due to Wafer-Level Trimming. ● Operates From 4 V to 30 V.
  • 33. Interfacing of LM35 with arduino:
  • 34.
  • 35. Program: Float T; void setup() { pinMode(A1,INPUT); Serial.begin(9600);} void loop() { temp = (4.882* analogRead(A1))/10; Serial.print("Temperature = "); Serial.print((float)T); Serial.println("degree C"); delay(1000); }
  • 36. What is LVDT? ● The term LVDT stands for the Linear Variable Differential Transformer. ● It is the most widely used inductive transducer that converts the linear motion into the electrical signal. ● The output across secondary of this transformer is the differential.
  • 37.
  • 38. ● The transformer consists of a primary winding P and two secondary windings S1 and S2 wound on a cylindrical former (which is hollow in nature and contains the core). ● Both the secondary windings have an equal number of turns and we place them on either side of primary winding ● The primary winding is connected to an AC source which produces a flux in the air gap and voltages are induced in secondary windings. ● A movable soft iron core is placed inside the former and displacement to be measured is connected to the iron core. ● The iron core is generally of high permeability which helps in reducing harmonics and high sensitivity of LVDT. ● The LVDT is placed inside a stainless steel housing because it will provide electrostatic and electromagnetic shielding. ● The both the secondary windings are connected in such a way that resulted output is the difference between the voltages of two windings.
  • 39. Principle of Operation and Working: ● CASE I When the core is at null position (for no displacement) When the core is at null position then the flux linking with both the secondary windings is equal so the induced emf is equal in both the windings. So for no displacement the value of output eout is zero as e1 and e2 both are equal. So it shows that no displacement took place. ● CASE II When the core is moved to upward of null position (For displacement to the upward of reference point) In the this case the flux linking with secondary winding S1 is more as compared to flux linking with S2. Due to this e1 will be more as that of e2. Due to this output voltage eout is positive. ● CASE III When the core is moved to downward of Null position (for displacement to the downward of the reference point). In this case magnitude of e2 will be more as that of e1. Due to this output eout will be negative and shows the output to downward of the reference point.
  • 40. Advantages of LVDT: ● High Range – The LVDTs have a very high range for measurement of displacement.they can used for measurement of displacements ranging from 1.25 mm to 250 mm ● No Frictional Losses – As the core moves inside a hollow former so there is no loss of displacement input as frictional loss so it makes LVDT as very accurate device. ● High Input and High Sensitivity – The output of LVDT is so high that it doesn’t need any amplification. The transducer possesses a high sensitivity which is typically about 40V/mm. ● Low Hysteresis – LVDTs show a low hysteresis and hence repeatability is excellent under all conditions ● Low Power Consumption – The power is about 1W which is very as compared to other transducers. ● Direct Conversion to Electrical Signals – They convert the linear displacement to electrical voltage which are easy to process.
  • 41. Disadvantages of LVDT: ● LVDT is sensitive to stray magnetic fields so it always requires a setup to protect them from stray magnetic fields. ● LVDT gets affected by vibrations and temperature. Applications of LVDT 1. We use LVDT in the applications where displacements to be measured are ranging from a fraction of mm to few cms. 2. The LVDT can also act as a secondary transducer. E.g. the Bourbon tube which acts as a primary transducer and it converts pressure into linear displacement and then LVDT coverts this displacement into an electrical signal which after calibration gives the readings of the pressure of fluid.
  • 42. Circuit diagram of LVDT with Arduino board: (For low output LVDT) LVDT Precision Amplifier
  • 43. Interfacing of LVDT with Arduino Board:(For 0-5 V output LVDT)
  • 44. Interfacing of LVDT with Arduino Board:(For 0-10 V output LVDT)
  • 45. Code or Algorithm: Float D; void setup() { pinMode(A0,INPUT); Serial.begin(9600); } void loop() { D = (2*4.882* analogRead(A0))/8000; Serial.print("Displacement is = "); Serial.println((float)D); delay(1000); }
  • 46. What is strain gauge? ● Strain Gauge is a transducer which generates an electrical signal whose magnitude is proportional to the force applied. ● Strain gauge is used to measure strain.
  • 47. Strain gauge in wheatstone bridge: gauge factor Gf = (∆R/R)/( ∆l/l) R1 / R2 = Rx / R3
  • 48. Strain Gauge Working Principle: ● The foil type strain gauges (Figure1) are very common in which a resistive foil is mounted on a backing material. These are available in a variety of shapes and sizes for different applications. The resistance of the foil changes as the material to which the gauge is attached undergoes tension or compression due to change in its length and diameter. ● This change in resistance is proportional to the applied strain. As this change in resistance is very small in magnitude so its effect can be only sensed by a Wheatstone bridge. This is the basic strain gauge working principle.
  • 49. ● A circuit diagram is shown in Figure 2. In this circuit diagram, a strain gauge is connected into a Wheatstone bridge. This circuit is so designed that when no force is applied to the strain gauge, R1 is equal to R2 and the resistance of the strain gauge is equal to R3. In this condition the Wheatstone bridge is balanced and the voltmeter shows no deflection. ● But when strain is applied to the strain gauge, the resistance of the strain gauge sensor changes, the Wheatstone bridge becomes unbalanced, a current flows through the voltmeter. Since the net change in the resistance is proportional to the applied strain, therefore, resultant current flow through the voltmeter is proportional to the applied strain. So, the voltmeter can be calibrated in terms of strain or force.
  • 50. Advantages: ● In the strain gauge you will find no moving parts. ● Most of the strain gauge are cheap and quite inexpensive ● Strain gauge are usually small so these are easy to handle. Disadvantages: ● Strain gauges biggest disadvantage is that they are non-linear. ● It needs regular calibration in order to use perfectly and take perfect reading. ● Highly Sensitive
  • 51. Applications: ● Strain measurement ● Residual stress measurement ● Vibration measurement ● Torque measurement ● Bending and deflection measurement ● Compression and tension measurement
  • 52. Interfacing of strain gauge with Arduino board using H*711:
  • 53. Interfacing of strain gauge with Arduino board using INA128:
  • 54. Program or Code: void setup() { pinMode(A0,INPUT); Serial.begin(9600); } void loop() { Serial.print("Weight = "); Serial.print(analogRead(A0); delay(1000); }