Bluetooth
FRANCESCO GAROFALO
COURSE: INTERNET OF THINGS
What is Bluetooth?
Bluetooth is an open standard for wireless
communication. It uses for exchanging data
between fixed and mobile devices over short
distances using short-wavelength UHF radio
waves.
Introduction
Bluetooth works in the ISM band 2.45 GHz (2400-2483.5
MHz), with a frequency-hopping modulation – spread
spectrum (FHSS) to reduce the effect of interference and
Fading (multiple paths).
79 FHSS channels are available. In each channel, a FM binary
modulation is used to minimize the complexity of the radio
transmitter.
History of Bluetooth
The name derives from theViking king
Harald Blatand Gormsson, born around
900, he became famous for having unified
the Scandinavian lands, which under his
kingdom corresponded almost to today's
Denmark, Norway and Sweden.These
were peoples with different traditions,
languages and customs. Harald managed
to do this, thanks to his prayer and his
strategy.
Harald Blatand Gormsson
Why Harald Blatand? – A little story
Jim Kardach The Long Ships
Bluetooth Logo
The Bluetooth logo is formed
two initials of the king: H and B.
Protocols
Bluetooth Radio
Baseband
LMP
Audio
Host Controller Interface
L2CAP
RFCOMM
PPP
IP
UDP TCP
WAP
WAE
OBEX
vCard/vCat
AT-
Commands
TCS BIN TCS BIN
Bluetooth Radio
Bluetooth has 83.5 MHz available.
The Bluetooth Radio works in a very crowed band
(2.45GHz) by other communication systems.
It’s necessary use a spread spectrum technique to
reduce the effect of interference.
FHSS is a collision avoidance technique
Frequency Bands and Channel Arrangement
Transmitter Characteristics
Each device is classified into 3 power classes, Power Class 1, 2 & 3.
1. G Power Class 1: is designed for long range devices (~100m),
with a max output power of 100mW,
2. G Power Class 2: for ordinary range devices (~10m), with a max
output power of 2,5mW,
3. G Power Class 3: for short range devices (~1m), with a max
output power of 0 dBm, 1mW.
4. Low Power: for very short range devices (0,5m), with a max
output power of 0,5mW.
Transmitter Characteristics
1 100 20 ~100
2 2,5 4 ~10
3 1 0 ~1
4 0,5 -3 ~0,5
Protocols
Bluetooth Radio
LMP
Audio
Host Controller Interface
L2CAP
RFCOMM
PPP
IP
UDP TCP
WAP
WAE
OBEX
vCard/vCat
AT-
Commands
TCS BIN TCS BIN
Baseband
Bluetooth Baseband
Baseband enables the physical connection
between devices within a piconet.
This level is based on the inquiry and paging
procedures for synchronizing and connecting
Bluetooth devices.
It allows to establish the two different types of
connection (ACL and SCO).
Baseband - Piconet
The basic Bluetooth unit is the
PICONET, consisting of a master
node and several (maximum seven)
NODES SLAVE ACTIVE, located
within a range of 10 meters.
Baseband - Scatternet
When a set of multiple piconet
networks are interconnected we talk
about SCATTERNET, this is possible
thanks to a Bridge Slave.
Baseband – Packet
The various transceivers of the same piconet use the time-splitting physical
channel. In the event that the transmission frequency is changed for each slot,
the master transmits in the odd slots, and the slave (s) in the even slots.
The data are transmitted in packets, a packet consists of three parts:
• Access code - 72 bits (48 ID, 24 assigned by vendor)
• Packet header - 54 bits
• Payload - from 0 to 2475 bits
Baseband – Packet – Access Code
The data are transmitted in packets, a packet consists of three
parts:
• Access code - 72 bits (48 ID, 24 assigned by vendor)
Baseband – Packet – Header
Header contains some information about the packet.
3 bits: Slave address on the piconet
1 bit: positive or negativeACK
1 bit: flow (0 Stop in ACL packets)
1 bit: sequence number (not interested)
4 bit: identify 16 possible payload types:
- Null (Access Code + Payload)
- ID (Only Access Code)
- Pool (Slaves must answer)
- FHS (Frequency Hopping Synchronization)
- 12 Synchronized or Asynchronized Packets
8 bits: + 36 redundancy bits [FEC 1/3]*
*FEC is Forwared Error Connection, essentially in FEC 1/3 every bit is transmited for three times.With this technique we can correct a single error for every three bits
Baseband – Packet – Payload
The Payload has a variable number of bits
depending on the duration of the packet.
The packet can last for 1,3 or 5 slots.
Baseband – Collision Avoidance
The collisions are avoided because the
master decides which slave must respond.
Baseband - Link
There are two types of link:
1. Synchrounous Connection Oriented
(SCO):The SCO links are used for voice
transmission.There are symmetric point
to point transmission that reserve time
slot to guarantee real-time
transmission.
2. Asynchronous ConnectionLess (ACL):
The ACL links are used for data
transmission.The transmission is
establish on for-slot state, andACL
support p2p and point to multipoint
transmissions.*
* In ACL transmission we can retransmit the packets
Baseband - State Machine
Page
Master
Response
Slave
Response
Page
Scan
Inquiry
Scan
Inquiry
Response
Inquiry
CONNECTION
PARK
STANDBY
Baseband - State Machine
STANDBY
It is used by a device to activate a new connection with a slave in the PAGE
SCAN state.The device will become the master of a new piconet, if it is the
first connection, or is already the master of the existing piconet. For this
reason we already call the device in the page status "master".
Page
Scan
It’s the default status of the device, essentially the device is in low power mode
and every 1.28/3.84 switch on Page Scan or Inquiry Scan status for 10ms.
Baseband - State Machine
STANDBY
In this state the device listens for a 10 ms time window to eventually respond
to another device that is trying to form a new connection
Page
It is used by a device to activate a new connection with a slave in the PAGE
SCAN state.The device will become the master of a new piconet, if it is the
first connection, or is already the master of the existing piconet. For this
reason we already call the device in the page status "master".
Page
Scan
Inquiry
Scan
Inquiry
It’s the default status of the device, essentially the device is in low power mode
and every 1.28/3.84 switch on Page Scan or Inquiry Scan status for 10ms.
It’s like to Page Scan but if it recives a inquiry message, it’s switch on Inquiry
Response, in this case after 625 ms sends an answer message with its ID and
some info.
In this state the device listens for a 10 ms time window to eventually respond
to another device that is trying to form a new connection
Baseband - State Machine
CONNECTION
PARK
It’s the typical state of the piconet, which allows bidirectional communications
between master and slave. In the same state a device can temporarily suspend
the connection. In the Connection state, a device can be in three operating
modes: ACTIVE MODE, SNIFF MODE, HOLD MODE.
In the PARK state, a slave exits the piconet, and only keeps the
synchronization with the hopping sequence.The device leaves the address
free in the piconet (from one to seven) and takes a parking address. It is a
status that eventually allows virtual increase over the number of maximum of
8 devices in a piconet.The device in the PARK state no longer listens. It wakes
up at periodic intervals to listen to any messages from the master. If the
master wants to wake up or send a command to a parked device, he sends a
"beacon", that is a train of identical packages repeated a number of times
sufficient to ensure that the parked device wakes up at least once and listens..
Protocols
Bluetooth Radio
LMP
Audio
Host Controller Interface
L2CAP
RFCOMM
PPP
IP
UDP TCP
WAP
WAE
OBEX
vCard/vCat
AT-
Commands
TCS BIN TCS BIN
Baseband
LMP
LMP is responsible for the organization of the connection, the control between bluetooth devices
and the control and negotiation of the packet size.
It is also used for security: authentication and encryption.
It checks the various ways of managing power (park, sniff, hold) and the status of the connection of
a device within the piconet.
LMP messages are filtered and interpreted by the link manager upon receipt, so they will never be
transmitted to higher levels.These messages have higher priority than packets carrying user data.
Protocols
Bluetooth Radio
LMP
Audio
Host Controller Interface
L2CAP
RFCOMM
PPP
IP
UDP TCP
WAP
WAE
OBEX
vCard/vCat
AT-
Commands
TCS BIN TCS BIN
Baseband
L2CAP
L2CAP performs:
1. Multiplexing data between different higher
layer protocols.
2. Segmentation and reassembly of packets.
3. Providing one-way transmission management
of multicast data to a group of other
Bluetooth devices.
4. Quality of service (QoS) management for
higher layer protocols.
Protocols
Bluetooth Radio
LMP
Audio
Host Controller Interface
L2CAP
RFCOMM
PPP
IP
UDP TCP
WAP
WAE
OBEX
vCard/vCat
AT-
Commands
TCS BIN TCS BIN
Baseband
RFCOMM
RFCOMM: emulates a serial port (RS-232) on the L2CAP protocol.
RFCOMM is sometimes called serial port emulation.The Bluetooth serial port profile is based on
this protocol.
RFCOMM provides a simple reliable data stream to the user, similar toTCP. It is used directly by
many telephony related profiles as a carrier for AT commands, as well as being a transport layer
for OBEX over Bluetooth.
Many Bluetooth applications use RFCOMM because of its widespread support and publicly
available API on most operating systems. Additionally, applications that used a serial port to
communicate can be quickly ported to use RFCOMM.
In the protocol stack, RFCOMM is bound to L2CAP.
Higher Levels
RFCOMM: emulates a serial port (RS-232) on the L2CAP protocol.This level is necessary because there are
applications (such as OBEX) that use a serial transmission mechanism.
TCS BIN: operates at bit level and defines the control signals for voice and data calls between Bluetooth
devices and the procedures for managing groups ofTCS devices.
SDP: it is an important element within Bluetooth technology, as it allows applications to have information on
the devices, on the services offered and on the features of the services available. After identifying the device
that implements a particular service, a connection can be established.
AUDIO: the function of this layer is to encode the audio signal.Two techniques can be adopted: log PCM and
CVSD both provide a 64 kbit / s bit stream.The PCM (Pulse Code Modulation) log encoding consists of a non-
uniform 8-bit quantization. In the CVSD coding (ContinuousVariable Slope Delta Modulation) the output bit
indicates whether the predicted value is greater or less than the value of the input waveform, consisting of a
PCM signal with uniform quantization.The pitch is determined by the slope of the waveform.
Arduino Project
Arduino Project
Bluetooth & 433MHz
ASK – Amplitude Shift Keying for 433Mhz
As discussed above, for sending the digital data over radio, these modules use a technique called Amplitude Shift Keying or
ASK.
In Amplitude Shift Keying the amplitude (i.e. the level) of the carrier wave (in our case it’s a 433MHz signal) is changed in
response to the incoming data signal.
This is very similar to the analog technique of amplitude modulation which you might be familiar with if you’re familiar with AM
radio. It’s sometimes called binary amplitude shift keying because there are only two levels we are concerned with.You can
think of it as an ON/OFF switch.
•For Digital 1 –This drives the carrier at full strength.
•For Digital 0 –This cuts the carrier off completely.
Amplitude Shift keying uses less bandwith then FSK, and it’s less expansive.
The disadvantage however is that ASK is susceptible to interference from other radio devices and background noise. But as
long as you keep your data transmission to a relatively slow speed it can work reliably in most environments.
Thanks

Bluetooth

  • 1.
  • 2.
    What is Bluetooth? Bluetoothis an open standard for wireless communication. It uses for exchanging data between fixed and mobile devices over short distances using short-wavelength UHF radio waves. Introduction
  • 3.
    Bluetooth works inthe ISM band 2.45 GHz (2400-2483.5 MHz), with a frequency-hopping modulation – spread spectrum (FHSS) to reduce the effect of interference and Fading (multiple paths). 79 FHSS channels are available. In each channel, a FM binary modulation is used to minimize the complexity of the radio transmitter.
  • 4.
    History of Bluetooth Thename derives from theViking king Harald Blatand Gormsson, born around 900, he became famous for having unified the Scandinavian lands, which under his kingdom corresponded almost to today's Denmark, Norway and Sweden.These were peoples with different traditions, languages and customs. Harald managed to do this, thanks to his prayer and his strategy. Harald Blatand Gormsson
  • 5.
    Why Harald Blatand?– A little story Jim Kardach The Long Ships
  • 6.
    Bluetooth Logo The Bluetoothlogo is formed two initials of the king: H and B.
  • 7.
    Protocols Bluetooth Radio Baseband LMP Audio Host ControllerInterface L2CAP RFCOMM PPP IP UDP TCP WAP WAE OBEX vCard/vCat AT- Commands TCS BIN TCS BIN
  • 8.
    Bluetooth Radio Bluetooth has83.5 MHz available. The Bluetooth Radio works in a very crowed band (2.45GHz) by other communication systems. It’s necessary use a spread spectrum technique to reduce the effect of interference. FHSS is a collision avoidance technique
  • 9.
    Frequency Bands andChannel Arrangement
  • 10.
    Transmitter Characteristics Each deviceis classified into 3 power classes, Power Class 1, 2 & 3. 1. G Power Class 1: is designed for long range devices (~100m), with a max output power of 100mW, 2. G Power Class 2: for ordinary range devices (~10m), with a max output power of 2,5mW, 3. G Power Class 3: for short range devices (~1m), with a max output power of 0 dBm, 1mW. 4. Low Power: for very short range devices (0,5m), with a max output power of 0,5mW.
  • 11.
    Transmitter Characteristics 1 10020 ~100 2 2,5 4 ~10 3 1 0 ~1 4 0,5 -3 ~0,5
  • 12.
    Protocols Bluetooth Radio LMP Audio Host ControllerInterface L2CAP RFCOMM PPP IP UDP TCP WAP WAE OBEX vCard/vCat AT- Commands TCS BIN TCS BIN Baseband
  • 13.
    Bluetooth Baseband Baseband enablesthe physical connection between devices within a piconet. This level is based on the inquiry and paging procedures for synchronizing and connecting Bluetooth devices. It allows to establish the two different types of connection (ACL and SCO).
  • 14.
    Baseband - Piconet Thebasic Bluetooth unit is the PICONET, consisting of a master node and several (maximum seven) NODES SLAVE ACTIVE, located within a range of 10 meters.
  • 15.
    Baseband - Scatternet Whena set of multiple piconet networks are interconnected we talk about SCATTERNET, this is possible thanks to a Bridge Slave.
  • 16.
    Baseband – Packet Thevarious transceivers of the same piconet use the time-splitting physical channel. In the event that the transmission frequency is changed for each slot, the master transmits in the odd slots, and the slave (s) in the even slots. The data are transmitted in packets, a packet consists of three parts: • Access code - 72 bits (48 ID, 24 assigned by vendor) • Packet header - 54 bits • Payload - from 0 to 2475 bits
  • 17.
    Baseband – Packet– Access Code The data are transmitted in packets, a packet consists of three parts: • Access code - 72 bits (48 ID, 24 assigned by vendor)
  • 18.
    Baseband – Packet– Header Header contains some information about the packet. 3 bits: Slave address on the piconet 1 bit: positive or negativeACK 1 bit: flow (0 Stop in ACL packets) 1 bit: sequence number (not interested) 4 bit: identify 16 possible payload types: - Null (Access Code + Payload) - ID (Only Access Code) - Pool (Slaves must answer) - FHS (Frequency Hopping Synchronization) - 12 Synchronized or Asynchronized Packets 8 bits: + 36 redundancy bits [FEC 1/3]* *FEC is Forwared Error Connection, essentially in FEC 1/3 every bit is transmited for three times.With this technique we can correct a single error for every three bits
  • 19.
    Baseband – Packet– Payload The Payload has a variable number of bits depending on the duration of the packet. The packet can last for 1,3 or 5 slots.
  • 20.
    Baseband – CollisionAvoidance The collisions are avoided because the master decides which slave must respond.
  • 21.
    Baseband - Link Thereare two types of link: 1. Synchrounous Connection Oriented (SCO):The SCO links are used for voice transmission.There are symmetric point to point transmission that reserve time slot to guarantee real-time transmission. 2. Asynchronous ConnectionLess (ACL): The ACL links are used for data transmission.The transmission is establish on for-slot state, andACL support p2p and point to multipoint transmissions.* * In ACL transmission we can retransmit the packets
  • 22.
    Baseband - StateMachine Page Master Response Slave Response Page Scan Inquiry Scan Inquiry Response Inquiry CONNECTION PARK STANDBY
  • 23.
    Baseband - StateMachine STANDBY It is used by a device to activate a new connection with a slave in the PAGE SCAN state.The device will become the master of a new piconet, if it is the first connection, or is already the master of the existing piconet. For this reason we already call the device in the page status "master". Page Scan It’s the default status of the device, essentially the device is in low power mode and every 1.28/3.84 switch on Page Scan or Inquiry Scan status for 10ms.
  • 24.
    Baseband - StateMachine STANDBY In this state the device listens for a 10 ms time window to eventually respond to another device that is trying to form a new connection Page It is used by a device to activate a new connection with a slave in the PAGE SCAN state.The device will become the master of a new piconet, if it is the first connection, or is already the master of the existing piconet. For this reason we already call the device in the page status "master". Page Scan Inquiry Scan Inquiry It’s the default status of the device, essentially the device is in low power mode and every 1.28/3.84 switch on Page Scan or Inquiry Scan status for 10ms. It’s like to Page Scan but if it recives a inquiry message, it’s switch on Inquiry Response, in this case after 625 ms sends an answer message with its ID and some info. In this state the device listens for a 10 ms time window to eventually respond to another device that is trying to form a new connection
  • 25.
    Baseband - StateMachine CONNECTION PARK It’s the typical state of the piconet, which allows bidirectional communications between master and slave. In the same state a device can temporarily suspend the connection. In the Connection state, a device can be in three operating modes: ACTIVE MODE, SNIFF MODE, HOLD MODE. In the PARK state, a slave exits the piconet, and only keeps the synchronization with the hopping sequence.The device leaves the address free in the piconet (from one to seven) and takes a parking address. It is a status that eventually allows virtual increase over the number of maximum of 8 devices in a piconet.The device in the PARK state no longer listens. It wakes up at periodic intervals to listen to any messages from the master. If the master wants to wake up or send a command to a parked device, he sends a "beacon", that is a train of identical packages repeated a number of times sufficient to ensure that the parked device wakes up at least once and listens..
  • 26.
    Protocols Bluetooth Radio LMP Audio Host ControllerInterface L2CAP RFCOMM PPP IP UDP TCP WAP WAE OBEX vCard/vCat AT- Commands TCS BIN TCS BIN Baseband
  • 27.
    LMP LMP is responsiblefor the organization of the connection, the control between bluetooth devices and the control and negotiation of the packet size. It is also used for security: authentication and encryption. It checks the various ways of managing power (park, sniff, hold) and the status of the connection of a device within the piconet. LMP messages are filtered and interpreted by the link manager upon receipt, so they will never be transmitted to higher levels.These messages have higher priority than packets carrying user data.
  • 28.
    Protocols Bluetooth Radio LMP Audio Host ControllerInterface L2CAP RFCOMM PPP IP UDP TCP WAP WAE OBEX vCard/vCat AT- Commands TCS BIN TCS BIN Baseband
  • 29.
    L2CAP L2CAP performs: 1. Multiplexingdata between different higher layer protocols. 2. Segmentation and reassembly of packets. 3. Providing one-way transmission management of multicast data to a group of other Bluetooth devices. 4. Quality of service (QoS) management for higher layer protocols.
  • 30.
    Protocols Bluetooth Radio LMP Audio Host ControllerInterface L2CAP RFCOMM PPP IP UDP TCP WAP WAE OBEX vCard/vCat AT- Commands TCS BIN TCS BIN Baseband
  • 31.
    RFCOMM RFCOMM: emulates aserial port (RS-232) on the L2CAP protocol. RFCOMM is sometimes called serial port emulation.The Bluetooth serial port profile is based on this protocol. RFCOMM provides a simple reliable data stream to the user, similar toTCP. It is used directly by many telephony related profiles as a carrier for AT commands, as well as being a transport layer for OBEX over Bluetooth. Many Bluetooth applications use RFCOMM because of its widespread support and publicly available API on most operating systems. Additionally, applications that used a serial port to communicate can be quickly ported to use RFCOMM. In the protocol stack, RFCOMM is bound to L2CAP.
  • 32.
    Higher Levels RFCOMM: emulatesa serial port (RS-232) on the L2CAP protocol.This level is necessary because there are applications (such as OBEX) that use a serial transmission mechanism. TCS BIN: operates at bit level and defines the control signals for voice and data calls between Bluetooth devices and the procedures for managing groups ofTCS devices. SDP: it is an important element within Bluetooth technology, as it allows applications to have information on the devices, on the services offered and on the features of the services available. After identifying the device that implements a particular service, a connection can be established. AUDIO: the function of this layer is to encode the audio signal.Two techniques can be adopted: log PCM and CVSD both provide a 64 kbit / s bit stream.The PCM (Pulse Code Modulation) log encoding consists of a non- uniform 8-bit quantization. In the CVSD coding (ContinuousVariable Slope Delta Modulation) the output bit indicates whether the predicted value is greater or less than the value of the input waveform, consisting of a PCM signal with uniform quantization.The pitch is determined by the slope of the waveform.
  • 33.
  • 34.
  • 35.
  • 36.
    ASK – AmplitudeShift Keying for 433Mhz As discussed above, for sending the digital data over radio, these modules use a technique called Amplitude Shift Keying or ASK. In Amplitude Shift Keying the amplitude (i.e. the level) of the carrier wave (in our case it’s a 433MHz signal) is changed in response to the incoming data signal. This is very similar to the analog technique of amplitude modulation which you might be familiar with if you’re familiar with AM radio. It’s sometimes called binary amplitude shift keying because there are only two levels we are concerned with.You can think of it as an ON/OFF switch. •For Digital 1 –This drives the carrier at full strength. •For Digital 0 –This cuts the carrier off completely. Amplitude Shift keying uses less bandwith then FSK, and it’s less expansive. The disadvantage however is that ASK is susceptible to interference from other radio devices and background noise. But as long as you keep your data transmission to a relatively slow speed it can work reliably in most environments.
  • 37.

Editor's Notes

  • #12 We have four power class but in letterature we can consider also a 1.5 power class.
  • #19 G Access Code: Access code are used for timing synchronization, offset compensation, paging and inquiry. There are three different types of Access code: Channel Access Code (CAC), Device Access Code (DAC) and Inquiry Access Code (IAC). The channel access code identifies a unique piconet while the DAC is used for paging and its responses. IAC is used for inquiry purpose. G Header:The header contains information for packet acknowledgement, packet numbering for out-of-order packet reordering, flow control, slave address and error check for header. G Payload: The packet payload can contain either voice field, data field or both. It it has a data field, the payload will also contain a payload header.
  • #20 G Access Code: Access code are used for timing synchronization, offset compensation, paging and inquiry. There are three different types of Access code: Channel Access Code (CAC), Device Access Code (DAC) and Inquiry Access Code (IAC). The channel access code identifies a unique piconet while the DAC is used for paging and its responses. IAC is used for inquiry purpose.
  • #21 G Header:The header contains information for packet acknowledgement, packet numbering for out-of-order packet reordering, flow control, slave address and error check for header.
  • #22 The blue packets contain the information sending by the master.
  • #24 The slave has the permission to response immediately in this case
  • #32 The slave has the permission to response immediately in this case
  • #34 The slave has the permission to response immediately in this case
  • #35 The slave has the permission to response immediately in this case
  • #36 The slave has the permission to response immediately in this case
  • #37 The slave has the permission to response immediately in this case
  • #38 The slave has the permission to response immediately in this case
  • #39 The slave has the permission to response immediately in this case
  • #40 The slave has the permission to response immediately in this case