SlideShare a Scribd company logo
1 of 33
Download to read offline
Sensors	and	Peripherals
Outline
Sensors
◦ Button
◦ Potentiometer
◦ Light	Sensor
◦ Temperature	Sensor
◦ Distance
◦ Gas	Sensor
◦ Digital	Sensors
Peripherals
◦ LED
◦ 7	Segment	
◦ 74595
◦ LCD
Questions
2
Sensors
3
Image	from	http://energia.nu/rapid-prototyping-made-easy-with-the-grove-base-boosterpack-starter-kit-from-seeedstudio/
Types
4
Analog
◦ Two	pins
◦ There	pins
◦ Use	pin	functions
Digital
◦ Use	some	digital	protocol
◦ Use	libraries Two	pins
Three	pins
Measuring	Analog
Voltage	divider
We	measure	the	voltage	in	Vout
We	have	errors
◦ Read	many	values	and	average	them
5
Image	from	https://learn.sparkfun.com/tutorials/voltage-dividers/applications
Button
“Analog	Sensor”
Resistance
◦ Infinite	if	released
◦ 0	if	pressed
6
Button	Debounce
When	the	button	is	pressed
◦ Signal	is	bouncing
◦ Fast	reading	results	in	0s	and	1s
Solutions
◦ Read	more	values	and	average	them
◦ Use	a	trigger
7
Image	from	http://www.engscope.com/pic-example-codes/basic-io-button-debounce/
Potentiometer
Variable	resistance
Connect	the	
◦ middle	pin
◦ One	Side	pin
8
Potentiometer	is	a	voltage	divider
Variable	resistance
Connect	the	three	pins
◦ One	side	pin	to	Vcc
◦ The	middle	pin	the	analog
◦ One	Side	pin	to	the	ground
9
Light	Sensor
Photo	Resistor
◦ 2	pins
◦ R	inverse	proportional	 with	the	light
Sensor
◦ Photo	Resistor
◦ Voltage	divider
◦ Three	pins
10
Image	from	https://inventrom.wordpress.com/2014/11/27/the-thing-in-internet-of-things/
Photo	Resistor
11
Image	from	https://inventrom.wordpress.com/2014/11/27/the-thing-in-internet-of-things/
Temperature	Sensor
Thermistor
◦ Resistance
Parameters
◦ R25 resistance	- 25	degrees
◦ B	– constant
12
measuredV = pin
5
1023
TR =
5
measuredV
R
ratio =
1
B
ln( TR
25R
)
Temperature =
1
1
298
+ratio
Temperature	Sensor	LM35
Temperature	Sensor
13
measuredV = pin
5
1023
Temperature = mesuredV *100
Gas	Sensor
Gas	Sensor
◦ Heats	up
◦ Three	pins
◦ Vcc
◦ Signal
◦ Ground
14
Distance	Sensor
SRF04
◦ Ultrasonic
◦ Sends	a	pulse
◦ Real	time	system
◦ Works	on	microcontrollers
15
Image	from	http://www.robot-electronics.co.uk/htm/srf04tech.htm
Distance	Sensor
Infrared
◦ Analog
◦ Measure	voltage
16
Digital	Sensors
Use	protocols
◦ SPI
◦ I2C
17
SPI
Master	/	Slave
◦ One	Master
◦ Several	slaves
◦ Master	always	initiates	communication
Wires
◦ MOSI	– Master	Out	Slave	In
◦ MISO	– Master	In	Slave	Out
◦ SCLK	– SPI	Clock
◦ SSn – Slave	Select
Speeds
18
SPI
19
Image	from	http://dlnware.com/theory/SPI-Transfer-Modes
I2C
Master	/	Slave
◦ One	or	more	masters
◦ Several	slaves
◦ Master	always	initiates	communication
◦ Each	device	has	an	address
Wires
◦ SDA	– Serial	Data	Line
◦ SCL	– Serial	Clock	Line
Speeds
◦ Standard	100	Kbit
◦ Up	to	3.4	Mbit
20
I2C
21
Image	from	http://opencores.org/project,openmsp430,downloads
Microcontrollers	and	Computers
MICROCONTROLLERS
SPI
◦ Slave	or	master
◦ Hardware	
◦ Software
I2C
◦ Slave	or	master
◦ Hardware	
◦ Software
COMPUTERS
SPI
◦ Master
◦ Hardware
I2C
◦ Master
◦ Hardware
22
Peripherals
23
LED
LED
◦ Diode
◦ Two	legs
◦ Anode	(+)
◦ Cathode	(-)
◦ Start	lighting	up	if	it	has	more	than	0.6V
◦ Infinite	resistance	up	to	0.6	V
◦ 0	resistance	when	it	lights	up
24
7 Segment	Display
Seven	LEDS
◦ Common	Cathode
◦ Common	Anode
◦ Who	many	pins	do	we	need	for	a	digit?
25
7 Segment	Display
Seven	LEDS
◦ Common	Cathode
◦ Common	Anode
◦ Who	many	pins	do	we	need	for	a	digit?
◦ Multiplexing
◦ Microcontrollers
26
Shift	Register
Serial	to	Parallel	Register
Pins	are	limited
◦ Use	expanders
◦ Shift	register
QA ..	QH – data	stored
OE	– enable	(if	0)
SEN	– Serial	input
SRCLK	– Serial	clock
RCLK	– register	clock	(outputs)
SRCLR	– clear
QH’ – shift	output	bit
27
Shift	Register
Serial	to	Parallel	Register
QA ..	QH – data	stored
OE	– Output	enable
SEN	– Shift	In
SRCLK	– Shift	clock
RCLK	– Latch	clock
SRCLR	– clear
QH’ – Shift	out
28
Shift	Register
29
Image	from	http://makeyourownchip.tripod.com/74hc595.html
LCD
LCD
◦ 16	pins
◦ Two	data	protocols
◦ 4	bit
◦ 8	bit
◦ Microcontroller
◦ I2C	version	(with	an	adapter)
◦ How	many	pins?
30
Arduino
Firmata
31
Standard	Firmata
Standard	Firmata
https://pastebin.com/uVgsFvD0
32
Questions?
33

More Related Content

What's hot

19. шина pci express. основни характеристики.
19. шина pci express. основни характеристики.19. шина pci express. основни характеристики.
19. шина pci express. основни характеристики.
dnaidenowa
 

What's hot (20)

Arduino Introduction (Blinking LED) Presentation (workshop #5)
Arduino  Introduction (Blinking LED)  Presentation (workshop #5)Arduino  Introduction (Blinking LED)  Presentation (workshop #5)
Arduino Introduction (Blinking LED) Presentation (workshop #5)
 
Arduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the ArduinoArduino Lecture 1 - Introducing the Arduino
Arduino Lecture 1 - Introducing the Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
19. шина pci express. основни характеристики.
19. шина pci express. основни характеристики.19. шина pci express. основни характеристики.
19. шина pci express. основни характеристики.
 
osint + python: extracting information from tor network and darkweb
osint + python: extracting information from tor network and darkweb osint + python: extracting information from tor network and darkweb
osint + python: extracting information from tor network and darkweb
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Arduino Uno Pin Description
Arduino Uno Pin DescriptionArduino Uno Pin Description
Arduino Uno Pin Description
 
arduino
 arduino arduino
arduino
 
Raspberry pi
Raspberry pi Raspberry pi
Raspberry pi
 
Arduino presentation
Arduino presentationArduino presentation
Arduino presentation
 
ARDUINO BASED TIME AND TEMPERATURE DISPLAY
ARDUINO BASED TIME AND TEMPERATURE DISPLAY ARDUINO BASED TIME AND TEMPERATURE DISPLAY
ARDUINO BASED TIME AND TEMPERATURE DISPLAY
 
Introduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin ControlIntroduction To Raspberry Pi with Simple GPIO pin Control
Introduction To Raspberry Pi with Simple GPIO pin Control
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu ESP8266 Wifi Nodemcu
ESP8266 Wifi Nodemcu
 
DHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity SensorDHT11 Digital Temperature and Humidity Sensor
DHT11 Digital Temperature and Humidity Sensor
 
Blinking a Single LED
Blinking a Single LEDBlinking a Single LED
Blinking a Single LED
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
 
Microcontroller Based Heart Beat and Temperature Monitoring System using Fing...
Microcontroller Based Heart Beat and Temperature Monitoring System using Fing...Microcontroller Based Heart Beat and Temperature Monitoring System using Fing...
Microcontroller Based Heart Beat and Temperature Monitoring System using Fing...
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 

Similar to Lecture 4 - Sensors and Peripherals

teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Autel Powerscan PS100 User Manual
Autel Powerscan PS100 User ManualAutel Powerscan PS100 User Manual
Autel Powerscan PS100 User Manual
obddeal
 

Similar to Lecture 4 - Sensors and Peripherals (20)

MP PPT.pdf
MP PPT.pdfMP PPT.pdf
MP PPT.pdf
 
Remote ashok
Remote ashokRemote ashok
Remote ashok
 
Digital Muti Meter.pdf
Digital Muti Meter.pdfDigital Muti Meter.pdf
Digital Muti Meter.pdf
 
Hướng dẫn sử dụng máy đo tốc độ gió, nhiệt độ Extech 407123
Hướng dẫn sử dụng máy đo tốc độ gió, nhiệt độ Extech 407123Hướng dẫn sử dụng máy đo tốc độ gió, nhiệt độ Extech 407123
Hướng dẫn sử dụng máy đo tốc độ gió, nhiệt độ Extech 407123
 
weather monitoiring system.pptx
weather monitoiring system.pptxweather monitoiring system.pptx
weather monitoiring system.pptx
 
Automatic room temperature controlled fan using arduino uno microcontroller
Automatic room temperature controlled fan using   arduino uno  microcontrollerAutomatic room temperature controlled fan using   arduino uno  microcontroller
Automatic room temperature controlled fan using arduino uno microcontroller
 
Lab2ppt
Lab2pptLab2ppt
Lab2ppt
 
Smart Home System - Soumya.pptx
Smart Home System - Soumya.pptxSmart Home System - Soumya.pptx
Smart Home System - Soumya.pptx
 
Real Life Application of Digital Electronics
Real Life Application of Digital ElectronicsReal Life Application of Digital Electronics
Real Life Application of Digital Electronics
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino
ArduinoArduino
Arduino
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Autel Powerscan PS100 User Manual
Autel Powerscan PS100 User ManualAutel Powerscan PS100 User Manual
Autel Powerscan PS100 User Manual
 
Personal Convection Air Device Alpha Design Document
Personal Convection Air Device Alpha Design DocumentPersonal Convection Air Device Alpha Design Document
Personal Convection Air Device Alpha Design Document
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
ANTI SLEEP ALARM
ANTI SLEEP ALARMANTI SLEEP ALARM
ANTI SLEEP ALARM
 
Speed controller for fan
Speed controller for fanSpeed controller for fan
Speed controller for fan
 
Arduino workshop sensors
Arduino workshop sensorsArduino workshop sensors
Arduino workshop sensors
 
Password based door locking system
Password based door locking systemPassword based door locking system
Password based door locking system
 
Iqc incoming quality control
Iqc incoming quality controlIqc incoming quality control
Iqc incoming quality control
 

More from Alexandru Radovici

More from Alexandru Radovici (20)

SdE2 - Pilot Tock
SdE2 - Pilot TockSdE2 - Pilot Tock
SdE2 - Pilot Tock
 
SdE2 - Systèmes embarquées
SdE2 - Systèmes embarquéesSdE2 - Systèmes embarquées
SdE2 - Systèmes embarquées
 
SdE2 - Planification, IPC
SdE2 - Planification, IPCSdE2 - Planification, IPC
SdE2 - Planification, IPC
 
ALF1 - Introduction
ALF1 - IntroductionALF1 - Introduction
ALF1 - Introduction
 
SdE2 - Introduction
SdE2 - IntroductionSdE2 - Introduction
SdE2 - Introduction
 
MDAD 6 - AIDL and Services
MDAD 6 - AIDL and ServicesMDAD 6 - AIDL and Services
MDAD 6 - AIDL and Services
 
MDAD 5 - Threads
MDAD 5 - ThreadsMDAD 5 - Threads
MDAD 5 - Threads
 
MDAD 4 - Lists, adapters and recycling
MDAD 4 - Lists, adapters and recyclingMDAD 4 - Lists, adapters and recycling
MDAD 4 - Lists, adapters and recycling
 
MDAD 3 - Basics of UI Applications
MDAD 3 - Basics of UI ApplicationsMDAD 3 - Basics of UI Applications
MDAD 3 - Basics of UI Applications
 
MDAD 2 - Introduction to the Android Framework
MDAD 2 - Introduction to the Android FrameworkMDAD 2 - Introduction to the Android Framework
MDAD 2 - Introduction to the Android Framework
 
MDAD 1 - Hardware
MDAD 1 - HardwareMDAD 1 - Hardware
MDAD 1 - Hardware
 
MDAD 0 - Introduction
MDAD 0 - IntroductionMDAD 0 - Introduction
MDAD 0 - Introduction
 
SdE 11 - Reseau
SdE 11 - ReseauSdE 11 - Reseau
SdE 11 - Reseau
 
SdE 10 - Threads
SdE 10 - ThreadsSdE 10 - Threads
SdE 10 - Threads
 
SdE 8 - Synchronisation de execution
SdE 8 - Synchronisation de executionSdE 8 - Synchronisation de execution
SdE 8 - Synchronisation de execution
 
SdE 8 - Memoire Virtuelle
SdE 8 - Memoire VirtuelleSdE 8 - Memoire Virtuelle
SdE 8 - Memoire Virtuelle
 
SdE 7 - Gestion de la Mémoire
SdE 7 - Gestion de la MémoireSdE 7 - Gestion de la Mémoire
SdE 7 - Gestion de la Mémoire
 
SdE 6 - Planification
SdE 6 - PlanificationSdE 6 - Planification
SdE 6 - Planification
 
SdE 5 - Planification
SdE 5 - PlanificationSdE 5 - Planification
SdE 5 - Planification
 
ALF 6 - Parser
ALF 6 - ParserALF 6 - Parser
ALF 6 - Parser
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

Lecture 4 - Sensors and Peripherals