Cover: A Geek Girl's Guide to Electronics and the Internet of Things by Audrey O'Shea
Logo

A Geek Girl’s Guide to Electronics and the Internet of Things

 

Audrey O’Shea

 

 

 

 

Logo

To Jean White, my mom.

About the Author

Audrey O'Shea is a New York State licensed technical instructor teaching electronics and CompTIA certification courses at a technical high school. She also has taught college-level IT courses, holds numerous industry certifications, and has been a mentor to teachers who are new to the profession. Prior to beginning her teaching career, she served as CEO of a consulting company that provided computer training, along with custom software and network installation and support.

O'Shea has degrees in accounting and information technology as well as her teaching license, and she is a member of the Phi Kappa Phi honor society, a public speaker, and a proponent of encouraging women to set their sights on STEAM careers. She has written two books in the self-help genre and served as technical editor on another technology book. In her spare time she enjoys hiking and kayaking in the Adirondack Mountains of New York State, gaming, building and fixing things, and automating her home.

About the Technical Editor

Mike Hitsman is a mechanical engineer working for a small construction company in Central New York. It affords him the luxury to pursue machining, welding, electrical diagnostics, and programming as needed day to day. He attributes his technical breadth to FIRST Robotics, where he started as a student and now mentors the local team. His knowledge of electronics is entirely self-taught, through lots of reading, lots of trial, and lots of errors.

Hitsman lives with Audrey O'Shea's daughter at their country homestead, where he is slowly adding more and more automation to the old farmhouse. He's as likely to be tweaking an IoT device as he is repairing something from 100 years ago.

Acknowledgments

I would like to shower praise on the people who have helped me provide this book for your amusement and education. First, Kenyon Brown for giving me the opportunity. Next, Jan Lynn, my project editor, for pushing me to get it done. Also, a big thank-you to Michael Hitsman, my technical editor, for his polite and concise suggestions on how to make it better. I would be remiss if I failed to mention my friend and fellow author, Mike Meyers, who encouraged me to start writing in the first place, and I would not have made it this far without my mom, who always had my back when the world said, “You can't,” and I said, “Yes, I can.” Finally, to my family and friends, thank you so much for understanding all the times I said, “I'm sorry, I can't. I have a chapter due.” Thank you all.

Introduction

Welcome to the world of electronics! This is an exciting place to be, and I'm so glad that you've decided to join me in this journey. IoT and electronics are inseparable, as you'll soon see. We'll start with learning about electronic components and creating some useful circuits. In addition to traditional electronic circuits on breadboards, many chapters have circuits that use the programming power of an Arduino board. Finally we'll be connecting your circuits to the Internet so you can control them from anywhere. This book starts small and helps you grow in knowledge as it progresses and encourages you to reach even further. My true hope is that it will get you excited about working with electronics, regardless of whether it's a hobby or a new career, and that it will give you confidence to do whatever it is that makes your heart sing, no matter who or where you are in life.

I'm here to tell you that virtually everyone can do electronics, you included. Although this is a male-dominated field, I encourage you not to let that deter you from getting into the game. If you're female or any other non-traditional geek, follow your passion like I did. Like me, you may be the only woman in the room, but that's perfectly fine. It's an exciting and dynamic career field, and if you're different from the stereotypical electronics geek in some way, that's great! You bring a different perspective, which makes you that much more valuable.

Who Will Benefit Most from This Book

This book is intended for beginners, or those with some basic electronics knowledge who want to fill in those knowledge gaps with tidbits of information that can make all the difference. You'll start with the basics and progress to more interesting (difficult) projects as you go along. This book contains more than 35 “Try This” projects where you can see how things work and solidify what you're learning. Some of the projects include the following:

  • Creating a super-bright camping light using LEDs
  • Building a laser trip alarm
  • Making paper and clay electronics for kids
  • Creating light-activated circuits
  • Constructing an Arduino wattmeter
  • Connecting your projects to the Internet

You'll learn some science behind how things work so the components and connections will make sense, and you'll learn how to avoid some of the pitfalls of circuit building. For example, after studying the material in this book, you'll know why you need a flyback diode for a motor (and understand what one is), instead of having to figure it out when the circuit fails and you're on your third set of components. However, I expect there may be some of that in your future, too, as you take your own ideas and build them into new and interesting circuits. Mistakes are part of the learning process. That's the fun of experimenting! You will create prototype circuits on breadboards, and if you're happy with the result, you can solder them onto something more permanent because you'll know how to do that, too.

Sourcing Parts and Supplemental Materials

I wouldn't want to teach you to fly and then leave you on your own, so throughout the book I've included some of my favorite places to find information and components.

My website, cliffjumpertek.com, also has additional reference materials, tutorials, and videos of the book's projects to help with your journey, should you need it.

Special Features

Time to turn the page and get started on your future in electronics! I'll see you there.

What Does This Book Cover?

This book is designed to provide you with a foundation of knowledge in electronics, IoT, and the Arduino environment. Its multitude of projects are the springboard to a deeper understanding and ever more challenging projects.

Part I
IoT and Electricity Basics

In This Part

  • Chapter 1: IoT and Electronics
  • Chapter 2: Electricity: Its Good and Bad Behavior
  • Chapter 3: Symbols and Diagrams
  • Chapter 4: Introduction to the Arduino Uno
  • Chapter 5: Dim the Lights
  • Chapter 6: Feel the Power
  • Chapter 7: Series and Parallel Circuits

CHAPTER 1
IoT and Electronics

“Toto, I have a feeling we're not in Kansas anymore.”

—Dorothy, The Wizard of Oz

Sci-fi movies and shows have always been my obsession. As a child, I would watch in awe when reruns of The Jetsons showed people talking on video phones, the almost-human robot maid, and sidewalks that moved. Then there were the Star Trek reruns where characters walked around with communicators that allowed them to talk to anyone just by tapping them. Later, Star Wars had language translators that would automatically translate into any other language … rather like what Google Translator does now.

Forty or fifty years ago, many devices and capabilities that are commonplace now were considered ridiculous, impossible, or mere fantasy. Were these movies and TV shows predictions of the future, or did they help to shape the future by putting these notions of “impossible” devices into someone's mind to start working on? Either way, many of those devices exist now for us in some form or another. Even 20 years ago, most people still depended on their home phones for communication. Do you know anyone who still has a landline at home? They are few and far between.

The Electronics Technicians Association was founded in 1978 as the electronics industry was beginning to grow slowly. Now, it's growing by leaps and bounds on a daily basis. It's astonishing how far electronics have come in such a relatively short time when compared to human existence, and it's even more incredible when we ponder how far we will be 50 years from now. Many of the technological advances of the future will be here due to artificial intelligence, machine learning, and the myriad of sensors starting to cover our world. The world is about to take another leap forward, and if you want to be part of that journey, learning electronics is the place to start. As so many maps show us … “You Are Here.”

IoT in a Nutshell

What is IoT? As you may know, IoT stands for “Internet of Things.” IoT refers to a vast array of connected devices that gather and transmit data over interconnected networks with or without human intervention, sometimes even responding to the captured data automatically as machines talk to machines and learn from each other. (When IoT involves manufacturing processes, it is often called industrial IoT [IIoT].) IoT can include data gathered by proximity sensors on your car's front that detect deer in the roadway and signal your brakes to immediately slow down the car without you doing anything. It also includes when moisture levels (or lack thereof) are transmitted from a field to that field's watering system, signaling to turn on the irrigation system without a human lifting a finger. Even a dog's GPS-enabled location device is part of an IoT system, as is the Tile that I press to locate my often-misplaced car keys.

Other systems considered part of IoT are smart cities, smart grids, smart homes, smart watches, and manufacturing machines talking to and learning from each other. Smart devices are used in hospitals, schools, retail, and nearly any other service or business you can think of. Last year, I attended a virtual meeting with someone from a major networking device company. He was speaking from his office about power over Ethernet and how the interconnected devices controlling heat, lighting, air quality, etc., all ran automatically in the high-rise office building he was in. I noticed a model of a pig on the credenza behind him and asked about it. Yes, it was a pig wearing an IoT collar.

What does this have to do with learning electronics? Everything! Electronic sensors and circuits are the beating heart of an IoT system.

Parts of an IoT System

What comprises an IoT system changes depending on who you ask, but regardless of what particular twist an industry or company may put on it, certain things must be there. For an overview of an IoT system, see Figure 1.1.

Devices

What is an IoT device? IoT devices include sensors, circuits, software, actuators (things that do something, such as switch from one state to another), and microprocessors, all rolled into a neat little package. These devices also need a way to communicate and send data to a place where it will be processed, manipulated, and action taken based on the data, or they need to be able to communicate to receive instructions based on the data that was gathered by some other device. Therefore, an IoT device can be on either the sending end or the receiving end, or possibly both.

Schematic illustration of an IoT system.

Figure 1.1: An IoT system

Take, for example, a smart home with a remote-controlled thermostat, which has a few layers of things going on. First, the thermostat is a device. It has a sensor that measures the temperature and sends that information to a circuit board with a microprocessor where the reading is converted into data, which is manipulated. If certain conditions within the software program are met, the microprocessor sends a command to another component, telling it to turn the furnace either off or on. This example is machine to machine but involves sensors, circuits, software, microprocessors, communication, and actuators.

Another function of this device would be the ability to access the device from a cell phone via the Internet and Wi-Fi to tell the device to turn up the heat before the user gets home. This example involves a user interface, which is part of the entire user experience, but here we have the cell phone acting as a device and the thermostat acting as another device, communicating via the Internet.

Sensors

The first part of any IoT system is a device that senses something physical, whether a particular condition or event. It could be a fiber optic cable in a building's concrete that picks up a pressure change, or it could be a proximity sensor, heat sensor, humidity sensor, optical sensor (ambient light, IR, UV), gas sensor, position sensor, magnetic sensor, motion sensor (accelerometer, gyroscope), color sensor (light again), or touch sensor (pressure). A search for sensors on an electronics components site at the time of this writing yielded tens of thousands of results.

As mentioned in the preceding section, a sensor receives some form of raw data and passes it on to a circuit and most likely a microprocessor, where the data received is interpreted. Take, for example, a temperature. The sensor doesn't send “temperature” to the circuit. Instead, a change in the temperature causes a rise or fall in either current or voltage through the device, which is passed to a circuit where it is read and interpreted according to instructions, known as software, controlling what the microprocessor tells the circuit to do. In future chapters, you'll learn how to work with some of these sensors and what the technology is that drives them.

Choosing the right sensor is an important first step, and several characteristics need to be considered.

  • What's being measured: Temperature, light, pressure, etc.
  • Electrical: Current, voltage, and power limitations.
  • Physical: How much pressure, heat, light, etc., can it endure and remain viable?
  • Accuracy: How far might it vary from the actual measurement?
  • Sensitivity: How much does the input need to change before the output changes?
  • Reliability: What is the track record of this sensor? When does it stop being accurate? How often does it break down?
  • Range: What are the minimum and maximum values that can be measured?

Circuits, Software, and Microprocessors

Once the right sensor is found, the circuitry and software can be designed to interpret the information that is provided by the sensor. A myriad of choices exists for all of these. A microprocessor can be a single chip designed to perform logic or a microprocessor platform, such as an Arduino device. The choice of processor may determine the choice of software that is used.

Communication

Because the “I” in IoT stands for Internet, the assumption can be made that the device is expected to be interconnected in some way either through a local area network (LAN) or through the Internet. However, different levels and aspects of communication may be used by IoT devices.

Levels

A device may communicate with other devices, such as a moisture sensor in a field that triggers a watering system to work, or devices in a factory assembly line that communicate with other devices to either slow down or speed up the processes based on conditions. This is machine-to-machine communication. Systems like these may even use machine learning, which is a process where computers use algorithms to look for related data and learn, changing their programming based on data without human intervention. Machine learning is far too complicated to explain here but definitely an emerging technology worth paying attention to.

In the automatic watering system example, the devices may be connected only to a LAN, but most likely they will be gathering data and sending it, via one or more protocols and networks, to a place where it is processed.

Protocols and Standards

Protocols are essentially rules for communication, and they are the topic of much learning and discussion in the computer world. Standards typically define how a network is built and what protocols are used on it. Networking standards are needed to ensure that different devices, possibly from different vendors or manufacturers, are all able to communicate effectively. Knowing what type of communication is needed and used by each part of an IoT system is an important consideration. Any of the following standards might be part of an IoT system:

  • Ethernet: Wired LAN networking standard
  • Bluetooth: Short-range wireless, usually connecting mobile devices
  • Wi-Fi: Wireless networking standard allowing wireless networks to connect to a wired system or each other
  • Cellular: For longer-range wireless connectivity via the cellular system

Each of these standards may have multiple protocols that are used with that particular standard, and any of them may allow a device to connect to the Internet. Often more than one will be used. In the case of the smart thermostat, it may use Wi-Fi to connect to a local LAN using Ethernet, which is connected to the Internet via some other method, such as a cable modem, fiber optics, or satellite. The remote user may be connecting their cell phone to the thermostat via Wi-Fi or the cellular network. All of these standards need to work in harmony for successful communications across an IoT system.

Data Analytics and Management

Data analytics is the growing field of sorting and analyzing raw data to derive meaningful and actionable information from it. It is the stuff of algorithms and perhaps insight gained from the experience of working with data. Four basic types of data analysis exist.

  • Descriptive
  • Diagnostic
  • Predictive
  • Prescriptive

Descriptive analytics identifies what has happened based on data. It is often based on key performance indicators (KPIs). For example, did sales go up or down and by how much or what percentage? Did the field have to be watered more often or less often?

Diagnostic analytics attempts to explain why the changes occurred. It can look at data outliers and what was occurring when the change in data occurred.

Once the what and why are known, predictive data analysis models can be built to anticipate problems before they happen or identify future trends.

Finally, prescriptive data analysis gives the user a course of action to take to avoid the problems identified in predictive models or to take full advantage of what's around the corner.

Data is more valuable than the hardware and software used to mine it from various sources, so managing that data is a primary concern for any business. The field of data management is concerned with collecting data, maintaining its physical security, securing the privacy of any personally identifiable information (PII), and preserving that data in a cost-effective and efficient manner. Data analytics is part of data management, and the way this data is used can cause a business to flourish or fail.

The User Experience

The user experience refers to every place that the user and the IoT system come into contact with each other. If, for example, an employee is tasked with identifying a problem quickly and accurately, then the interface that the employee uses needs to have the right information in an application that is easy to use, and it needs to be updated in a timely manner.

Depending on the situation or business, the user experience can also include interacting with customer service or other personnel, how easy the phone system is to use, etc.

Challenges in Implementing IoT

Implementing technology is not without challenges, particularly in an IoT system. One of the biggest challenges for remote IoT devices is power. Running electrical wires is not always practical, and batteries have a limit to their capacity, so creating a system that runs on as little power as possible, or perhaps renewables like solar power, is a significant hurdle to overcome in developing an IoT solution.

Another major concern is the security and ownership of data. If data is stored by a provider, who owns and has access to the data? What encryption will be used to transmit the data from where it's gathered to where it's used? These are questions that any businessperson would want to know before implementing a system. Determining the right data to gather is probably the first question to answer, because measuring the wrong facts won't help a business make the right decisions.

Perhaps the biggest challenge of all is cohesiveness. If a system is cohesive, then it works together smoothly, which can be a problem when so many different systems are involved. Beginning with the sensors that detect data, through the circuitry and networks that transfer and store the data, then send the data to a user's interface on a device such as a phone or computer, and back again as the user responds through a local network to the web and then to the actuator; during this process, there needs to be a seamless way to transmit and manipulate the data. With so many protocols and systems involved, that can be difficult indeed. Developing a system needs to start with a bird's-eye view of the major parts, working down to the component level to ensure that all of the system's parts work together to move data around smoothly.

IoT into the Future

IoT and IIoT will not be going away in the foreseeable future. In fact, they will continue to grow as processes and machines get smarter and people find more uses for IoT. What may have started as a curiosity, with devices that were more fun than function in the hands of a few hackers, is now a major industry and will be causing paradigm shifts in virtually all industries and businesses.

Devices and sensors will continue to get smaller, get less expensive, and work better. We will learn how to better harvest the data from IoT devices and put them to more and more uses. Already billions of IoT devices are being used, and the number increases exponentially as every day forward-thinking inventors and electronics enthusiasts devise more uses for the technology. Where will you fit into this growing industry? Perhaps the best place to start is with a basic understanding of electronics, and to that end, read on.