If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## AP®︎/College Computer Science Principles

### Course: AP®︎/College Computer Science Principles>Unit 8

Lesson 4: Monitoring innovations

# Smart buildings, transport, and grids

AP.CSP:
IOC‑1 (EU)
,
IOC‑1.A (LO)
,
IOC‑1.A.5 (EK)
,
IOC‑1.B (LO)
,
IOC‑1.B.2 (EK)
,
IOC‑1.B.5 (EK)
What does it mean for a piece of infrastructure to be "smart"?
Consider a simple appliance, the humble vacuum cleaner. When we use a traditional vacuum cleaner, it's up to us to guide the vacuum cleaner around corners and make sure we haven't missed a spot. A smart vacuum cleaner is equipped with sensors, storage, and algorithms, which means it can guide itself around corners and remember where it's already vacuumed.
Something is smart once it both collects data about its environment and uses that data to make intelligent decisions about what steps to take next. That's now happening at every level of infrastructure, from buildings to regional transportation systems to multi-country electric grids.

### Smart buildings

A modern building is more than just walls and windows. Indoor lighting compensates for cloudy skies and windowless rooms. Air conditioning keeps us cool during the warm months and heating keeps us warm during the cool months. Locks restrict who can enter, and when.
A smart building uses technology to optimize the comfort and security of the building, while minimizing cost and environmental impact.
Consider just the aspect of lighting a building. According to the US Department of Energy, lighting accounted for about 20% of the total energy consumption of commercial buildings in 2011start superscript, 1, end superscript. Ideally, building lights would only be on when absolutely necessary: when there isn't enough ambient light from the sun and when there are occupants inside a room with lights.
Sensors to the rescue! Occupancy sensors use infrared radiation or ultrasonic waves to detect the movement of humans in a room. Light level sensors measure photons to detect ambient light. A network of occupancy and light level sensors can decide when to dim lights or turn them on or off entirely.
Diagram of an office room with a light level sensor on the window, an occupancy sensor on the ceiling, and lights on the ceiling. A cloudy sky is outside the office, so the lights are on inside.
The lights are on in this office, thanks to the combined data from an infrared-based occupancy sensor and a light level sensor.
Occupancy sensors alone can reduce a building's energy usage for lighting by 50%, especially when used in rooms with intermittent use, such as classrooms, conference rooms, and bathrooms.squared
Smart buildings can use similar sensor-based technologies for new approaches to security, making it easier for occupants to enter the building while harder for intruders to sneak in. A parking lot can sense when a car is approaching, snap a photo, identify the license plate number with recognition algorithms, and lift the gate only if the plate belongs to an employee. Inside the building, a robot with infrared vision can wander around and record any suspicious activity.
A photo of a security robot with a little girl looking at it.
ALSOK security robot. Image source: Fumiaki Yoshimatsu
All of this smart technology—and more—is deployed in The Edge, a 15-story office building in Amsterdam that's covered in 28,000 sensors. That sounds like a lot of technology to keep powered, but The Edge actually produces more power than it consumes thanks to its data-driven energy efficiency and a roof covered in solar panels.cubed
Smart buildings generate a huge amount of data. The immediate use of that data is to automate the building's functionality, but the data is also useful for building administrators. Data dashboards show statistics such as energy usage per room, temperature hot spots, and daily occupancy.
A montage of screenshots of data dashboards, showing metrics like average energy use, building visitors over time, type of coffee used, etc.
Data dashboards for smart buildings. Image source: Bloomberg/Deloitte
🤔 Consider the buildings you spend time in. How could those buildings become more intelligent with sensor networks and algorithms? What privacy and security risks do you foresee?

### Smart transportation

As of 2014, there were more than 250 million vehicles on US roadways, including cars, buses, and trucks.start superscript, 4, end superscript Many of the cars and buses are transporting people commuting to their work during rush hour. In an ideal world, everyone could get to their destinations safely and spend as little time as possible in traffic jams.
Smart transportation uses data from sensors to bring both private and public transportation closer to the goals of more safety and less congestion.
Traffic patterns are complex. Since most vehicles are driven by humans with individual reactions, they don't follow simple rules of particles in a system, and therefore tend to jam more often than necessary.
This traffic simulation shows how quickly jams can happen (and you can play with it yourself):
AP CSP example: Traffic simulationSee video transcript
Sensor-based technologies can help by adjusting road signaling dynamically: changing the red and green times for traffic lights, adjusting speed limits based on weather and traffic conditions, and warning vehicles when there's a stopped car ahead of them. Crime enforcement agencies can also use sensor-based technologies to enforce the speed limits and other rules of the road.
Photo of a highway with an LED sign above it that says "Speed limit 45, low visibility"
A reduced speed limit sign due to low visibility conditions on the road. Image source: Oregon DOT
One way to reduce congestion is to encourage people to use public transportation like buses and trains instead of driving cars. But the lack of reliability of public transportation often keeps drivers from becoming riders. People want transportation that's reliable, and that's where technology comes in.
Smart buses can use on-board GPS receivers to determine their current position and wireless networking to broadcast their position. The passengers on board benefit from audio and visual announcements of upcoming stops, and waiting passengers benefit from mobile tracking applications that let them know when the bus is coming to their stop.
A map of Chicago, with three bus lines overlaid on top. Each bus line has many dots representing the spots on the line and bus icons representing the current buses. An animation shows the buses moving from one stop to the next.
A two-minute period from a Chicago bus tracking application, sped up.
In a well coordinated city, traffic lights can even adjust their timing to better accommodate the schedule of a bus, extending a green or shortening a red to help a bus stay on schedule.start superscript, 5, end superscript
Diagram of a bus at a traffic light. Both the bus and traffic light have wireless sensors, and the traffic light is green.
The traffic light stays green to let the bus through.
What about trains? They can be the fastest way to travel over land, but also the most complicated, since multiple trains share the same railways. Dispatchers are in charge of making routing decisions, and need to consider factors like the train's schedule, how long the crew's been working, and the priority of the train's cargo.
Diagram of two trains approaching a junction between their tracks. A question mark is shown over the junction.
Which train should go first? Dispatchers must decide.
Human dispatchers can make great decisions for a single railways junction, but it's hard for them foresee the domino effects of their decision on the whole network.
Smart railways can instead use computers and GPS data to make automated dispatching decisions. A computer making a dispatch decision uses similar algorithms to a computer picking a chess move, since both situations require an understanding of the immediate effects of a decision as well as the effects that decision has on future decisions.start superscript, 6, end superscript
A diagram of a decision tree, with one node at the top branching into two nodes, and each of those two nodes branching into two nodes.
An automated dispatching algorithm considering all possible results.
Once the dispatch decision is made, the trains follow their new routing instructions. No human intervention is required, but human dispatchers can still override routing orders when needed.
Diagram of 4 trains on tracks, with three junctions.
Trains follow the routing orders from the automated dispatch algorithm.
🤔 Self-driving cars are another form of smart transportation that are becoming more possible every day. How might self-driving cars affect the safety and congestion of our roadways?

### Smart grids

All of this smart technology is made possible thanks to electric power. When electricity generators were first invented, each factory would generate its own power. Nowadays, most homes, businesses, and infrastructure gets electricity delivered from a regional power grid.
North America and Europe started building power grids a century ago and now have interconnected power grids covering huge regions:
Maps of North America and Europe with colored states and regions, each color corresponding to a different synchronous grid. There are 9 colors corresponding to 9 grids in the North America map, and 5 colors corresponding to 5 grids in the Europe map.
Wide-area synchronous power grids in North America and Europe. Image sources: Bouchel, Kimdime
But those wide-area power grids were built for a much smaller population with simpler energy needs. As a result, they don't distribute power as efficiently as possible, and worse, they can fail entirely! During the Northeast blackout of 2003, a software bug in a single power plant led to a massive outage affecting 55 million people in the US and Canada. Traffic lights stopped working, water supplies became contaminated, electric trains stopped runnings, and cellular networks shut down.start superscript, 7, end superscript
A map of the United States and Canada, with the following regions highlighted in red: Michigan, Ohio, Pennsylvania, New York, New Jersey, Connecticut, Boston, Ontario.
Regions with energy systems affected by the Northeast blackout of 2003. Image source: Lokal_Profil
A smart grid uses technology to improve how electricity travels from power plants to consumers and to prevent local failures from becoming widespread outages. First, everything that transports the energy is monitored with networked sensors, including the transformers, transmission lines, and power meters.
Diagram of electric grid. The energy travels from power plant to transformer to high-voltage transmission lines to transformer to medium-voltage transmission lines to transformer to low-voltage distribution lines to a house. Wireless sensors are shown above each part of the flow.
A power grid equipped with wireless sensors.
Computers analyze that data to identify possible problems, automatically shut down the smallest part of the grid possible, and notify the power company. Computers can also choose the best day for proactive maintenance shut-offs based on daily usage patterns.
Two diagrams of a power grid, showing before and after an outage. The left shows 8 low-transmission power lines next to 7 houses, all deriving power from a medium-transmission power line. The right shows a fire between two low-transmission power lines, and a power outage for the closest house. The three houses on the right are powered from the original medium-transmission power line, and the three houses on the left are powered from a different medium-transmission power-line.
A grid in normal operations on the left compared to that same grid with a local outage on the right. The outage cut power from the center house, but smart switches re-routed power to keep it flowing to other houses.
Smart grids are also better poised to take advantage of new sources of renewable energy, such as solar and wind energy. Both of those energy sources are weather dependent—but a smart grid knows all about the weather, so it can choose renewable energy sources when possible and fallback to traditional energy sources at other times.
Diagram of a smart grid choosing an energy source. Three energy generators are shown - a factory blowing smoke, a wind farm, and solar panels. Each of those is connected to a high-voltage transmission line which connects to a control center which connects to medium-voltage transmission lines. A sun is shining, and the connection lines from the solar panels is highlighted.
On a sunny day, a smart grid can use more solar energy.

### Security risks in smart systems

A big part of what makes these systems so smart is their interconnectedness. Instead of a single device making decisions based on only its own sensor data, a vast network of interconnected devices can make much better decisions based on aggregated sensor data.
That same interconnectedness is also the biggest weakness of a smart system, since it means that many of the devices are connected to the publicly accessible Internet, either directly or indirectly. Hopefully, those connections are secured with encryption and protected with firewalls—but even so, if a target is tempting enough, cyber criminals can look for ways to attack it.
The biggest target are smart grids, since they're the source of the electricity that powers everything else and they often cover such a large geographic area.
In December of 2015, hackers successfully attacked the Ukrainian power grid, disrupting the operations of 3 energy distribution companies and turning off power for 225,000 customers. The hackers used a combination of techniques: spear phishing, multiple kinds of malware, and a DOS attack on the telephone lines.start superscript, 8, end superscript Ultimately, humans were the weakest link in the system, as their use of insecure passwords and opening of suspicious emails is what started the chain of attack.
🤔 What strategies could energy companies use to prevent attackers from gaining access to their internal systems?