0% found this document useful (0 votes)
5 views40 pages

6 Nodemcu Esp32 Peripherals and Interfaces

The document provides an overview of various Arduino interfaces and peripherals, including pinouts, LEDs, tactile switches, analog inputs, interrupts, timers, relays, CLCDs, and sensors like the DHT11. It explains the functionality and applications of each component, emphasizing their importance in embedded systems. The content is structured to guide users in understanding how to integrate these components into their projects.
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)
5 views40 pages

6 Nodemcu Esp32 Peripherals and Interfaces

The document provides an overview of various Arduino interfaces and peripherals, including pinouts, LEDs, tactile switches, analog inputs, interrupts, timers, relays, CLCDs, and sensors like the DHT11. It explains the functionality and applications of each component, emphasizing their importance in embedded systems. The content is structured to guide users in understanding how to integrate these components into their projects.
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/ 40

Arduino

Peripherals and Interfaces

Team Emertxe
Interfaces
Arduino
Interface – What?

A shared boundary across which two or more separate


components of a computer system exchange information
Source: wiki
Arduino
Interface - Pinout

TX0 D22 D23


EN
EN GPIO23

VP
SENS_VP AD1_C0 GPIO36 GPIO22 I2C_SCL

VN
SENS_VN AD1_C3 GPIO39 GPIO1 U0_TXD

D13 D12 D14 D27 D26 D25 D33 D32 D35 D34

D5 D18 D19 D21 RX0


AD1_C6 GPIO34 GPIO3
GPIO0 U0_RXD
GPIO0

AD1_C7 GPIO35 GPIO21 I2C_SDA

32K_XP TOUCH9 AD1_C4 GPIO32 GPIO19

32K_XN TOUCH8 AD1_C5 GPIO33 GPIO18

DAC_1 AD2_C8 GPIO25 GPIO5

D4 RX2 TX2
DAC_2 AD2_C9 GPIO26 GPIO17 U2_TXD

TOUCH7 AD2_C7 GPIO27 GPIO16 GPIO0


U2_RXD

HSPI_CK TOUCH6 AD2_C6 GPIO14 GPIO4 AD2_C0 TOUCH0 HSPI_HD

D15 D2
HSPI_Q TOUCH5 AD2_C5 GPIO12 GPIO2 AD2_C2 TOUCH2 HSPI_WP

U0_CTS HSPI_D TOUCH4 AD2_C4 GPIO13 GPIO15 AD2_C3 TOUCH3 HSPI_C0 U0_RTS

3V3 GND
GND GND
VIN GND

VIN 3.3V

EN
BOOT
VIN
EN
Light Emitting Diodes
Arduino
Interface - LEDs

Simplest device used in most on the embedded
applications as feedback

Works just like diodes

Low energy consumption, longer life, smaller size, faster
switching make it usable in wide application fields like
– Home lighting,
– Remote Controls, Surveillance,
– Displays and many more!!
Arduino
Interface - LEDs

VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
GND
GPIO12
R1

D1
Tactile Switch
Arduino
Interface - Tactile Switches

Provides simple and cheap interface

Comes in different shapes and sizes

Preferable if the no of user inputs are less

Some common application of tactile keys are
– HMI
– Mobile Phones
– Computer Mouse etc,.
Arduino
Interface - Tactile Switches

VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
GND

3.3V
GPIO15
GPIO16

R1
R2
R3

SW1
SW2
Analog Input
Arduino
Interface – Analog Inputs

Very important peripheral in embedded systems for real
time activities

The controller understands only digital signals, so an real
time linear signals have to be converted into digital form

Multiplexed with GPIO

Comes with different architecture, SAR is most commonly
used
Arduino

VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
Interface - Analog Inputs - Potentiometer

GND

3.3V
AD2_C0
R1
Interrupts
Arduino
Peripheral – Interrupt - Contents

Basic Concepts

Interrupt Source

Interrupt Classification

Interrupt Handling
Arduino
Peripheral – Interrupt – Basic Concept

An interrupt is a communication process set up in a
microprocessor or microcontroller in which:
– An internal or external device requests the MPU to stop the
processing
– The MPU acknowledges the request
– Attends to the request
– Goes back to processing where it was interrupted

Polling
Arduino
Peripheral – Interrupt – Vs Polling

Events Detection

Response

Power Management
Arduino
Peripheral – Interrupt – Sources

Timers

External

Peripherals
Arduino
Peripheral – Interrupt – Classifications

Interrupts

Hardware Software

Non Maskable Maskable

External Internal
Arduino
Peripheral – Interrupt – Handling

Super Loop Interrupt


Handler
0x0000
0x0001
0x0002

Interrupt
Occurs Here

i
i+1
Arduino
Peripheral – Interrupt – Handling - ISR

Similar to a subroutine

When an interrupt occurs, the MPU:
– Completes the instruction being executed
– Disables global interrupt enable
– Places the address from the program counter on the stack

Attends to the request of an interrupting source
– Clears the interrupt flag
– Should save register contents that may be affected by the code in the
ISR
– Must be terminated with the instruction RETFIE

Return from interrupt
Arduino
Peripheral – Interrupt – Handling - ISR

What / What Not
Arduino
Peripheral – Interrupt – Handling - ISR

Latency is determined by:
– Instruction time (how long is the longest)
– How much of the context must be saved
– How much of the context must be restored
– The effort to implement priority scheme
– Time spend executing protected code
Arduino

VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN
Peripheral – Interrupt – Interface

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
GND

3.3V
GPIO15
GPIO16

R1
R2
R3

SW1
SW2
Timers
Arduino
Peripherals - Timers

Resolution  Register Width

Tick  Up Count or Down Count

Quantum  System Clock settings

Scaling  Pre or Post

Modes
– Counter
– PWM or Pulse Generator
– PW or PP Measurement etc.,
Arduino
Peripherals – Timers - Example

Requirement – 5 pulses of 8 µsecs

Resolution – 8 Bit

Quantum – 1 µsecs

General
Arduino
Peripherals – Timers - Example

Timer Register

Overflows
28μs 20μs 12μs 4μs
Relay
Arduino
Interface - Relay

Most commonly used electromechanical switch

Uses a electromagnet to operate

Used to control high power devices using low power
signal

Provides isolation between the control and controlled
circuit
– Home Automation,
– Automotive applications
– Industrial application and many more !!
Arduino
Interface - Relay
Arduino
Interface - Relay

VIN
VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
GND
GPIO17
R1
D1
VIN

Q1
K1

C
NC
NO
CLCD
Arduino
Interface - CLCD


Most commonly used
display ASCII
characters

Some customization in
symbols possible

Communication Modes
– 8 Bit Mode
– 4 Bit Mode
Arduino
Interface - CLCD

VIN

TX0 D22 D23


EN

U1
VP

16 VDD Q1 4 D4
VN

Q2 5 D5
Q3 6 D6
D13 D12 D14 D27 D26 D25 D33 D32 D35 D34

D5 D18 D19 D21 RX0


R1
STR Q4 7 D7
Q5 14 EN
GPIO19 2 D Q6 13 RS
GPIO18
3 CLK R/W
GPIO5
15 OE
8 GND
D4 RX2 TX2

HCF4094
D15 D2
3V3 GND

GND
VIN GND

VIN 3.3V

EN
BOOT
VIN
EN
Sensors
DHT11
Arduino
Interface – Sensors - DHT11

A cheap and very simple sensor to measure Temperature
and Humidity

It uses a capacitive humidity sensor and a thermistor to
measure the surrounding air, and sends digital signal on
the data pin
Arduino
Interface - Sensors - DHT11

VIN GND D13 D12 D14 D27 D26 D25 D33 D32 D35 D34 VN VP EN

EN
VIN
EN

BOOT

3V3 GND D15 D2 D4 RX2 TX2 D5 D18 D19 D21 RX0 TX0 D22 D23
GND

3.3V
GPIO16

1 - Vcc
2 – Data
U1

3 – NC
R1
DHT11

4 – Gnd
Thank You

You might also like