Instant Download Advanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes 1st Edition Rishabh Jain PDF All Chapters
Instant Download Advanced Home Automation Using Raspberry Pi: Building Custom Hardware, Voice Assistants, and Wireless Nodes 1st Edition Rishabh Jain PDF All Chapters
com
https://ebookmeta.com/product/advanced-home-automation-
using-raspberry-pi-building-custom-hardware-voice-
assistants-and-wireless-nodes-1st-edition-rishabh-jain/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/raspberry-pi-home-automation-with-
arduino-1st-edition-andrew-k-dennis-2/
ebookmeta.com
https://ebookmeta.com/product/raspberry-pi-home-automation-with-
arduino-1st-edition-andrew-k-dennis/
ebookmeta.com
https://ebookmeta.com/product/raspberry-pi-home-automation-with-
arduino-second-edition-dennis-andrew-k/
ebookmeta.com
https://ebookmeta.com/product/learning-from-empire-medicine-knowledge-
and-transfers-under-portuguese-rule-1st-edition-poonam-bala/
ebookmeta.com
Excellence in Business Communication, Fourteenth Global
Edition Courtland L. Bovée
https://ebookmeta.com/product/excellence-in-business-communication-
fourteenth-global-edition-courtland-l-bovee/
ebookmeta.com
https://ebookmeta.com/product/handbook-of-global-media-ethics-1st-
edition-stephen-j-a-ward/
ebookmeta.com
https://ebookmeta.com/product/leviathan-below-avalar-explored-
book-04-1st-edition-deacon-frost/
ebookmeta.com
Advanced Home
Automation Using
Raspberry Pi
Building Custom Hardware, Voice
Assistants, and Wireless Nodes
—
Rishabh Jain
Advanced Home
Automation Using
Raspberry Pi
Building Custom
Hardware, Voice Assistants,
and Wireless Nodes
Rishabh Jain
Advanced Home Automation Using Raspberry Pi: Building Custom
Hardware, Voice Assistants, and Wireless Nodes
Rishabh Jain
Agra, Uttar Pradesh, India
v
Table of Contents
Using Interrupts��������������������������������������������������������������������������������������������������40
Analog Input��������������������������������������������������������������������������������������������������������42
Automating Scripts and Tasks�����������������������������������������������������������������������������47
Summary������������������������������������������������������������������������������������������������������������48
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
Index�������������������������������������������������������������������������������������������������297
ix
About the Author
Rishabh Jain has been very successful in national level robotics and
innovations-based competitions with his team. He has a keen interest
in technology which emerged in childhood when he customized and
experimented with his toys and electronic devices. He believes in learning
by doing. He is an avid contributor on technical sites dedicated to learning
hardware, from beginner to pro sites, and has contributed more than
50 projects, including a stepwise writeup and project demonstration
videos. He recently joined an India-based product design company as an
electronics and embedded design engineer.
xi
About the Technical Reviewer
Fabio Manganiello is a 15-year veteran of machine learning and
dynamic programming techniques. During his career, he has worked on
natural language processing with a focus on automatically labelling and
generating definitions for unknown terms in big corpora of unstructured
documents. He also worked on an early voice assistant (Voxifera)
developed in 2008. He developed machine learning techniques for
clustering, inferring correlations and preventing the next step in complex
attacks by analyzing the alerts of an intrusion detection system. In the
recent years, he combined his passion for machine learning with IoT and
distributed systems. From self-driving robots to people detection, from
anomaly detection to data forecasting, Fabio likes to combine the flexibility
and affordability of tools such as Raspberry Pi, Arduino, ESP8266, MQTT,
and cheap sensors with the power of machine learning models. He's
an active IEEE member and an open source enthusiast, and he has
contributed to hundreds of open source projects over the years.
xiii
Acknowledgments
Writing a book is harder than I thought and more rewarding than I could
have ever imagined. None of this would have been possible without my
Mom, Dad, brother, Rajat and sister, Divya who taught me discipline,
manners, respect, and so much more that has helped me succeed in life.
To my best friends, Puneet, Rahul, Aniket, and Amit. They stood by me
during every struggle and all my successes. That is true friendship. I want
to thank God most of all, because without God I wouldn’t be able to do any
of this. I’d also like to thank my professors and teachers who have helped
me learn and practice electronics.
To all the organizations who gave me the opportunity to work, without
the experiences and support from my peers, this book would not exist.
Thanks to everyone on the Apress team who helped me so much. Special
thanks to Aaron for reaching out to me to write this book and Jessica for
the wonderful editorial support and guidance.
xv
Introduction
Automation does not have to be difficult. In this book, we will learn
about the Home Automation system using Raspberry Pi and supporting
modules. The journey will be challenging but by the end of the book, you
will have hands-on exposure to many of the fundamentals of automation
tools. You will work with hardware design, home automation platforms
and protocols, write code in two programming languages namely Python
and C. Also, you will get the basic understanding of voice assistants and
Image processing using OpenCV.
xvii
CHAPTER 1
Introduction to
Raspberry Pi
Welcome to the world of automation. Almost everything around us is
being automated, from your spectacles to huge machinery in factories.
According to a survey, the global market of automation is expected to be
around USD 8.42 billion by 2027. It is leading to Industry 4.0 while writing
this book. Industry 4.0 means smarter factories, where all machines can
talk by exchanging real-time data with the help of the IoT (Internet of
Things) and IoE (Internet of Everything) infrastructures.
There are many micro-controllers, modules, and sensors available in
the market that are used to make things smarter. Among these, Raspberry
Pi is one of the most powerful, cheapest, and smallest computers loved by
hobbyists. You can do pretty much everything with this palm-sized board.
In other words, it is just a general-purpose, small computer.
This book is dedicated to advanced home automation, but that doesn’t
mean it does not cover the basics of Raspberry Pi. In fact, this chapter
starts with an introduction of Raspberry Pi. You learn what’s inside of it,
which other components are required to get started with it, and how you
can access it from your laptop. At the end of this chapter, you learn which
other sensors and modules are required to create an advanced home
automation system.
R
aspberry Pi
Raspberry Pi is an affordable yet powerful credit card-sized computer
that runs on Linux. The Linux kernel is optimized to work on an ARM
processor, which drives the Raspberry Pi. Among all the Linux distros,
Raspberry Pi OS is preferred and it works very smoothly on Raspberry Pi.
One feature that makes it more useful are its general-purpose Input/
Outputs (GPIOs), which are available as pin headers and can be used
to connect different sensors and actuators. An Ethernet port and some
USB ports are also there and you can use them to connect your mouse,
keyboard, dongle, etc.
There are many versions of Raspberry Pi based on features, RAM size,
processor architecture, and footprint size. The latest version while writing
this book was Raspberry Pi 4 Model B, which incorporates a whopping
8GB RAM, the largest memory size released so far for these devices. In
Figure 1-1, you can see Raspberry Pi Model B+, an older version. The smaller
board in the figure is the Raspberry Pi Zero W (the W stands for WiFi).
2
Chapter 1 Introduction to Raspberry Pi
3
Chapter 1 Introduction to Raspberry Pi
Hardware Requirements
As you are now familiar with the Raspberry Pi board, let’s look at the other
components required to make it work. The Raspberry Pi board is the
heart of your project, but it can’t get started without the power supply and
storage.
A Power Supply
Previous versions of the Raspberry Pi board use microUSB for delivering
power, but new versions like Raspberry Pi 4 use a USB-C type power cable.
All Raspberry Pi models run on a 5V power supply. Some mobile chargers
can be used to power the board, but they might fail in providing consistent
power. I recommend using an adapter that has at least 2A of current rating.
There are some adaptors available in the market specifically designed for
Raspberry Pi boards.
A microSD Card
The Raspberry Pi board is equipped with on-board RAM, but it lacks on-
board flash for storing OS and programs. A microSD card plays the role of
flash memory and handles all the storage. Not all SD cards work perfectly,
so you need at least an 8GB class 6 microSD card, or you can buy an official
microSD card, which comes with a preloaded OS image. You also need
a USB microSD card adaptor to plug in to your computer to flash the OS
onto the card.
4
Chapter 1 Introduction to Raspberry Pi
a case for your Raspberry Pi board to protect it from dirt and from short
circuiting. Also, passive cooling is required when using a Raspberry Pi 4 or
higher.
S
oftware Requirements
Once you have the required hardware parts, you need to set up some
software applications to flash the OS and access it from a laptop or PC.
First of all, you need a compatible OS image. There are many Debian
and Linux-based distros available for Raspberry Pi. Let’s look at some of
the popular OSes that are suitable for Pi.
5
Chapter 1 Introduction to Raspberry Pi
6
Chapter 1 Introduction to Raspberry Pi
7
Chapter 1 Introduction to Raspberry Pi
8
Chapter 1 Introduction to Raspberry Pi
5. This may take a bit of time, but when it’s finished, you
can remove the SD card and insert it into your Pi.
9
Chapter 1 Introduction to Raspberry Pi
After the booting process, you need to log in using the default
credentials of the Raspbian OS:
• Username: pi
• Password: raspberry
10
Chapter 1 Introduction to Raspberry Pi
That’s it. You have successfully booted your Raspberry Pi. It’s time
to configure Pi according to your needs. First of all, change the default
password so that you can secure your system from unwanted cyber-
security attacks.
All the configurations and settings related to Pi can be accessed
through the raspi-config command. The next section covers how to use
this command and change the password and other settings.
U
sing raspi-config
raspi-config is a command that you can run from a terminal emulator to
configure the settings. On the Raspbian Desktop, you can find this setting
by clicking the raspberry icon in the upper-left corner, then choosing
Preferences ➤ Raspberry Pi Configuration (Figure 1-7). Clicking the menu
entry is the same as running raspi-config in a terminal emulator.
11
Chapter 1 Introduction to Raspberry Pi
Most of the time, you’ll use the terminal to execute commands. You
can access the command terminal by choosing Accessories ➤ Terminal,
as shown in Figure 1-8.
12
Chapter 1 Introduction to Raspberry Pi
Now, type sudo raspi-config on the command line and press Enter.
You’ll see the window shown in Figure 1-9, where you’ll find all the
configurable settings.
13
Chapter 1 Introduction to Raspberry Pi
Let’s explore all these options and see what you can change in the
beginning:
14
Chapter 1 Introduction to Raspberry Pi
15
Chapter 1 Introduction to Raspberry Pi
16
Chapter 1 Introduction to Raspberry Pi
You can now use this terminal to execute any command on the Pi. The
next section discusses how to access the desktop of the Pi.
17
Discovering Diverse Content Through
Random Scribd Documents
"Send over our planes," a portly congressman screamed.
"Kill them all, the monsters."
"It was terrific," Hallam broke off his recitation to comment. "I was
sure several of those old cobbers would have a heart attack, they
were so mad. Then somebody cut off the microphones and the noise
became bearable. Finally the President managed to get their
attention and we all sat down again and listened."
"Your response is most heartening," the President resumed, "and just
what I expected. However I want to make one point clear now. I, and
Mr. Macpherson agrees with me, do not believe that the H-bomb or
any other ordinary form of war is the answer to this for two reasons.
"Firstly, we have only a small fertile population left on which to rebuild
our nations. The radiation effects of nuclear warfare might well turn
those children of the future into misshapen monsters. We would have
revenge at the cost of self destruction. Secondly, this is still an
undeclared war. The Reds are probably counting on victory and do
not know that we are aware of their villainy. They will not expect a
counter-attack as long as we pretend ignorance. It is up to us to
deliver one that will catch them too by surprise. If we succeed we turn
what appears to be inevitable defeat into victory. At the same time we
must direct our efforts into other channels and find ways in which to
maintain our strength in manpower as well as in machines.
"For our first task—that is, the winning of the war, I believe we must
remember the old saying, fight fire with fire. Our best hope is in
utilizing our own scientists to produce biological or chemical weapons
which will do to the Communists what they have done to us. For the
second task I believe we will need new laws and new concepts of
human behavior. We will have an opportunity, unequalled in history, to
determine the future quality of our citizens. Let us go to this task full
of confidence in our ability and thankful the Creator has allowed us
another chance."
"After the President spoke," Hallam continued, "there was an
explosion of applause, cheering, hand-clapping, shouting, whistling. It
was long minutes before Mr. Macpherson could get their attention. He
pledged Canada's full cooperation. In turn, the Commonwealth
observers promised to get the help of their governments. Finally,
committees were formed and the details of the President's broad
concepts hashed out. Not every problem was settled right then, of
course; that will take months, but the preliminary decisions were
made."
"That's about the size of it," Hallam drained his glass, "except for
what we are to do. Since we have been working on the S-Flu, we are
to keep on, but with a different goal. We now have to build up a virus
of our own with either a sterility factor or lethal properties and a very
short incubation period."
"That's what the President meant by turning their weapons against
them," Pat said.
"That is part of it," Hallam agreed. "It is axiomatic that this new virus
must be far enough from the old one that there is little or no cross
immunity, so that the vaccine the Reds took will not protect them."
"A tall order," I said glumly, "and while we try to do it, we hope the
Commies will sit still, convinced that we are not suspicious of them."
"Like any murderers," Hallam said, "the Russians have to wait to see
if the police suspect them. In the meantime, if they are smart, they
won't draw suspicion on themselves by trying to profit from their
crime. If my reasoning is correct, they may sit tight long enough for
our surprise counter-attack to work."
"You said there were several committees, didn't you?" Pat questioned
him. "Have you any idea what other plans were made?"
"There are many lines of attack open," the Chief replied. "The
Departments of Agriculture of our countries have been working on
B.W. for some time, as it concerns plants and animals. If we could
ruin Russian crops or kill their animals it might force them to
capitulate from starvation. The weather experts are studying ways of
doing the same thing by droughts, storms and so on. And of course
the physicists think of such things as causing radioactive clouds over
Siberia. The trouble is, we don't want to make the Reds suspicious
too soon, or give them an excuse for starting all-out atomic warfare,
or even so-called conventional war. Our people are close to extinction
now, with only ten million breeding males. It seems like a lot but
unless they are protected, we are finished."
"What's to be done about this sterility problem?" Polly spoke up.
"There's bound to be a lot of discussion and some bitter arguments
on that," Hallam smiled at her. "There are about thirty million women
of childbearing age in the United States and Canada, of whom
roughly twenty million might be from sweet sixteen to a very desirable
thirty or so," he grinned at the girls as he talked and they laughed.
"O.K. that's us," Polly said, "the or-so gals."
Hallam continued, "And only ten million more or less desirable but
presumably still potent males from say eighteen to fifty or so." He saw
Pat's mischievous smile and added, "Yes, that's me." He went back to
his thesis. "Only five million of these would be of compatible age to
marry the younger women, assuming nobody is married right now. If
we could forget age differences, it means one man to every three
women of childbearing age. The problem is much more complicated,
as you can imagine, since many of these fertile men are already
married and many more women, who could bear children, are
married to sterile males. If we were Muslims or old-time Mormons, it
might be possible to start harems of fertile people but with our
present customs that's impossible."
"Rough on the sterile males," I said smugly, "but mighty nice for the
rest. What are we going to do—wear a badge or something?" I
stopped in sudden realization; Harry had had the flu. He sat there
silently, his face impassive. The only thing to do was to carry on.
"Get that smirk off your face," Pat ordered. "You aren't a free agent
any more."
"Sometimes I envy you real bachelors, Chief," I said, and sighed
deeply in mock despair.
Hallam chuckled and then said seriously, "If we sit and do nothing the
population will drop off drastically as the old folks die but eventually,
in a normal situation, the race would renew itself. It might be a good
thing too, we have too many people now, except for one thing ... we
need continuing manpower to beat the Communists."
He stopped to consider his next point. "To me, the logical solution is
legal artificial insemination, voluntary of course, with sperm from
carefully selected donors. In that way we would have less of a
population drop and, I believe, improve the quality of the race; but it's
a highly controversial question from scientific, legal and religious
points of view. The committee will take some time and a lot of
hearings before making even tentative decisions."
He stopped, and for a moment we were silent, thinking about our
problems. Pat spoke first, "I keep remembering how we became
aware of the S. factor ... I mean when that ferret aborted. I wonder if
we could use that as our weapon. If all the farm animals and women
in Russia were unable to conceive, or miscarry when they did, it
would do the trick ... and it's a lot harder to determine whether a
female is sterile than it is in a man."
"You have a possibility," I admitted. "Sometimes it's better to hit an
enemy with a variation of his own favorite trick than to have an
entirely new approach. If we could do that, we might fool the Reds
into thinking something had gone wrong with their own S-Flu virus,
such as another mutation. The difficulty is to avoid cross-immunity.
We might do better to alter the measlepox so it would turn on them
and kill them."
"Then you have lost the element of uncertainty that made the S-Flu
so valuable a weapon," Polly said. "They could rally in time to stop it."
"A very good point." Harry spoke for the first time.
Again there was silence. I got up quietly to refill the glasses. Harry
was staring at the fire; his face in the flickering light seemed tired and
sad. I caught Polly watching him and saw the look of concern in her
face and the faint wrinkle of perplexity between those artistically
darkened eyebrows. The Chief was sunk down in his chair, in a daze
partly of thought and partly of satiety. Absently he lifted his glass for a
refill and then, looking through the deep red port to the firelight, he
said to the room,
"The U.S. Navy is sending a special research team out to Formosa
and the Army one to Japan, to study measlepox. Years ago they
established well equipped research laboratories in those countries.
The Canadian government wants one to go to Hong Kong."
Pat threw a quick glance at me but said nothing as he went on.
"They asked me for suggestions and I told them I'd take the team, but
the Premier put his veto on that. He won't let me go. I objected to
married men because it's likely to be dangerous work, at least until
we get enough of the Russian vaccines to inoculate our men."
"When do they go?" I said.
"The advance parties should leave in a fortnight."
"Somebody should go from here, and since you can't go, that means
me."
I had no wish to be a hero but there is a certain pride in a man. Our
laboratory was the biggest, and I thought the best, virus research
center in Canada. Somebody obviously had to do the dirty work if we
were to be saved from destruction. Sooner or later the measlepox
would invade the Americas or be brought in deliberately by the Reds.
To paraphrase the old saying, as they wouldn't "let George do it," and
as George was my boss, I was next in line.
The Chief was nodding his head in reluctant agreement as these
thoughts ran in my head.
"Hold on a minute, there," Harry had come out of his trance and the
sadness in his face was replaced by the excited, determined look of
the volunteer, the man with an ideal. "This job is mine, it has to be!"
Polly was staring at him, her mouth half open, her drink stopped on
the way to her lips. She put it down and spread her hands in appeal.
"I declare, the man's just naturally crazy," she said to Pat.
"They both are," Pat muttered angrily.
None of the men paid any attention.
"Why so, Harry?" Dr. Hallam asked.
"Sir, I've never said much about my parents except that they were
medical missionaries in China and that I grew up there before the
Second World War. You knew that, didn't you?"
The Chief nodded in agreement.
"Well, there's one point in my favor. I speak several Chinese dialects
and can work without an interpreter. If we go to the mainland I know
my way about, too. And I know enough virology to do field work."
Hallam nodded again. "That's true enough."
"But that's not all. I have a personal score to settle with the Reds and
by God, here's my chance!" He leaned forward and almost spat the
words right into Hallam's astonished eyes. Seeing Harry get angry
was something like seeing an iceberg suddenly spout fire.
"I told you that my parents were missionaries in China. What I didn't
tell you is that they never got out!"
He stopped. The rush of angry words from his flushed face died away
into the room. In my mind they echoed again. "They never got out ...
never got out ... never." We waited. The soft rustle of the flames
seemed loud as their shadows wavered on the circle of still faces, all
eyes were riveted on Harry.
More quietly now, his face once more almost its impassive self, he
went on.
"They stayed with the Chinese Nationalist Forces all through the
world war and afterwards, when the Communists took over, they were
lost. When I was demobbed from the British Army I went to Hong
Kong but I couldn't trace them and I couldn't get back into China.
Some of the refugees I met thought they'd been executed for aiding
the anti-communists ... mostly their own converts to Christianity, but
there was no proof. That's why I came over here to work when I ran
out of money. Vancouver is the closest main port to the Orient and I
hoped I might keep in touch while I made a living. Now I know they
are almost certainly dead ... and I want a chance to do something to
beat those Red pigs."
His voice rose again on the last sentence and he looked straight at
the Director. Hallam had sunk deep into his chair, again, his eyes
shaded behind the heavy rims of his glasses.
"I see ... I see now," he murmured. "Yes, you must have your
chance."
I looked over at Polly. Her eyes were wet and her lower lip looked
suspiciously tight. She said nothing as Pat put a warm arm around
her shoulders.
Harry was staring again at the fire. He was not here. Somewhere in
China, or maybe nowhere in this world, was the red hell he saw in the
flames.
CHAPTER 9
The Ides of March, as I like to call the month, were upon us. Once in
a while the sun peered through the heavy clouds, sliding its pale
beams between their tumbling banks to reach the soggy earth. Then
came a night of rain, of heavy wind and thrashing trees; a faint
rumbling of thunder over the sea and the mountains. I woke up and
lay listening to the water as it dripped on the balcony while Pat, in
troubled sleep, muttered and moved beside me. I woke again to a
bright, cloudless sky, a perfect spring day.
After the routine checking of our animals and cultures, Dr. Hallam
called a halt.
"Pat, you're tired," he said. "I think you're going stale."
"I'm slowed to a walk. It must be spring fever."
"It's spring all right," I said. "Look at that beautiful sunshine. It's time
to shuck off the long woollies and take a big dose of sulphur and
molasses."
"What a horrible thought," Pat grimaced, "Did you ever taste it?"
"I sure did," I said. "My mother was the old-fashioned castor-oil-is-
good-for-you type. She thought I needed a tonic to get the sap
running every spring."
"The sap can run again ... right out to Stanley Park," Hallam grinned,
"and take Pat with you. She needs a rest and some fresh air. I'm
going to play golf. We'll start again tomorrow."
We had reached a lull in our experiments. It was the obvious time for
a break.
I drove slowly through the park until, in a grassy enclosure not far
from Brockton Point, we found the seclusion we wanted. In midweek,
at that time of day, we had the place almost to ourselves. I put down
a ground-sheet, opened the car blanket on it, and we lay down. The
mild sea breeze rustled soothingly in my ears and brought with it the
faint splashing of the tide against the jumbled boulders of the shore.
A deep sea ship hooted at the Lion's Gate bridge and, like an echo,
the answering call gave it clearance to pass. For a moment more I lay
still but the bustle of life around me was too strong to allow relaxation
and I sat up to look out over the harbor. I turned to Pat as she lay
quietly beside me. The wind had settled her dress closely to her
parted legs. I followed the clean lines upward, and when I got to her
eyes I saw that she had been watching me. They sparkled with
amusement.
"Like what you see, huh?" she teased me.
"Love it, darling," I replied and leaned over for a kiss.
She broke it off before I was through and as I backed away I saw the
slight frown that deepened the lines above her nose.
"What's the matter?"
"Nothing much, I hope. A slight pain in my stomach." She used the
word in the ordinary sense.
"Whereabouts?"
"Low down above the pubis. It's gone now."
I laid my hand on the lower part of her belly and palpated it softly.
There was no rigidity, no unusual mass.
"Does that hurt?" I probed deeper.
"No, it's a little uncomfortable, that's all."
I thought momentarily of the various possibilities and then dismissed
it. The day was too lovely to spoil with a clinical discussion.
"Something you ate, no doubt." I smiled at her and lowered my mouth
to touch her full red lips gently, once again.
She pushed me away. "That's enough. This place is too public."
I studied the bold contour of her nose and concluded that it was too
large for true beauty ... the French influence, no doubt, in her
Louisiana heritage. Her attractiveness was in her expressions more
than in physical structure, I decided, but the mouth was perfect, no
doubt about that, and her grey eyes as clear as a mountain pool
filtered through limestone. I snuggled close to her, contentedly, and
was beginning to doze in the fresh warmth of the springtime air when
I felt her body tighten. I opened my eyes and rested on one elbow,
watching her.
"What is it baby, the pain again?"
"Yes, it's crampy now ... something like a bad period," she twisted a
little.
"Is it that time of the month again?"
"It could be. I've been having odd periods, very slight flow. I thought I
might possibly be pregnant. It's been that way since I seduced you in
December."
"That wasn't seduction, baby. That was merely anticipating the
inevitable."
I began to question her seriously. There was little doubt in my mind
after a few minutes that, if she wasn't pregnant, she was not behaving
as a normal woman should. While we talked the pain returned,
cramping and severe. She went white and pressed her hands to her
belly in search of relief. That ruined the day. I took her home
immediately.
"Take your clothes off and lie on the bed. I want to examine you," I
said when we got there.
When I had finished there wasn't much doubt. She was about three
months pregnant and threatening to abort. I left her in bed while I
washed my hands. Then I came back and told her. For a moment she
tried to be brave but then the tears came and I held her tight while her
sobs shook us both.
"I've been afraid something might happen," she said finally, after I'd
wiped off her wet face with a towel.
I sat on the edge of the bed. "Why?"
"You know I've been working with female ferrets, infected from the
original one that aborted, trying to find out if that virus was a mutant
from the S-Flu."
"Yes, I know that."
"I've passed it through quite a few females now and it's been showing
definite differences. A week ago, I transferred it again and the ferrets
got sick. I was working with one three days ago and it got loose and
jumped on my shoulder and sneezed and clawed me as I tried to get
it down and put it back in its cage."
"You had your suit on, didn't you?"
"Of course I did, but after I came out of the shower I noticed a little
dampness. I checked the suit and found a defective shoulder seam
where the helmet joins on. I suppose the ferret's claws opened it up.
With all that movement I could have sucked some infected air into the
suit."
"I don't know. With a separate air supply it doesn't seem too likely
unless the claws carried virus inside like a hypodermic injection. It
didn't scratch you, did it?"
"A little bit, I think, but it was on a place where I couldn't see it. I
washed it with disinfectant later."
"Oh my God, what next?" I exclaimed. "But you've been having some
irregular bleeding before this. Maybe it would have happened
anyway. You don't have any signs of the flu?"
"I feel a bit stuffy and aching as if I were getting a cold."
"Well, we'll see. You rest here while I figure out what to do."
The fact that this might be the mutation we were looking for didn't
penetrate just then. All I cared about was that Pat was sick and I had
to take care of her, if possible, without a scandal. I was standing
beside the bed, my mind racing over the various possibilities when
she groaned and whispered, "John, the pain is really bad now. I think
I'm bleeding too."
I got her a couple of codeine tablets and then dialled the Chief. This
was one situation I couldn't handle myself, for obvious reasons, and I
needed someone with understanding and discretion.
He was there in less than fifteen minutes, fortunately having just
returned to the club house when I called. He heard my report. He
checked Pat himself. She was well along now and we both agreed
that there was no chance of stopping the miscarriage.
"Have you been close to many other people in the last three days?"
he asked her, looking very disturbed.
"Nobody but you and John, as far as I know," she gasped between
spasms of pain.
It was probably true. We three were working on the secret problems
in isolation during the day. Polly and Harry helped us with the
procedures that had to be done in the main lab and so were not in
direct physical contact with us. We seldom stopped work until long
after the day workers had left the Lab and were there in the morning
before them. We didn't go out for meals during the day as we had all
we needed on the top floor. I could see Hallam was concerned about
the disease getting loose. If the vaccine we had was no protection
from this new mutation, and if Pat had a case of flu it obviously
wasn't, then this new disease could raise hell among the people and
maybe finish what the Reds had started.
"We can't stay here, and we can't take her to a hospital," the Chief
decided. "We mustn't let this new virus get out. I'll have to take care
of her myself in the Research Lab. There are some instruments there
and we can get more if we need them." He looked down at Pat. "I'm
no obstetrician, my dear, but I think we can see you through this if
you agree."
Pat smiled tiredly. "You're a doctor, and a good one. Do what you
think best."
I had to agree even though it frightened me. I'd seen dozens of
similar cases in my earlier days as a young interne but my
imagination was too active where my own loved ones were
concerned. The main danger was sudden hemorrhage but we could
easily get blood sent up to us. Otherwise nature would probably take
care of things in its own way. By now it was after rush hour and the
Lab would be empty. Once more we let ourselves into the building
and went up to the top floor, using the elevator for Pat's sake. She
could hardly walk by now, even with our help, and it was a struggle to
get her to her room. Once there we stripped the bed down. I prepped
her and draped her for delivery and the Chief gave her intravenous
demerol and a capsule of seconal. Then we waited.
An hour later it was over. She had aborted spontaneously, and, as far
as we could tell, completely. With the assistance of a small dose of
ergot we had controlled the bleeding and the uterus was small and
firm. I checked her pulse and blood pressure. There was no sign of
shock. She lay there quietly after I had changed the linen and, as I
pulled the covers over her, she took my hand.
"I'm so sorry, John," she said weakly. "I guess I wrecked my own
plans for having your baby when I got careless with that ferret. Now
I'm probably sterile."
She began to cry silently, the big tears rolling slowly on to the pillow.
I stroked her damp hair back from her forehead and kissed her eyes
gently. "Maybe you aren't sterile," I said hopefully, "and even if you
are it doesn't matter. I love you, and I'll always love you, whether we
have children or not."
"I wonder how many years we'll have to spend cooped up in here?" I
said, half-seriously to Dr. Hallam later that night. Pat was sleeping
soundly under the influence of a capsule of sodium amytal he had
given her. We had cooked a steak dinner and now we sat, weary but
relieved, over our coffee.
"Lord alone knows," he said. "We'll have to stay here now until we
see if you and I are going to catch this thing and what the effects will
be. I hope for the sake of our research project we do get it, although
I'm not happy about being a guinea pig. Even if it proves to be a
suitable weapon we still have to come up with a cure for it, or rather a
vaccine to prevent it, so our own people and our allies are protected."
"Why include the allies?" I said, merely for the sake of argument.
"Won't that increase the risk of the Reds learning our plans?"
"It will, unless we take a calculated risk. I believe we should
manufacture vaccine and stockpile it, not to be issued until the
disease is actually causing epidemics in Russia. Then we can fly the
vaccine all over the world and let our friends use it. Some people may
catch the disease, but not too many. We might even offer some to the
Russians, to allay their suspicions, making sure it's too late to help
much."
"But don't you think they'll get wise?"
"Of course! But if we do it right I believe they won't dare to use open
aggression any more than we are doing."
"This kind of undeclared war could go on interminably, as the Cold
War seemed to do back in the Fifties," I said gloomily.
"It probably could," Hallam agreed. "Our one hope is to effect a
change in leaders, or at least in policy, in Russia. Maybe, just maybe,
new leaders will arise who will work with the democracies for a world
system of government."
"A faint hope," I said, "but I'll go to bed now before that cheerful
thought yields to glum reality."
I checked Pat before I turned in. She was resting well and I thought
she looked a little less feverish. Her head felt cooler and her pulse
was about normal. Sadly, thinking of her loss and mine, I closed the
door behind me.
Pat's recovery was rapid and uneventful. The following morning she
got up and had coffee with us. In a couple of days she was getting
around well although the Chief wisely insisted she rest for long
periods and absolutely refused to let her work in the Lab. Part of her
restless energy she expended on preparing tasty meals for us until
we both began to grumble about our expanding waistlines. There was
no sign that the new disease had ill effects other than what she had
already suffered. Whether or not she was sterile was a question that
would have to wait. I had no intention of putting it to the test for a
good long time. To work for the cause of science was all very well but
I could see no point in sacrificing my love to it.
The new virus was christened FS for female sterility and we re-
named the old one MS for male sterility. The new one was easy to
grow. It thrived on fertilized eggs, in ferrets, hamsters, mice and
monkeys; in every animal we could find. With passage through
numerous generations it became more virulent until, in its final form, it
caused abortion in all pregnant animals. Invariably, after recovery of
the animals, our pathologists were unable to find any developing
eggs in their ovaries. Because of their short breeding cycle we
worked mainly with hamsters, those fat little relatives of the guinea
pig. Even the amazing fertility of the hamster was stopped by the FS
virus.
"It looks as if we have the answer for the Russians," I said exultantly
after we had tallied our results some weeks later.
"I'm not so sure, John, not so sure at all," Hallam said thoughtfully.
"Why is that, Sir?"
"Have you ever thought of the consequences of sterilizing every
mammal on earth, and perhaps the birds and other animals too?" he
asked. "This FS virus is powerful. If we start another pandemic it
could get away from us. It might increase in power still more, though
God knows it's bad enough. And obviously we can't inoculate every
animal of all the species it may affect even when we find the vaccine
to counteract it. We'd have to build another Noah's Ark and take it out
in the middle of the ocean to be sure we could save them from
extinction."
"We have a Noah's Ark now," I suggested. "We could isolate the
Americans from Asia, Europe and Africa. Australia and New Zealand
could do the same. We are doing it for the measlepox right now until
there is enough vaccine to go around."
"That's true, although it wouldn't be difficult for the Russians to
smuggle the virus ashore. They might do it if they thought they were
licked. The dying soldier often tries to drag his enemy down with him."
"But aside from all that," he continued, "I still don't like it. Men have
wiped out some of the most beautiful and interesting creatures of this
earth. The passenger pigeon is gone. The bison is a curiosity in
National Parks. The trumpeter swan is in danger and the California
condor is on its last lap. I don't believe this world was created just so
man could ruin it, and I don't want to go down in history as the most
ruthless destroyer of all time. Oh, I know I'll be expected to give this
discovery to our politicians. The discoverers of the atomic bomb and
H-bomb did just that and their consciences have bothered them ever
since. There is a greater loyalty in this world than loyalty to one's
country ... it is loyalty to the human race. I believe in the Golden Rule.
Call it Christian logic if you wish. We have already disturbed the
balance of Creation in this world as a cancer disturbs the human
body, and, like a cancer, when we destroy too much of the world we
too may die."
"But the Russians don't live and let live," I objected. "Are you willing to
let them take over the world and perpetuate communist doctrines?"
"It's a thought I do not like," he said very quietly, "but all through
history "isms" have grown and then have died as time passed. This
"ism" too could pass. Perhaps Gandhi was right. Passive resistance
won in India and although the Reds are much more cruel than the
British ever were, even they can't go too far. Remember the East
German revolt and the Georgian riots after the denunciation of Stalin?
Remember the horrors of Hungary? Our agents report increasing
unrest in Russia itself. The people are sick of repression and terror.
Demands for moderation are even printed in their papers. The Far
Left is slowly moving back to the middle of the road. We should go to
meet it instead of edging farther and farther to the Right, into the
nightmare world of Hitler and Mussolini."
CHAPTER 10
Towards the end of April the Canadian research team left for Hong
Kong. Now that intercontinental air traffic had ceased, Sea Island was
quieter than usual, but even so, the roar of engines warming up in the
cold dawn made it difficult to hear. Out on the tarmac the big RCAF
jet transport rolled ponderously behind its tractor, wings drooping like
a great eagle hovering over its nest. It glided silently to the loading
area and we moved, a small knot of people, to where we could watch
and wait for the word to embark.
"I hope Hong Kong will be warmer than this, Harry," I said, shivering
deeper into my trench coat as the cold dawn wind crawled up my
sleeves and down my neck.
"April is usually very pleasant," he said. "It's after the winter and
before the rains."
"I was there a couple of times after the Korean War. I imagine the
Kowloon side is cut off now. Used to be some nice shopping centers
there."
"I don't suppose there'll be much left," he replied. "The area has been
isolated for months. Everybody who could get away has gone. I
expect it will be more like a prison camp than a tourist resort."
"Well, it shouldn't be too bad," I grinned at him. "Some of those
Chinese girls with the high split skirts were mighty nice looking."
"Hush up now, you hear?" Polly said. "Don't you be giving him ideas."
"I don't need to Polly, he's been there before."
"Don't pay any attention to John," Pat said. "His mind's in a rut."
"Can you think of a better one?" Hallam asked.
"Oh, you men!" Polly snorted contemptuously.
"The luggage is all loaded, Doctor," a young RCAF officer had come
up and reported to Cope. "We're ready to go now."
"Thank you," Harry said and turned to the Chief. "I'll let you know
what happens, sir."
"Take care of yourself, boy," Dr. Hallam said as they shook hands.
We turned away, leaving him alone with Polly. In a few minutes she
rejoined us, chattering brightly in her usual animated fashion until the
plane moved out to the runway and Harry could no longer see us.
Then her composure cracked and she cried. Pat and I took her to our
place where the two girls buzzed around making breakfast and