100% found this document useful (5 votes)
64 views

10240Internet of Things Using Single Board Computers: Principles of IoT and Python Programming (Maker Innovations Series) 1st Edition G. R. Kanagachidambaresan - Download the full ebook version right now

The document promotes various eBooks available for download, focusing on topics such as the Internet of Things (IoT) and programming with single-board computers. It highlights a specific book by G. R. Kanagachidambaresan that covers IoT principles, Python programming, and practical applications using sensors and SBCs. The content is aimed at advanced undergraduates, researchers, and practitioners in the field of IoT and electronics.

Uploaded by

itkinkdro
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
100% found this document useful (5 votes)
64 views

10240Internet of Things Using Single Board Computers: Principles of IoT and Python Programming (Maker Innovations Series) 1st Edition G. R. Kanagachidambaresan - Download the full ebook version right now

The document promotes various eBooks available for download, focusing on topics such as the Internet of Things (IoT) and programming with single-board computers. It highlights a specific book by G. R. Kanagachidambaresan that covers IoT principles, Python programming, and practical applications using sensors and SBCs. The content is aimed at advanced undergraduates, researchers, and practitioners in the field of IoT and electronics.

Uploaded by

itkinkdro
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/ 68

Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.

com

Internet of Things Using Single Board Computers:


Principles of IoT and Python Programming (Maker
Innovations Series) 1st Edition G. R.
Kanagachidambaresan
https://ebookmeta.com/product/internet-of-things-using-
single-board-computers-principles-of-iot-and-python-
programming-maker-innovations-series-1st-edition-g-r-
kanagachidambaresan/

OR CLICK HERE

DOWLOAD EBOOK

Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Internet of Things Using Single Board Computers.


Principles of IoT and Python Programming 1st Edition G.
Kanagachidambaresan
https://ebookmeta.com/product/internet-of-things-using-single-board-
computers-principles-of-iot-and-python-programming-1st-edition-g-
kanagachidambaresan/
ebookmeta.com

Role of Single Board Computers SBCs in rapid IoT


Prototyping Internet of Things G. R. Kanagachidambaresan

https://ebookmeta.com/product/role-of-single-board-computers-sbcs-in-
rapid-iot-prototyping-internet-of-things-g-r-kanagachidambaresan/

ebookmeta.com

Internet of Things in Smart Technologies for Sustainable


Urban Development 1st Edition G. R. Kanagachidambaresan

https://ebookmeta.com/product/internet-of-things-in-smart-
technologies-for-sustainable-urban-development-1st-edition-g-r-
kanagachidambaresan/
ebookmeta.com

NFPA 409 : Standard on Aircraft Hangars , 2022 Edition


National Fire Protection Association

https://ebookmeta.com/product/nfpa-409-standard-on-aircraft-
hangars-2022-edition-national-fire-protection-association/

ebookmeta.com
The Sixth Window Tom Douglas Thrillers 6 1st Edition
Rachel Abbott [Abbott

https://ebookmeta.com/product/the-sixth-window-tom-douglas-
thrillers-6-1st-edition-rachel-abbott-abbott/

ebookmeta.com

Reverberations of Revolution Transnational Perspectives


1770 1850 Edinburgh Critical Studies in Atlantic
Literatures and Cultures 1st Edition Elizabeth Amann
(Editor)
https://ebookmeta.com/product/reverberations-of-revolution-
transnational-perspectives-1770-1850-edinburgh-critical-studies-in-
atlantic-literatures-and-cultures-1st-edition-elizabeth-amann-editor/
ebookmeta.com

Reaper Hospital 01 0 Code Possessive Boss 1st Edition


Lacey Carter Andersen

https://ebookmeta.com/product/reaper-hospital-01-0-code-possessive-
boss-1st-edition-lacey-carter-andersen/

ebookmeta.com

Seeds and Food Sovereignty Eastern Himalayan Experiences


1st Edition Dixita Deka Joel Rodrigues Dolly Kikon Bengt G
Karlsson Sanjay Barbora Meenal Tula
https://ebookmeta.com/product/seeds-and-food-sovereignty-eastern-
himalayan-experiences-1st-edition-dixita-deka-joel-rodrigues-dolly-
kikon-bengt-g-karlsson-sanjay-barbora-meenal-tula/
ebookmeta.com

A Study in Wittgenstein s Tractatus Alexander Maslow

https://ebookmeta.com/product/a-study-in-wittgenstein-s-tractatus-
alexander-maslow/

ebookmeta.com
To make a hero 1st Edition Randall Garrett.

https://ebookmeta.com/product/to-make-a-hero-1st-edition-randall-
garrett/

ebookmeta.com
G. R. Kanagachidambaresan

Internet of Things Using Single Board


Computers
Principles of IoT and Python Programming
G. R. Kanagachidambaresan
Chennai, India

ISBN 978-1-4842-8107-9 e-ISBN 978-1-4842-8108-6


https://doi.org/10.1007/978-1-4842-8108-6

© G. R. Kanagachidambaresan 2022

This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

This Apress imprint is published by the registered company APress


Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
To my family, students, dear friends, and scholars
I specially dedicate this to my son, Ananthajith K
Preface
The rapid growth of technology and new smart, sustainable
development initiatives has made the Internet of Things (IoT) and edge
analytics an inevitable platform for all engineering domains. The need
for a sophisticated and ambient environment has resulted in an
exponential growth in automation and artificial intelligence. The right
sensor or actuator, a specific processor, and the correct transmission
unit can offer the best solution to any IoT problem. Lightweight
machine learning or mathematical logic can bring a good solution to
existing smart-city problems.
This book provides detailed information on sensors, their
interfacing connections, programming with single-board computers,
and creating integrated projects with a combination of sensors,
processors, and actuators. A detailed introduction to Python and
Arduino-based programming is also discussed to kindle interest in IoT
programming. IoT products’ wired and wireless connections are
discussed, and programming examples are provided.
This is a completely new textbook that reflects recent developments
while providing a comprehensive introduction to the fields of IoT,
single-board computers, and Python programming. It is aimed at
advanced undergraduates as well as researchers and practitioners. This
book deals more with electronics and programming than simple text. It
best suits outcome-based education systems and can aid industry-
ready IoT engineers.

Funding Information
The part of this book is supported by the Department of Biotechnology
funding information (BT/PR38273/AAQ/3/980/2020).
Any source code or other supplementary material referenced by the
author in this book is available to readers on the Github repository:
https://github.com/Apress/Internet-of-Things-Using-Single-Board-
Computers. For more detailed information, please visit
http://www.apress.com/source-code.
Acknowledgments
My heartfelt thanks to Apress, especially Jessica Vakili and Susan
McDermott, for helping me throughout this project.
I sincerely thank the Department of BioTechnology (DBT-India) for
their funding (BT/PR38273/AAQ/3/980/2020) on the smart
aquaculture project.
I would also like to extend thanks to my JRFs: Ms. Meenakshi KV, Mr.
M. Akash, Ms. A. V. Anandhalekshmi, and Ms. V. Sowmiya.
I give special thanks to my son Mr. Ananthajith K, my wife, Dr.
Mahima V, my parents, Mr. G. S. Ramasubramanian and Mrs. Lalitha, and
Mrs. Chandra, Mr. Venkatraman, Mrs. V. Chitra, and Mr. V. Bharath for
their timely support.
Table of Contents
Chapter 1:​An Overview of the Internet of Things (IoT) and Sensors
Sensors
Energy-based
Signal Output
Mode of Operation
Electronic Sensors
Connectivity
Bluetooth
Zigbee
Wi-Fi
LoRa
Wired Communication
Machine Intelligence
Active Management
Sensor Fusion
Smart Devices
Human-Computer Interaction
Context Awareness
Actuators
IoT and Smart City Applications
Automobile Sensors
Smart Home Sensors
Smart Transportation Sensors
Summary
References
Chapter 2:​IoT Sensors and Their Interfacing Protocols
Vision and Imaging Sensors
Light Rings
Shop Floor and Production Line Inspections
Line Scan Cameras
3D Depth Cameras
Event/​Production Line Triggering
Sensors That Measure Temperature
Thermocouples
Resistance Temperature Detector (RTD)
Temperature Thermistor Sensors
Semiconductor Temperature Sensors
Thermometers
Radiation Sensors
Proximity Sensors
Inductive Field Sensors
Magnetic Field Sensors
Types of Photoelectric Sensors
Ultrasonic Proximity Sensors
Pressure Sensors
Position Sensors
Photoelectric Sensors
Particle Sensors
Types of Particle Sensors
Metal Detectors
Level Sensors
Leak Detectors
Humidity Sensors
Gas and Chemical Sensors
Gas Detectors
Carbon Monoxide (MQ7) Detectors
Force Sensors
Force Sensor Types
Flow Sensors
Mass Flow Sensors
Velocity Flow Sensors
Flaw Sensors
Flame Detectors
Voltmeter and Ammeter Sensors
Contact Sensors
Non-Contact Sensors
Sensor Communication Protocols
Summary
References
Chapter 3:​Programming SBCs
Arduino Programming
Raspberry Pi
Introduction to Raspberry Pi GPIO Access
Interfacing DHT
Interfacing Pi cam to Raspberry Pi zero w
Pi Camera Specifications
Pi Camera Access
Interfacing PIR Sensor
Python
File Concepts
Spreadsheet Concepts
Communication Concepts
Wired and Wireless Programming Concepts
Wired Programming Concepts
Node-RED
Node-RED Features
Node-RED Architecture
Node-RED Applications
MQTT Protocols
Google Sheets Programming (gspread)
Firebase Programming
Matplotlib
Getting Started
Bar Graphs
Scatter Plot
Spectrum Representation
Coherence of Two Signals
Cross-Correlation Graph
Autocorreleation​Graph
Changing Figure Size in Different Units
Scale
Pie Charts
Style Sheets
FiveThirtyEight Style Sheet
Solarized Light Style Sheet
3D Graphs
Plotting 2D Data on a 3D Plot
Creating 2D Bar Graphs in Different Planes
Creating a 3D Histogram of 2D Data
3D Surfaces
Animation
Live Line Graph
Oscilloscope Live
References
Chapter 4:​Wireless Connectivity in IoT
Introduction
Low-Power Wide-Area Networks (LPWANs)
RFID Protocol
XBEE Radios with Arduino
Bluetooth with Arduino
Arduino with a GSM Modem
Arduino with Firebase Cloud Connectivity
References
Chapter 5:​The Internet of Things Through the Raspberry Pi
Introduction
Cluster Computing with Raspberry Pi Zero W
Message Passing Interface (MPI)
Networking with RPis for Simple MPI Scripts
Simple MPI Programming
Types of Communication in Cluster Computing
Persistent Communication
Broadcasting
Scattering
Gathering
A Simple Web Service–Based Home Automation Using a Flask
Server
References
Chapter 6:​Home Electrification and Node-RED
References
Chapter 7:​Supply Chain Management:​Industry 4.​0 and MQTT
Applications
Introduction
Working Principle
Publisher Source Code
Subscriber Source Code
Summary
References
Chapter 8:​Raspberry Pi–Based Go/​No-Go Kit Design Using the RPi
Camera and Image Processing Algorithms
Introduction
References
Chapter 9:​Programming Water-Quality Sensors
Introduction
References
Chapter 10:​IoT-Based Shrimp Farming
References
Index
About the Author
G. R. Kanagachidambaresan
completed his PhD in Information and
Communication Engineering from Anna
University, Chennai, in 2017. He is
currently an associate professor in the
CSE Department at Vel Tech Rangarajan
Dr. Sagunthala R&D Institute of Science
and Technology. He is also a visiting
professor at the University of
Johannesburg.
His main research interest includes
the Internet of Things, Industry 4.0, body
sensor network, and fault-tolerant
wireless sensor network. He has
published several reputed articles and
undertaken several consultancy
activities for leading MNC companies. He
has guest-edited several special issue volumes and books and served as
an editorial review board member for peer-reviewed journals. He is
TEC committee member in DBT, GOI, India.
He is presently working on several government-sponsored research
projects like ISRO, DBT, and DST. He is Wiley’s editor-in-chief of the
Next Generation Computer and Communication Engineering Series. He
is also the managing director for Eazythings Technology Private
Limited.
About the Technical Reviewer
Massimo Nardone
has more than 22 years of experience in
security, web/mobile development,
cloud, and IT architecture. His true IT
passions are security and Android.
He has been programming and
teaching how to program with Android,
Perl, PHP, Java, VB, Python, C/C++, and
MySQL for more than 20 years.
He has a master of science degree in
computing science from the University of
Salerno, Italy.
He has worked as a project manager,
software engineer, research engineer,
chief security architect, information
security manager, PCI/SCADA auditor,
and senior lead IT security/cloud/SCADA architect for many years.
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
G. R. Kanagachidambaresan, Internet of Things Using Single Board Computers
https://doi.org/10.1007/978-1-4842-8108-6_1

1. An Overview of the Internet of Things (IoT)


and Sensors
G. R. Kanagachidambaresan1
(1) Chennai, India

Recent advancements in single-board computers (SBCs) [16] and boards have


made the Internet of Things (IoT) more accessible and easier to use. The
complete automation, information analysis from sensor data, and integration of
individual components with IoT systems helps to build new Smart environment
solutions. The scope of the areas is broadened with IoT components and sensors.
IoT uses existing and emerging technology for event detection and
automation. IoT has the advantages of recent software advancements, reducing
hardware prices and available technology options. It created a great change in
product delivery and services and a major revolution in Industry 4.0. Figure 1-1
illustrates the key features of IoT.
Figure 1-1 IoT feature and data flow

Sensors
Sensors are the main data acquisition and detection system, which converts any
physical quantity (i.e., event) into a signal. In some sensors, direct conversion
takes place; in others, multiple conversions take place to attain accuracy and
quantification. Some of the sensors used in IoT and prototyping are shown in
Figure 1-2. Sensors are collectively connected with an A/D converter to convert
their signals to digital forms so that a processor understands and can program
effectively. Figure 1-2 illustrates sensor classification (mode of operation, signal
output, and energy-based).
Figure 1-2 Sensor type classification
Next, let’s further discuss sensor type classification.

Energy-based
Generator
Energy generation–based sensors provides conversion energy conversion, like
voltage and current, on any physical event. For example, a piezoelectric sensor
converts vibration energy to a proportional voltage. The seebeck metal junction
converts the change in temperature to proportional energy conversion.

Conversion
Sensors convert one mode of physical quantity to another; for example, an
anemometer converts air velocity to rotational motion, which is further
converted to electrical voltage for measurement. These sensors are operated in a
proportional zone for calibration and stable operation. Most sensors provide
linear data conversion.

Signal Output
Analog
Sensors such as anemometers provide analog conversion of data. Analog signal
from annemometer is converted to digital data with the help of an analog-to-
digital converter. The sensor’s frequency of operation should be far greater than
the frequency of the physical quantity to get clear information after digital
conversion.

Discrete
Cameras and tile-based sensors provide discrete and digital information directly
to the processor. This makes the sensor easy to integrate with any digital
processor.

Mode of Operation
Sensors are deflection- or comparison-based. Deflection happens when sensing a
physical event. This is normally an angular-based movement between two points.
Comparison-based meters normally work with standard available data. GPS
sensors provide comparison-based sensing.
Deflection (e.g., voltage meters and current meters)
Comparison (e.g., GPS sensors)

Electronic Sensors
Figure 1-3 illustrates sensor classification based on the field of operation, such as
mechanical, optical, electrical, acoustic, thermal, chemical, radiation, biological,
and magnetic.
Figure 1-3 Sensor classification based on measurand

Mechanical
Linear and angular position
Velocity of the subject
Acceleration
Force
Viscosity, rigidness, and roughness
Pressure and stress
Strain
Mass and density measurement

Optical
Wave velocity
Polarization and spectrum
Wave amplitude
Electrical
Conductivity
Potential difference
Charge and current density
Field

Thermal
Heat flux
Thermal conductivity

Chemical
States and identifies
Color change
Change in voltage

Radiation
Energy
Intensity

Biological
Mass
Concentration
States
Magnetic
Magnetic field
Magnetic flux
Permeability

Connectivity
Figure 1-4 illustrates the connectivity features of IoT communication.
Figure 1-4 IoT connectivity features
Bluetooth Low Energy, Zigbee, LoRa, and Wi-Fi are the most common types of
connectivity in an IoT environment. I2C, SPI, and Rx-Tx serial communication
protocols are examples of wired connectivity.

Bluetooth
Bluetooth network technology creates a personal area network (PAN) by
wirelessly connecting mobile devices over a short distance. The Bluetooth
architecture has its own independent model with a stack of protocols; it does not
follow the standard OSI or TCP/IP models.

Zigbee
The Zigbee 3.0 protocol [1] is an IEEE 802.15.4 specification that supports a 2.4
GHz frequency band. The following are some of the features of Zigbee 3.0.
Low power: Devices that comply with Zigbee 3.0 consume less power and
transmit data at a slower rate. For IoT devices, long-lasting batteries are
required. As a result, the Internet of Things (IoT) network extensively uses this
standard.
Reliable and robust: The mesh topology of the Zigbee 3.0 network eliminates
single points of failure and ensures packet delivery reliability.
Scalable: Devices can be added to a Zigbee 3.0 network anytime.
It is a secure network because it employs AES-128 encryption.
Global standard: Zigbee 3.0 devices use the 2.4 GHz frequency band, which is
widely used worldwide. As a result, it has become the industry standard
around the world.

Wi-Fi
Wi-Fi [2] is a technology that transfers data through radio waves that can make
small gadgets exchange data connected within a small router. Wi-Fi uses the
Institute of Electrical and Electronics Engineers’ (IEEE) 802.11 standards for
effective data transmission.
IEEE 802.11 devices have the primary benefit of making it easier to deploy
local area networks (LANs) at a lower cost. They can host wireless LANs in
outdoor areas and airports, where running cables to every device isn’t practical.

LoRa
LoRa [3] is a long-range wireless communication technology derived from the
CSS chirp-based spread spectrum. The chirp pulses communicate information,
similar to BATS communication.

Wired Communication
I 2C
I2C (Inter-Integrated Circuit) [4] is a two-wired communication protocol (see
Figure 1-5). It is a bus interface, serial communication protocol built into devices.
It has recently become a popular protocol for short-distance communication.
Only two bidirectional open-drain lines—SDA (Serial Data) and SCL (Serial
Clock)—are used for data communication. Both lines are cranked up. The SDA pin
sends and receives data. SCL carries the clock signal.
I2C has two modes of operation: master and slave. Master mode is the most
advanced mode.
Slave mode obeys the command from the master and transmits or receives
data accordingly.
Each clock’s high to low pulse on the SCL line synchronizes each data bit
transferred on the SDA line. Figure 1-5 shows I2C communication protocols.

Figure 1-5 I 2C communication protocols


SPI
The data communication module uses SDA and SCL dual connection lines. SDA
receives and transmits data. Serial Peripheral Interface (SPI) communication is
mainly used by components such as RTC, A-to-D converters, and other computer
peripherals. SPI [5] communication uses a full duplex synchronous
communication protocol that works in serial mode between the master and slave
devices. Figure 1-6 illustrates SPI communication protocols.

Figure 1-6 SPI communication protocols

Serial Communication
Serial communication is a straightforward and dependable way to send data over
long distances. RS-232 is a widely used serial communication protocol. The data
in this standard is sent in serial format at a preset speed (called a baud
rate/number) of bits communicated between the sender and receiver. Common
baud rates are 4800, 9600, 19200, and 38400. Figure 1-7 shows the connection
diagram for the UART communication scheme.

Figure 1-7 UART data communication


Machine Intelligence
Machine intelligence [14] attempts to program a computer to perform previously
human-only tasks. In general, the learning process in intelligent machines entails
gathering information about their environment, deploying that information to
build knowledge about it, and then generalizing that knowledge base to deal with
environmental uncertainty.
Two machine intelligence techniques—imitation learning and reinforcement
learning—have been developed to help machines learn. The learning algorithms
are opted based on consideration of tasks and their characteristics. Intelligent
systems are an option to collect data from the agents and acquire knowledge
about its surrounding, and the computation is adapted for the environment. To
maintain control over a society of autonomous agents, the agents’ learning
process requires a self-organizing mechanism. It should be noted that imbuing
intelligent machines with the capacity to learn is a difficult task; however, the
capacity to learn is what defines a machine as intelligent. Figure 1-8 illustrates
machine learning classification based on input data.
Figure 1-8 Classical machine learning domains
The supervised learning module predicts category (classification module)
and number (regression module). Unsupervised learning provides clustering,
dimension reduction, and association modules.

Active Management
The main components and operation of a closed-loop sensor management
system are depicted in Figure 1-9. The raw sensor data is processed for
information relevant to the sensing objective when the sensor is chosen, and a
measurement is taken. This usually requires the fusion of data from several
sensing modalities (e.g., optical and acoustic) and other properties, as well as the
addition of information from earlier measurements and possibly other sources.
Auxiliary information, such as target tracks or choices about non-sensor
manager-related concerns, may be generated by the loop’s fusion and signal
processing. For sensor management reasons, they must generate a state of
information that allows quantification of the benefits of each feasible sensor
selection in the following time epoch. Currently, accessible quantification
methodologies range from statistical (e.g., mean risk or knowledge gain) to
entirely heuristic. The sensor management must then optimize which sensor to
use for the next measurement.

Figure 1-9 Data processing in IoT architecture


The sensor selector provides information from a particular sensor module.
Once data from a particular sensor is received, data fusion is done through a
sensor data fusion algorithm. The signal is processed using algorithms. The data
is corrected through closed-loop control system algorithms.

Sensor Fusion
Sensor fusion is a technique for reducing the amount of uncertainty in a robot’s
navigation or task performance by combining data from multiple sensors, as
shown in Figure 1-10. Sensor fusion helps the robot create a more accurate world
model, which allows it to navigate and behave better. There are three main
methods for combining sensor data.
Redundant sensors collect repeated information that is permanently fit in
sources like heaters, gates, and other locations.
Complementary sensors collect different information on events happening
inside the monitoring environment.
Coordinated sensors are logically operating sensor that collects information
about the environment.

Figure 1-10 Sensor data aggregation and fusion process


To obtain high-quality, relevant measurement data, data fusion combines
several sources of information utilizing mathematical methods and technical
tools. Improved detectability and reliability, expanded range of spatial-temporal
perception, reduced degree of inference ambiguity, improved detection accuracy,
increased dimension of target features, improved resolution of spatial questions,
and enhanced fault-tolerant fusion are all advantages of data fusion over
independent processing of a single source.

Smart Devices
Human-Computer Interaction
Human-computer interaction (HCI) [6] is a subfield of computer science that
investigates how people (users) interact with computers, as well as the design,
evaluation, and implementation of user interfaces for computer systems that are
responsive to the user’s needs and habits. This multidisciplinary field
incorporates computer science, behavioral sciences, and design. One of the
primary goals of HCI is to make computer systems more accessible and useable. A
user interface consists of hardware and software that allows users to modify the
system while allowing the system to communicate with the user. HCI focuses on
the design, implementation, and evaluation of user interfaces. In its broadest
sense, HCI occurs when a human user and a computer system collaborate to
achieve a goal. Usability is the part of human-computer interaction concerned
with making it, among other things, successful, efficient, and enjoyable for the
user. Usability entails usability, productivity, efficiency, effectiveness, learnability,
retention, and user interest.

Context Awareness
Figure 1-11 depicts sensor data context awareness [7]. The sensor data and
context awareness provide better infrastructure and ambiance.

Figure 1-11 Data awareness schemes in IoT

Actuators
The applications in a smart city [10]—such as health care, smart agriculture, and
other industrial applications—use actuators [8], such as drives, motors, and
other physical signal converters. A wireless sensor and actuator network (WSAN)
[9] comprises automated actuators. Microcomputers normally link directly to
tiny actuators; however, heavy-load actuators are coupled via driver circuits.
Linear and rotational moving actuators are the two types of actuators that move.
A huge number of our daily demands, such as fans and escalators, are met by
these actuators.
Electric, pneumatic, and hydraulic power sources are also used to classify
them. Electric actuators are the most frequent, and PWM signals are generated by
the system control actuators like servo and stepper motors. The significant
change in the pulse width, time, and change in frequency is reflected in the
actuator’s velocity, rotational direction, and amount of torque exerted. Most
actuators in the industry are actuated through PLC boards. This chapter
showcases building prototypes with small servos and steppers, which are often
accomplished using SBCs like Arduino and Raspberry Pi.
Table 1-1 describes the actuator types mentioned in this book, including
micro steppers, SG90, and infrared. To keep things simple, these actuators are
primarily programmed using Arduino and Raspberry Pi ideas.
Table 1-1 Actuator Types

S.No Actuator Output Operating Power Number of External Connectivity


type range required wire battery type
connection source Analog/i2c/spi,
required digital/driver
requirement
1 Servo Angular 0-5 v Less than 3 Not PWM
motor motion 1W necessary
for low
power

2 Stepper Angular 2.55 v-2.8 1.68 4 Yes Drivers or DPDT


motor position v Amps relay

3 Oled Digital 3.3V-5V 3.3v 12C pins yes IIC & SPI
display display 20mA max

4 Relay Mechanical 5ms-20ms 5V 3 No Both digital and


contacts (unless analog
and solid it’s12V
state relay)

5 Solenoid Mechanical 5-10ms 9-65W 2 terminals External Both digital and


energy 15-150ms each regulator analog
angular or
motion separate
power
supply
6 IR led Light 760-1nm 1.2-3.4V 2 pins for no Both digital and
each analog
S.No Actuator Output Operating Power Number of External Connectivity
type range required wire battery type
connection source Analog/i2c/spi,
required digital/driver
requirement
Max =
780-50nm

7 Heat Thermal 1000°C Not Wires not Acid Tube box


exchanger and 1000 needed needed batteries
bars

8 Speaker Sound 60 Hz – 18 100 – 2 or more No Digital


pressure kHz 1000
level (SPL) watts
in dB

9 Linear Straight 5 lb – 15 – 4 pins DC Digital


actuator line 10000 lb 2000 Battery
motion/ force pounds
mechanical
energy

IoT and Smart City Applications


Automobile Sensors
Currently, modern automotive design can be accomplished using a variety of
sensors [12]. These are integrated into the vehicle’s engine to detect and resolve
issues such as repairs and service. Sensors in automobiles keep an eye on the
vehicle’s operation. The owner of a car has no idea how many sensors their
vehicle contains. Automobile sensors are sophisticated sensors that can monitor
and control various parameters, including oil pressure, temperature, emission
level, and coolant level. Numerous types of sensors are used in automobiles, but it
is critical to understand how they work. To demonstrate the purpose of these
sensors, the following is a list of the most frequently found sensors in
automobiles. The sensor depicted in Figure 1-12 is used in automobile systems.
Speed sensor for the engine
Oxygen sensor for the exhaust manifold
Mass airflow sensor for the exhaust manifold
Fuel temperature sensor for the exhaust manifold
Camshaft position sensor for the exhaust manifold
Throttle position sensor for the exhaust manifold
Vehicle speed sensor for the exhaust manifold
Spark knock sensor for the exhaust manifold
Coolant sensor for the exhaust manifold
Voltage sensor for the exhaust manifold

Figure 1-12 Some important automobile sensors

Smart Home Sensors


Smarter homes are established with IoT, cloud tech, and logical event processing.
IoT allows mobile applications [11] with various sensors to be managed and
communicated remotely. Sensors can monitor and regulate a variety of household
appliances, such as air conditioning, lighting, and other environmental controls.
As a result, it integrates computer intelligence with household equipment,
allowing for temperature monitoring indoors and outdoors and appliance
operation.
Cloud technology enables expandable processing energy, memory availability,
apps for designing, administering, and operating home services, and remote
control of home equipment. A rule-based event processing system manages an
advanced smart home’s overall control and orchestration. The term smart home
refers to a domestic application of building automation that encompasses all
embedded technology and its control and automation. It encompasses home
appliances like air conditioning/heating systems, smart TVs, large appliances,
and IP security cameras that can talk with their owner on a time and event basis
through mobile phones and the Internet. The home electrical system is made of
switches and sensors connected to a centralized IoT system operated by the
homeowners and controlled via the cloud, GSM, and WLAN connectivity.
The main advantages include energy efficiency, security, reduced operating
costs, and user sophistication. The convenience, cost, and reduced operating time
provide plenty of energy savings to the users. These techs are more adaptable to
changes in the needs of outpatients, such as post-surgical people recovering in
their homes. Its architecture is frequently adaptable enough to integrate various
devices from multiple manufacturers and standards. Figure 1-13 depicts the
sensors used in a smart home system.
Figure 1-13 Smart home sensors

Smart Transportation Sensors


Improvements in ICT (Information and Communication Technology) devices have
enabled opportunities for intelligent and sustainable transportation systems
[13]. ICT in transportation helps sustainability, safety integration, and high-
speed, accurate responses. The primary expectation of people using intelligent
transportation like fast mobility, environmental sustainability, and economic
development through goods and service transportation can be done through ICT
tools. The platform used by intelligent transport systems (ITS) to access, gather
and assess precise environmental data is crucial to its operation.
There are typically two types of sensor platforms. The first is an intra-vehicle
sensing platform that collects data about a vehicle’s condition. The two
approaches of sensing are used in ITS. An intra-vehicle sensing platform collects
data about a vehicle’s working conditions. An urban sensing platform gathers
information about traffic conditions. Sensing technology has become essential for
vehicle-to-vehicle (V2V) [15] and vehicle-to-infrastructure (V2I) communication.
The data is further communicated to a transportation management system (TMS)
for further data analysis and prognostics. The data can offer prognostics that can
be used for decision-making, reducing pollution, emission traffic congestion, and
road reconstruction.
Non-intrusive sensors offer information like the location of the signal
acquired through GPS devices, traffic queue density through LIDAR and traffic
conditions through combined GPS information, and road and weather conditions.
Sensors, such as high traffic lights, are typically placed in higher positions to
monitor the region of interest. These sensors are also mounted under bridges
and directly beneath a surveillance zone. Some sensors are positioned at the
ground level to detect pedestrians. These are mostly used for single lanes and
unidirectional traffic due to their vulnerability to interference from neighboring
objects. Figure 1-14 shows sensors utilized in intelligent transportation.

Figure 1-14 List of sensors in transportation


Non-invasive sensors can more effectively perform many intrusive sensor
duties. Weather conditions, like rain, fog, snow, and dust pollution, significantly
impact them. To make educated decisions about traffic improvement projects,
precise traffic statistics are required. Drivers are more likely to detect non-
intrusive sensors, leading to varied and faster responses, such as slowing down
and driving in the proper lane. It is critical not only to install these sensors but
also to reduce driver reaction times based on the collected data and provide a
more realistic depiction of the context and reality of the road or avenue.

Summary
This chapter overviewed sensors, actuators, and other communication protocols.
Various sensor usage with different applications was also addressed in this
chapter. Sensor classification and interfacing with boards are discussed in the
next chapter.

References
[1] S. Long and F. Miao, “Research on Zigbee wireless communication technology
and its application,” 2019 IEEE 4th Advanced Information Technology, Electronic
and Automation Control Conference (IAEAC), pp. 1830–1834. doi:
10.1109/IAEAC47372.2019.8997928.
[2] K. Pahlavan and P. Krishnamurthy, “Evolution and Impact of Wi-Fi
Technology and Applications: A Historical Perspective,” International Journal of
Wireless Information Networks, vol. 28, Nov. 19, 2020, pp. 3–19.
https://doi.org/10.1007/s10776-020-00501-8.
[3] U. Noreen, A. Bounceur, and L. Clavier, “A study of LoRa low power and
wide area network technology,” 2017 International Conference on Advanced
Technologies for Signal and Image Processing (ATSIP), pp. 1–6. doi:
10.1109/ATSIP.2017.8075570.
[4] Dawoud Shenouda Dawoud and Peter Dawoud, “Design of I2C Bus and
Operation,” in Microcontroller and Smart Home Networks, River Publishers,
2020, pp. 55–112.
[5] Dawoud Shenouda Dawoud, Peter Dawoud, “Serial Peripheral Interface
(SPI),” in Serial Communication Protocols and Standards RS232/485,
UART/USART, SPI, USB, INSTEON, Wi-Fi and WiMAX, River Publishers, 2020,
pp.191–244.
[6] Erin T. Solovey and Felix Putze, Improving HCI with Brain Input: Review,
Trends, and Outlook, Now Publishers, 2021.
[7] P. S. Gandodhar and S. M. Chaware, “Context Aware Computing Systems: A
survey,” 2018 2nd International Conference on I-SMAC (IoT in Social, Mobile,
Analytics and Cloud), 2018, pp. 605–608.
[8] Jeffrey Wishart, Yan Chen, Steven Como, Narayanan Kidambi, Duo Lu,
Yezhou Yang, “Sensor and Actuator Hardware,” in Fundamentals of Connected
and Automated Vehicles, SAE, 2022, pp.70–89.
[9] A. Eraliev and G. Bracco, “Design and Implementation of Zigbee Based
Low-Power Wireless Sensor and Actuator Network (WSAN) for Automation of
Urban Garden Irrigation Systems,” 2021 IEEE International IOT, Electronics and
Mechatronics Conference (IEMTRONICS), 2021, pp. 1–7. doi:
10.1109/IEMTRONICS52119.2021.9422568.
[10] N. Mishra, P. Singhal, and S. Kundu, “Application of IoT Products in Smart
Cities of India,” 2020 9th International Conference System Modeling and
Advancement in Research Trends (SMART), pp. 155–157. doi:
10.1109/SMART50582.2020.9337150.
[11] A. Eleyan and J. Fallon, “IoT-based Home Automation Using Android
Application,” 2020 International Symposium on Networks, Computers and
Communications (ISNCC), 2020, pp. 1–4. doi:
10.1109/ISNCC49221.2020.9297320.
[12] S. Wasnik and R. Venkatesh, “Understanding usage of IoT Applications
and its impact on consumer decision making in Indian Automobile industry,”
2022 International Conference on Decision Aid Sciences and Applications
(DASA), 2022, pp. 1259–1264. doi: 10.1109/DASA54658.2022.9765216.
[13] Saravjeet Singh and Jaiteg Singh, “Location Driven Edge Assisted Device
and Solutions for Intelligent Transportation,” in Fog, Edge, and Pervasive
Computing in Intelligent IoT Driven Applications, IEEE, 2021, pp.123–147. doi:
10.1002/9781119670087.ch7.
[14] Shalli Rani, R. Maheswar, G. R. Kanagachidambaresan, Sachin Ahuja, and
Deepali Gupta, Machine Learning Paradigm for Internet of Things Applications,
John Wiley & Sons, 2022.
[15] S. Kulkarni, A. Darekar, and S. Shirol, “Proposed framework for V2V
communication using Li-Fi technology,” 2017 International Conference on
Circuits, Controls, and Communications (CCUBE), 2017, pp. 187–190. doi:
10.1109/CCUBE.2017.8394163.
[16] G. R. Kanagachidambaresan, Role of Single Board Computers (SBCs) in
rapid IoT Prototyping, Springer, 2021. https://doi.org/10.1007/978-3-
030-72957-8.
© The Author(s), under exclusive license to APress Media, LLC, part of Springer
Nature 2022
G. R. Kanagachidambaresan, Internet of Things Using Single Board Computers
https://doi.org/10.1007/978-1-4842-8108-6_2

2. IoT Sensors and Their Interfacing


Protocols
G. R. Kanagachidambaresan1
(1) Chennai, India

Sensors can detect specific entities or functions by looking for them in


the environment [1]. Electromechanical, optoelectrical, or electronic
equipment can all be used to create these devices. Detectors for
physical presence, such as flame or metal, can be found. Others include
sensors that monitor gas and chemical concentrations and other sorts
of sensors. There are additional varieties that can detect motion or
closeness, while others can monitor physical qualities like temperature,
pressure, or radiation, for example [3].
It depends on the application [2], but electromagnetic fields, optics,
or a mix of these can be used. It is common practice to employ a variety
of sensors, detectors, and transducers in a wide range of industries to
evaluate, monitor, and regulate machines’ processes and functions. As
the Internet of Things (IoT) becomes more widespread, so does the
demand for sensors as the main automation tool [5]. Figure 2-1
showcases different types of sensors.
Random documents with unrelated
content Scribd suggests to you:
would put to him. He had taken his hat and come out the moment
Captain Davenal left him: business and all else gave way before this.
CHAPTER LXI.

THE BARGAIN SEALED.

Mark Cray sat in his wife's sick-room. Mark Cray found it (between
ourselves) rather tiresome to sit in his wife's sick-room: and Mark
was very apt to doze asleep at his post. Mark was asleep now. He
was dreaming a charming dream of greatness--in which some grand
scheme of Barker's had succeeded, and he and that gentleman were
sailing about the atmosphere in a triumphal car of gold, looking
down with complacency on the poor toiling mortals in the world
below--when Dorcas came in with a whisper, and aroused him. Mr.
Oswald Cray was in the dining-parlour waiting to see him, she said:
and Mark, after a stare at the girl, descended, pushing back his
clustering hair, which had disarranged itself in his sleep.

Oswald was standing near the fire. He turned to Mark and spoke
in a quiet tone.

"I have a question to ask you, Mark. It relates to the past. Who----
"

"Oh, never mind the past," interrupted Mark, with a half-testy,


half-careless sort of manner. "I'm sure there's enough worry in the
present without going back to that of the past. I wish that horrid
mine had been sunk a thousand fathoms deep before I had had
anything to do with it. I daresay I shall pay you back some time!"
"It is not about the mine I wish to speak to you, or of payment
either," calmly rejoined Oswald. "But, Mark, I want the truth from
you--the truth, mind--upon another subject. It was you, was it not,
who gave the chloroform to Lady Oswald?"

Mark made no reply, either truthful or otherwise. The question


was so exceedingly unlike any he had expected that he only stared.

"It was supposed, I know, at the time to have been administered


by Dr. Davenal. But I have reason to believe that it was administered
by yourself during his temporary absence from the chamber, and
against his sanction. Was it so, Mark?"

"I suppose you heard this from the doctor himself at the time?"
was Mark Cray's remark. "I remember you were worriting over it."

"I beg you to answer my question, Mark. What you say shall go no
further."

"Well, yes, it was so," said Mark; "though I'm sure I can't think
why you want to bring up the thing now. I did give her the
chloroform, but I gave it for the best. As I was to perform the
operation I thought I had a right to exercise my own judgment,
which was opposed to the doctor's. I was very sorry for the result,
but I did it for the best."

"I wish you had told me the truth at the time, Mark. You suffered
me to believe that the chloroform was given by Dr. Davenal."

"And what difference did it make to you which of us gave it?" was
Mark Cray's reply, not an unnatural one. "You may guess that it was
a thing I did not care to speak of. So long as it was assumed we
gave the chloroform conjointly, in accordance with ordinary practice
and our best judgment, nobody could say a word; but if it had been
disclosed that I gave it by myself, on my own responsibility and
against the doctor's opinion, I should have had the whole town
carping at me."
Oswald had nothing further to say. He could not tell the bitter
truth--that this miserable misapprehension had wrecked his hopes of
happiness, had been making an ice-bolt of his heart in the
intervening years.

Mark escaped, and returned to his wife's room, there to


endeavour to drop into his golden dreams again, from which he
seemed to have been aroused for no earthly use whatever. And
Oswald stayed on in the hope of seeing Sara.

Not only in the dining-parlour of Miss Davenal's house was there a


conference being held at that hour, but also in the drawing-room
above: and but for the all-absorbing nature of his own thoughts
Oswald Cray had not failed to hear the sounds. Captain Davenal had
got Neal there, before his aunt. And Mr. Neal was slipping out of all
accusations as smoothly as an eel.

The group was noticeable. Miss Davenal in her chair, upright and
angry, only partially understanding the cause of the commotion;
Captain Davenal standing, open and impetuous, talking very fast;
Neal full of repose and self-possession, all his wits in full play; and
Sara sitting apart in silence, her cheek bent upon her hand. Captain
Davenal charged Neal with treachery, general and particular. Neal
had his plausible answer ready to meet it all.

The interview was drawing to an end, and little satisfaction had


been derived from it. Poor Miss Davenal's ears were in a mazed
condition: desks, letters, inventions to Sara touching a Mrs.
Wentworth, and a hundred other charges, jumbling hopelessly upon
them, nothing being clear. Neal denied everything.

"You did tell Miss Sara Davenal that the young woman was my
wife," cried Captain Davenal, indignantly.

"I beg your pardon, sir," said Neal, respectfully. "I said I felt quite
sure she was not; that there must be some mistake. Miss Sara
perhaps will remember that such was my opinion."
"At any rate, you said the young woman made the charge,"
persisted Captain Davenal, irritated at the assured coolness.

"I did, sir. I understood the young woman to make it. She----"

"But she never did make it," interrupted Captain Davenal.

Neal shrugged his shoulders in submissive superciliousness, meant


for Mrs. Wentworth. "It may suit the young woman's purpose to say
so now, sir. I fear she is not very strict in her adherence to truth; but
she certainly did make it at the time. However, sir, I am quite willing
to take the blame upon myself, to allow that I misunderstood her."

"Why, you have not the face to tell me that you have gone on
believing it?"

"O dear no, sir. I was very soon afterwards convinced that the
thing was a mistake altogether."

"And pray, why had you not the honesty to say so to Miss Sara
Davenal?"

"I'm sure I should have been happy to say so, sir, had I possessed
the least idea that it would have been welcome. But after the first
blush, the matter appeared to be so very absurd that I never
supposed Miss Sara would give to it a second thought. If my silence
has caused any uneasiness, I can only say how deeply I regret it."

"Who is the young woman?" helplessly cried Miss Bettina. "And


pray, Neal, how came it, if you had anything of the sort to say, that
you did not say it to me? I am the proper person to hear these
things; a young lady is not."

Neal advanced a step to his mistress and spoke in his low clear
tone. "It was not my intention to speak to Miss Sara Davenal at all,
ma'am, or to you either; I should not have thought of doing such a
thing; but I could not help myself when Miss Sara questioned me
upon the point."

All that was reasonable and feasible, and Miss Davenal nodded her
head in approbation; but her nephew the captain got in a passion,
and insisted that he should be discharged there and then.

Neal was quite ready to go, he said, civilly courteous, if his


mistress saw fit to inflict upon him so severe a step. He was
unconscious of having done anything to merit it. Perhaps she would
be pleased to particularise his offence.

"He is a villain, aunt," broke forth the captain intemperately,


before Miss Bettina could speak. "I believe he has been one ever
since my father took him into the house. He has opened letters and
unlocked desks, and altogether played the part of deceit. He shall
go."

Neal interrupted, humbly begging the captain's pardon. He could


most truthfully assure his mistress that he had done nothing of the
sort; he had never opened a letter in the house, except his own; had
never touched a desk, but to dust it. If Captain Davenal could
mention any other distinct charge, he should be glad, as it would
allow him an opportunity of refutation. No. His conscience acquitted
him. He should quit the house, if he did have to quit it, with a clear
character, and he thought his mistress would acknowledge that he
deserved one. In the one little point concerning Mrs. Wentworth he
might have been in error: first, in too readily giving ear to what she
said; next, in not having spoken to Miss Sara to set the doubt at rest
in her mind. They were mistakes certainly, and he greatly regretted
them.

"Neal," said the captain, too hot-headed to maintain his dignity,


"I'd a hundred times rather be an open villain than a sneak. Why,
you know you have been nothing but a spy from the very moment
you entered the house. Aunt Bettina, listen! Before the regiment
went away I got into a little trouble, upon which I found it necessary
to consult my father, and I went----"

"A little what?" asked Miss Bettina.

"Trouble. A little difficulty."

"Oh, ah, yes," said Miss Bettina. "You were always getting into it."

"Not such as that," thought the captain. "Well, I had to go down


to Hallingham," he continued aloud, as he bent to her. "I did not
care that any of you should know it, and I got down one night
unexpected by my father. I was with him in his study for some time,
and went back so as to be at duty the next morning. Would you
believe"--pointing his finger at Neal--"that yon honest fellow was a
spy upon the interview?"

Mr. Neal was a little taken by surprise, and Sara looked up


astonished. But the man was not one to lose his impassability.

"He was at the window, looking and listening: not, I believe, that
he could see and hear very much. And he afterwards went abroad
and told of the interview: told that his master had a secret visitor at
night. You little thought, Mr. Neal, that the visitor was myself, or that
I should ever bring it home to you."

Neal, all unconscious innocence, gazed straight forward into


Captain Davenal's face. "I have not the least idea what it is that you
are speaking of, sir. My recollection does not serve me upon the
point."

"O yes, it does," said Captain Davenal. "A subtle nature such as
yours cannot forget so easily. Happily he to whom you carried the
tale of the evening was a trustworthy man: he kept his own counsel,
and told you Dr. Davenal's visitors were no business of his or of
yours. I speak of Mr. Oswald Cray."
"Mr. Oswald Cray!" repeated Neal, plunging into reflection. "On my
honour, sir, I have not the least idea of what it is you mean. A visitor
at night to my late master in his study? Stay, I do remember
something of it. I--yes--I was outside, taking a mouthful of fresh air
preparatory to retiring to rest, and I saw some one--a stranger I
took him to be--come stealthily in at the gate, and he was
afterwards shut in with my master. I'm sure sir, I beg your pardon,
even at this distance of time, if I was mistaken. I feared he might be
a suspicious character, and I think I did go to the window, anxious
for my master's personal safety. I could not have supposed it was
you, sir."

Was it possible to take Neal at a disadvantage? It did not seem so.

"And it was anxiety for your master's personal safety that caused
you afterwards to recount this to Mr. Oswald Cray? Eh?"

"Does Mr. Oswald Cray say I recounted it to him, sir?" inquired


Neal, probably not feeling sure of his ground just here.

"That's my business," said Captain Davenal, while Sara looked


round at Neal. "You did recount it to him."

"All I can say, sir, is, that if I did, I must have had some good
motive in it. I cannot charge my memory after this lapse of time.
Were I in any anxiety touching my master, Mr. Oswald Cray was
probably the gentleman I should carry it to, seeing he was a friend
of the family. I have--I think--some faint remembrance that I did
speak to Mr. Oswald Cray of that mysterious visitor," slowly added
Neal, looking fixedly up in the air, as if he were tying to descry the
sun through a fog. "It's very likely that I did, sir, not being at ease
myself upon the point."

Captain Davenal was losing patience. It seemed impossible to


bring anything home to Neal with any sort of satisfaction. At the
close of the captain's interview with Oswald Cray, the latter had
mentioned-- but not in any ill-feeling to Neal--that that functionary
had spoken to him of the night interview at Dr. Davenal's; had said
he was outside the window at the time. Oswald had not said more;
he deemed it well not to do so; but Captain Davenal had become at
once convinced that it was but one of Neal's prying tricks. He turned
to Miss Davenal.

"Aunt Bettina, this is waste of time. In nearly the last interview I


ever had with my father he told me he had doubts of Neal. He
feared the man was carrying on a game of deceit. I know he has
been doing it all along. Will you discharge him?"

"I can't understand it at all," returned Miss Bettina.

"I'll enlighten you one of these days, when you are not very deaf,
and we can have a quiet half-hour together. Sara, what do you say?"

Sara rose from her seat, her cheek flushing, her voice firm. "Neal
must leave, Aunt Bettina," she said, bending down to the deaf ear.
"Edward is quite right."

Miss Bettina looked at them all in succession. Had she believed the
accusations she would have discharged Neal on the spot, but she
doubted them. She had thought there was not so faithful a servant
in the world. And he looked so immaculate as he stood there!

"I don't go out of the house this night until he has left it, Aunt
Bettina," resumed the captain.

"This night!" echoed Miss Bettina, catching the words. "I can't let
Neal go without warning, leaving us without a servant. Who is to
wait upon us?"

"You shall have my servant, aunt; one I have brought home with
me----"

"No," said Miss Bettina, resolute in the cause of justice. "Neal, I


will not part with you in that hasty manner. I cannot judge yet
between you and Captain Davenal. That you must leave is obvious;
but you shall have the proper month's warning."

Neal stepped up, all suavity. "I beg your pardon, ma'am; you are
very kind, but I could not think of remaining a day to cause
unpleasantness in the family. I had better go at once. I have my
feelings, ma'am, although I am but a dependant. My conscience tells
me that I have served you faithfully."

"I think you have, Neal."

"I have indeed, ma'am, and I hope it will be remembered in my


character."

"Don't send to me for one," impetuously broke out Captain


Davenal. "And now, Neal, the sooner you are out of the house the
better. I shall keep my word: to see you away from it ere I quit it
myself."

Neal bowed; he could but be ever the respectful servant: and


retired. Miss Davenal was bewildered. What with parting with Neal,
what with being left with nobody to replace him, she could not
gather her senses. Captain Davenal sat down. First of all promising
her that the servant he spoke of should be in the house before
night, to remain with her until she was suited with one, he next
began to enlarge upon Neal's delinquencies, and try to make her
comprehend them.

Sara silently left the room. It was altogether a painful subject, and
she did not care to hear more of it now. She went down into the
dining-parlour, her movements slow and quiet; since Mrs. Cray's
increased danger noise had been avoided in the house as much as
possible. Some one was standing up by the mantelpiece, his back
towards her; in the dusk of the room--for evening was drawing on--
Sara took it to be Mark; and yet she thought she had heard Mark's
step in his wife's chamber now, as she came downstairs. This
gentleman was taller, too! He turned suddenly round, and the fire
threw its light on the face of Oswald Cray.

She stood a moment in surprise, and then went up to him, holding


out her hand as to any ordinary visitor, and saying a word of apology
that he should have been left there unannounced. A strange
expression, an expression of deprecation, almost of humility, sat on
his features, and he did not touch the offered hand.

"I waited to see you," he said. "I came here to see Mark, who has
been with me."

He stopped suddenly. His manner, his looks, were altogether


strange. Sara thought something must have happened.

"What is the matter?" she asked. "You look as if you had some
great care upon you."

"And so I have. That care that arises from shame and repentance;
from finding that we have been upon the mistaken road of wrong;
been treading it for years."

She sat down, quietly, timidly, looking to him for an elucidation,


half-frightened at his emotion.

"I wish to have an explanation with you, Sara. I want--if it be


possible--forgiveness. And I don't know how to enter upon the one
or to sue for the other."

She had rarely seen him otherwise than calmly self-possessed.


Generally, especially of late years, he was cold almost to a fault. And
now he was as one blazing with an inward fire: his lips were scarlet,
his brow was flushed, his voice quite hoarse with emotion.

"In the years gone by, I--I--threw you up, Sara. While I loved you
better than anything on earth, knowing that you were the only one
upon it who could ever awaken the passion within me, did I live to
centuries, I voluntarily resigned you. That night in the Abbey
graveyard at Hallingham, when we accidentally met--you have not
forgotten it--I told you that I could not marry you; that you were not
fit to be my wife----Hush! it was equivalent to it Sara, how can I
stand now before you and confess that I was altogether under an
error; that in my pride, my blindness, I had taken up a false view of
things, and was acting upon it? Can you see my shame, my
repentance, as I say it to you?"

"I don't understand you," she gasped, utterly bewildered.

"Will you so far pardon me--will you so far trust me after all that
has occurred--as to give me this one single word of explanation? To
whom did you attribute the cause of my acting in the way I did?
Whose ill-conduct was it, as you supposed, that had raised the
barrier between us?"

She hesitated, not perhaps caring to reply.

"I have had an interview today with Captain Davenal," he


resumed, in a low tone. "He has given me the details of the unhappy
business he was drawn into--the forged bills: I am, so far, in his
entire confidence. Will that help you to answer me?"

"It was that," she said.

"That alone?"

"That alone. There was nothing else."

"Well, Sara, can you believe me when I tell you that I never heard
of that business until today?--That Captain Davenal had nothing
whatever to do with my course of action?"

Indeed she looked as though she could not believe him. What else
then? she asked. Who had? Under what impression had he acted?
"Ah, there lies my shame! Sara, I dared--I dared to attribute ill-
conduct to another," he cried with emotion. "In my pride and folly, in
my mind's delusion, I presumed to set myself up for a judge over
one who in goodness might have crushed me to nothing. I shall
never get over the remorse during life."

"You--did not--attribute ill-conduct of any sort to me?" she said


with white lips.

"To you! To you whom I have ever believed to be one of the best
and truest women upon earth!--whom I have regarded through it all
with an amount of respect unutterable! No, no. But the question
serves me right."

She laid her hands one over the other as she sat, striving to keep
her feelings under control. Praise from him was all too sweet yet.

"O do me justice so far, Sara! While I gave you up I knew that to


my heart and judgment none were like unto you for goodness: I
knew that if my obstinate pride, my spirit of self-sufficiency, did but
allow me to marry you, you would be the greatest treasure man ever
took to himself. Can you tolerate me while I dare openly to say these
things?--can you believe that I am pouring them forth in my
humiliation? I have loved you deeply and fervently; I shall love you
always; but even that love has scarcely equalled my admiration and
my respect."

"But who else, then, could have had any counteracting influence?"
she returned, after a while.

"I dare not tell you."

"There was only Edward. I had no other brother. No one else


could have done anything to bring shame upon----oh, surely you
cannot mean papa!" she broke off, the improbable idea flashing over
her.
"Don't ask me, Sara! In mercy to myself."

"Papa who was so good?" she reiterated, paying no heed to his


words in her wonder. "He was so just, so kind, so honourable! I
think if ever there was a good man on earth who tried to do as God
would have him, it was papa. It is impossible you could suspect
anything wrong in him!"

"My object in waiting to see you this evening was, first, to make
my confession; secondly, to ask you to be more just, more merciful
than I have been, and to forgive me," he rejoined in a low tone. "I
must add another petition yet, Sara; that you would generously
allow this one point to remain as it is between us."

"But I think you ought to tell me," she urged. "Did you indeed
suspect papa?"

"Yes."

"But of what?"

"Ah, don't press me further, Sara, for I cannot tell you. A singular
accident led me to doubt Dr. Davenal's conduct--honour--I hardly
know what to call it--and there followed on this a chain of
circumstances so apparently corroborative of the doubt that I
thought I had no resource but to believe. I believed, and I acted
upon the belief: I judged him harshly; I treated him coldly; I gave
up you, my dearest hope and object in life; and this day only have
my eyes been opened, and to my shame I learn that the whole
thing, as regarded him, was a delusion. Will you--will you generously
let my confession rest here?"

"Papa would not have done as Edward did," she whispered.

"No, no, it was not anything of that nature. Money and money
matters had nothing to do with it. It was an entirely different thing. I
am so ashamed of myself that I cannot bear to speak of this further.
Surely I have said enough. It was a mistake, a misapprehension
altogether: and the greatest act of kindness you can do me now is
to let it rest here."

She sat gazing at him with questioning eyes, nearly lost in wonder.

"Yes, the impression under which I acted was a false one. There
existed no cause whatever for my estranging myself from you. But
for my own unpardonable credulity I need never have given you up:
and the past years of anguish--and I know they have been full of
anguish to both of us--ought not to have had place. I was misled by
an unfortunate chain of events: and nothing remains to me but
shame and repentance."

There ensued a silence. Sara was standing on the hearth-rug now,


and he took his elbow from the mantelpiece, where it had been
resting, and moved a step towards her.

"Can I ever hope for your forgiveness?"

"It seems to me that I have nothing to forgive," she answered, in


a low voice. "If circumstances misled you, you could not be blamed
for acting upon them, according to your belief."

"Sara!"--he laid his hand upon her shoulder, and his voice shook
with the intensity of its emotion--"may I dare to hope that you will
let me in my future life strive to atone for this?"

"How atone for it?" she faltered.

"Will you generously look over the past folly?--will you suffer it to
be between us as it used to be?--will you be my wife at last?"

She trembled as she stood, the conscious light of love mantling in


her cheek and in her drooping eye. Mr. Oswald Cray held her before
him, waiting and watching for the answer, his lips parted with
suspense.
"My brother's crime remains still," she whispered. "A memento of
the past."

"Your brother's crime! Should you be punished for that?--for him?


And what of my brother?" he continued, the revelation of the day
imparting to his tone a whole world of remorse, of self-condemning
repentance. "What disgrace has not my brother brought to me? O
Sara; should the ill wrought by these ties part us? It never ought to
have done so. Let us stand alone, henceforth, you and I,
independent of the world! Don't try me too greatly! don't punish me,
as in justice you might!"

For a moment her eyes looked straight into his with a loving,
earnest glance, and then dropped again. "I will be your wife,
Oswald," she simply said. "I have never tried to forget you, for I
knew I could not."

And as if relief from the tension of suspense were too great for
entire silence, a faint sound of emotion broke from Oswald Cray. And
he bent to take from her lips that kiss, left upon them so long ago in
the garden-parlour of the old house at Hallingham.

CHAPTER LXII.

"FINANCE," THIS TIME.

An afternoon in March. The sun was drawing towards its setting


amidst gorgeous clouds, and the red light, illumining the western
sky, threw its rays into an invalid's chamber, and lighted it up with a
warm hue.

Something else was drawing towards its setting; and that was the
feeble life of the chamber's chief occupant. It was a good-sized
pleasant room: the bed at the end farthest from the window; the
middle space devoted to the comfort of the invalid, a table with
some books upon its handsome cover, a sofa, easy chairs, velvet
footstools, and a few pretty ornaments to amuse the eye.

On the sofa, by the side of the fire, a coverlid of the lightest and
softest texture thrown gently over her, lay the invalid, her hands
white and attenuated, her face drawn and wan. But there was a
strange beauty in the face yet; in the eyes with their violet depths,
in the exquisite features shaded by the mass of silky hair. You do not
fail to recognise Mrs. Cray. Just now the eyes were closed, and she
was dozing peacefully.

At the opposite end of the hearth-rug, sitting restlessly in an easy


chair, was Mark. Of late Mark had been rather prone to be as still
and idle as his wife: the inert life wearied him, it chafed its spirit; but
there was no escape from it at present, and Mark Cray had perforce
resigned himself to it, as an imprisoned bird resigns itself in time to
its cage. Mark's future prospects were uncommonly vague: in fact
they were as yet bounded by the old expectation-anchor, the
"something" that was to "turn up." Any time in the past few weeks
his wife's death might have been expected, and Mark had yielded to
the idleness of the circumstances, and been tranquil. Mr. Barker was
away in Paris, and did not write; the Wheal Bang affairs were going
on to a comfortable conclusion, and Mark was letting the future take
care of itself. Strolling out for short walks; giving a quarter of an
hour to the "Times;" wandering for a few minutes into the sitting-
rooms and the presence of Miss Bettina, and lounging back in the
easy chairs by the side of his wife--thus had Mark's recent days been
passed.
But on this afternoon all was changed, and Mark's forced
quiescence had given place to a fidgety restlessness, very
characteristic of the old times. The post had just brought a letter
from Mr. Barker--some accident or contrary weather having delayed
the arrival of the French mail--and Mark Cray upon reading it felt
exalted into the seventh heaven.

Barker had succeeded! He had brought out a company in Paris


connected with finance; the great work he had been striving for so
long. In three weeks' time from that date it would all be in full
operation, and if Mrs. Cray were sufficiently well to be left, and Mark
came over to Paris, he could instantly step into a post in the
Company at a salary of eight hundred a-year to begin with. In about
six months' time, according to moderate computation, the thing
would be in full swing, and the profits inaugurated certainly at not
less than six thousand per annum; the half of which splendid income
should be Mark's. Such was Mr. Barker's news.

Can you wonder at Mark's restlessness? At his brightened eye, his


flushed face, as he sits there in the chair, bolt upright, his hand
raised incessantly to push back his hair? He glances across at
Caroline--whom he really loves very much still--and thinks what a
pity it is that all this good fortune should have delayed itself until
now. Had it come too late for her? Mark Cray in his sanguine fashion
actually asks himself the question, medical man though he is. For
the last two or three days Caroline had seemed so much better! only
on this very morning she had told Mark she felt as if she were
getting well again.

Mark moved his restless legs and contrived to knock down the
fire-shovel. The noise awoke Caroline. She stirred, and turned her
opening eyes on her husband.

"What was that? Did anybody come in, Mark?"


"I threw over one of the fire-irons. I am sorry it disturbed you.
They are always sticking out, tiresome things! It's not a proper
fender for a bedroom. Caroline, I have had a letter from Barker," he
continued, rising in excitement and standing before her on the
hearth-rug. "It's the most glorious news! The thing's realised at
last."

"What thing?" asked Caroline, feebly, after a pause of


bewilderment.

"The thing he has had on hand so long, the great scheme he has
been working for. O Carine, I wish you could get better! There's
eight hundred a year waiting for me in Paris; and there'll be an
income of at least three thousand before six months are over. Three
thousand for my share, you know. I'm sure you would like living in
Paris."

She did not answer. Nothing was heard save the quick gasps of
the panting breath, the result of excessive weakness, or--of--
something else coming very near. Mark was struck with some
change in her aspect, and bent down to her.

"Don't you feel so well, Carine?"

"I--feel--weary," was all she answered, her voice ominously low.

"Where's Sara, I wonder?" said Mark. "I'll go and send her to you.
You want some beef-tea, or something, I daresay."

Mark went down the stairs, meeting Sara on them. In the


drawing-room, with Miss Bettina, was Oswald Cray, who had just
come in. He was a frequent visitor now.

The half-brothers shook hands, coldly enough. They were civil to


each other always, but there could never be cordiality between
them. Not because of the past; but because they were so essentially
different in mind, in judgment, and in conduct.
"My luck has turned at last, Oswald," exclaimed Mark impulsively.

"In what way?" asked Oswald, who was leaning over the back of a
chair while he talked to Miss Bettina.

"I have just had a letter from Barker," answered Mark, running his
hand through his hair with his restless fingers. "I told you what a
great scheme he had got on hand in Paris, but you turned the cold
shoulder on it. Well, it's bearing fruit at last."

"Oh," said Oswald, evincing a desire, if his tone and manner might
be judged by, to turn the cold shoulder on it still, metaphorically
speaking. "How is your wife this afternoon?" he continued, passing
to a different subject.

"She has been so much better the last few days that one might
almost be tempted to hope she'd get well again," rejoined Mark,
volubly. "She seems tired now--low, I thought. Sara's just gone up to
her. What a shame it is that things turn out so cross-grained and
contrary!"

The concluding sentence, delivered with marked acumen, reached


the ear of Miss Bettina. She looked up from her knitting to scan
Mark.

"If Barker's luck had only been realised six months ago, what a
thing it would have been!" he went on. "Caroline might have got
better, instead of worse. In the enjoyment of luxuries in a home of
her own, renewed wealth and position in prospective, with the pure
air of the balmy French capital, there's no knowing what benefit she
might not have derived. And now it comes too late! I shall ever
regret it for her sake."

"Regret what?" sharply interposed Miss Bettina.

Mark replied by giving a summary of Barker's luck. Miss Bettina


paused, knitting-needles in hand, her keen grey eyes fixed on Mark,
as she tried to understand him.

"Barker in luck!" she repeated, catching some of the words and


the general sense. "Has he come into an estate in the moon? Don't
be a simpleton, Mark Cray."

Mark Cray felt exasperated. Nothing angered him so much as for


people to pretend to see these enchanting prospects with different
eyes from his own. He had always been convinced it was done only
to vex him. Poor Mark! He turned to Oswald, and began expatiating
upon the good fortune that was drawing so near; and Oswald saw
that it was of no use to try to stop him. The fever-mania had again
taken hold of Mark.

"What is the scheme, do you say?" asked Oswald, just as he


would have asked anything of a child; and perhaps it was not
altogether his fault that a sound of mockery was discernible in his
tone.

"It's connected with finance."

"Oh!" said Oswald.

"It is the grandest thing that has been brought before the public
for many a year," continued Mark, his voice impressive, his light eyes
sparkling. "The very greatest--"

"Grander than the Great Wheal Bang?" inopportunely interposed


Miss Bettina, Mark's earnest tones having enabled her to hear better
than usual.

"A hundred times grander," returned Mark, his mind too


completely absorbed in the contemplation of the grandeur to detect
the irony. "That is, better, you know, Miss Bettina. The mine was
very good; but of course there was a risk attending that, from water
or other causes, and the result unfortunately realised it. This is
different. Once the company is formed, and the shares are taken, it
can't fail. Barker and I went through the thing together over and
over again when he was in London; we had it all down before us in
black and white. We allowed for every possible risk and contingency,
and we proved that the thing could not fail, if once organised."

Oswald listened quietly. Miss Bettina had lost the thread again.

"The job was to organise the thing," resumed Mark. "It could not
be done without money, and Barker--to speak the truth--found a
difficulty in getting that. The money market was tight here, and men
don't care to speculate when money's not plentiful. He also required
the co-operation of some French capitalist, who would put his name
to it--some good man on the Bourse, and that was hard to get.
Those Frenchmen are all so narrow-minded, fight so shy. He knows
two or three good Englishmen in Paris who were willing to go into it,
and who helped Barker immensely with advice and introductions,
and that; but they had no funds at command. However, it's all
accomplished now. Barker has fought his way through impediments,
and surmounted them. The company's formed, the preliminary
arrangements are successfully carried out, and fortune is at hand."

"What's at hand?" asked Miss Bettina.

"Fortune," repeated Mark. "I shall take one of those nice little
boxes in the Champs Elysées. Some of them are charming. Or
perhaps only part of one if--if Carine--O dear! it is hard for her that
this luck did not fall in a year ago! I wonder," broke off Mark,
passing to another phase of his future visions, "I wonder whether, if
it were possible to get Caroline over to Paris now, the change might
benefit her?"

"You think of residing in Paris?" said Oswald.

"Of course I do. Paris will be the centre of operations. Barker


wants me over there at once; and the minute I join him I begin to
draw at the rate of eight hundred a-year. Just to go on with, you
know, until the money falls in."
"Mark," said Oswald, after a pause, "will it be of any use my
saying a word of warning to you?"

"On what subject?" returned Mark, looking up with surprise.

"On this subject. It seems to me that you are falling into another
delusion; that the--"

"No, it will not be of any use," burst forth Mark in strange


excitement "I might have known beforehand that you'd turn out my
enemy upon the point. If gold and diamonds were dropping down in
a shower from the skies you'd not stretch forth your hand to catch
them. There's a mist before your eyes, Oswald, that prevents you
seeing these things in their proper aspect."

He began to pace the room as he spoke, chafing considerably Why


was it that these little hints of warning awoke the irritation of Mark's
spirit? Could there be an undercurrent of doubt in his mind whether
Oswald was right and he wrong? However it might be, one thing was
certain--that no warning, let it come from whom it would, could do
any good with Mark.

As he turned to face them again, Sara entered. An expression of


alarm was on her face, and she closed the door before speaking.
She had come to say that Caroline appeared worse; altogether
different from usual.

Mark ran up the stairs; Miss Bettina put down her knitting to
follow. Sara turned to Oswald Cray.

"She knows you are here, Oswald, and would like to see you. She
wants to bid you goodbye. I think her saying that alarmed me more
than anything."

Caroline was on the sofa as before. Very quiet, save for her
panting breath. Her white hands lay listless, her face, dreadfully
worn though it was, was calm, tranquil. She looked at them one by

You might also like