Grade by Grade
D. Structures and Mechanisms · Systems in Action

Automating Systems: Code, Benefits and Costs

D1.1 D1 A2.1 A2.2About 50 minutes
Learning goals
  • I can explain what an automated system is and identify its sensors, controller and actuators.
  • I can write and test code that models an automated system.
  • I can assess the social, economic and environmental impacts of automating a system.
  • I can describe impacts of emerging technologies like artificial intelligence on everyday life and skilled trades.

Words to know

automation
Using machines, sensors and computer code so a system does a task with little or no human control.
sensor
A device that detects something, like light, weight, motion or temperature, and sends a signal.
controller
The "brain" of an automated system: a computer or microcontroller that runs code to decide what to do.
actuator
A part that does the action the controller chooses, like a motor, a pump, a light or a valve.
algorithm
A set of step-by-step instructions to solve a problem or do a task.
artificial intelligence (AI)
Computer systems that can do tasks that normally need human thinking, like recognizing images or speech, often by learning from large amounts of data.

Hook: the recycling plant that sorts itself

When your blue bin is collected, everything arrives mixed together at a recycling facility. In many facilities, much of the sorting is now automated. Conveyor belts carry the items past magnets that lift out steel cans, machines that push aluminum cans off the belt, and optical sorters that recognize types of plastic and blow them into the right bin with puffs of air. People still check and remove items that do not belong.

This is an automated system: sensors, a controller running code, and actuators working together, with people supervising.

Conveyor belts carry mixed plastic bottles, cans and paper under sorting machines in a recycling facility.
Machines above the belts help sort the recycling automatically. Notice the bales of sorted material stacked in the background. AI-generated image

Parts of an automated system

  1. Sensors collect information (Is the item metal? What kind of plastic? Is a car waiting at the light?).
  2. A controller runs code (an algorithm) that decides what to do.
  3. Actuators do the action (a motor moves a belt, an air jet fires, a light turns green).
  4. Feedback checks the result and adjusts.

Examples of automated systems: traffic lights with sensors, automatic doors, smart thermostats, robotic vacuums, self-checkouts, automated warehouse robots, robotic milking systems and automated car washes.

SENSORSmetal sensor,optical sensorCONTROLLERruns the codeand decidesACTUATORSmagnet, pusher,air jet, belt motordataordersFEEDBACK: counts and checks of what actually happened
The three main parts of an automated system, using the recycling sorter as the example. Sensors gather information, the controller decides, and actuators act. Feedback lets the system check its own results.
# Recycling sorter model
repeat for each item on the conveyor belt:
read metal_sensor
read optical_sensor
if metal_sensor says "magnetic":
magnet lifts item into STEEL bin
else if metal_sensor says "metal, not magnetic":
pusher moves item into ALUMINUM bin
else if optical_sensor says "plastic":
air jet blows item into PLASTIC bin
else if optical_sensor says "paper":
item continues to PAPER bin
else:
stop belt and call a worker to check the item
add 1 to count for that bin

A plan (algorithm) for an automated recycling sorter (A2.1). Sensors give information, the code decides, and the actuators (magnet, pusher, air jet, belt motor) act. Notice the last choice: when the system is unsure, it asks a person.

items movesensorsSTEELmagnetALUMINUMpusherPLASTICair jetPAPERend of belt
A side view of the recycling sorter that the code describes (simplified, not to scale). Each actuator sends one kind of material into its own bin, and paper rides on to the end of the belt. An item the sensors cannot identify makes the belt stop so a worker can check it.

Assessing the impacts of automation (D1.1)

Automation can change a system in many ways. When you assess an automated system, look at three kinds of impact:

Kind of impactPossible benefitsPossible costs
Socialsafer work (machines do dangerous, heavy or repetitive jobs); convenience; services 24 hours a day; accessibility (automatic doors help people who use wheelchairs or walkers)some jobs disappear or change; less human contact; people need new skills; privacy concerns when systems collect data; problems when systems fail or make mistakes
Economichigher productivity; lower costs per product; new jobs designing, programming and repairing machinesmachines are expensive to buy and maintain; workers may need retraining; small businesses may not afford it
Environmentalprecise use of resources (for example smart irrigation waters only when soil is dry; better sorting means more recycling)machines and data centres use energy; electronic waste; mining materials for electronics
Social, economic and environmental impacts of automating systems.
Worked example

Let's assess automating a school library checkout

A school wants to replace its library desk with self-checkout stations that scan book barcodes. Assess the social, economic and environmental impacts and make a recommendation.

  1. Social: students check out books faster with no line; the librarian has more time to help students find books and teach research skills. But younger students may need help, and some students enjoy talking with the librarian at the desk.
  2. Economic: the stations cost money to buy and maintain; the school saves staff time at the desk.
  3. Environmental: the stations use a small amount of electricity; receipts could be emailed instead of printed to save paper.
  4. Recommendation: install one self-checkout station and keep the librarian available. Collect feedback after a term.

A balanced assessment names benefits and costs in all three areas, then recommends a solution that keeps the benefits and reduces the costs.

Emerging technologies and AI (A2.2)

Artificial intelligence is being added to many automated systems. AI can recognize objects in camera images, understand speech, predict when a machine will break down, and help vehicles assist drivers. Some vehicles that drive themselves are being tested.

In skilled trades, AI and automation are changing the work: technicians use diagnostic computers to find faults in vehicles and furnaces, and industrial electricians and industrial mechanics install and maintain robots and automated lines. These jobs need both hands-on skills and an understanding of code and sensors.

AI systems can make mistakes and can be unfair if they learned from biased data, so people need to check their decisions, especially when safety is involved.

Just for fun

A coder is asked: "Please go to the store and buy a carton of milk, and if they have eggs, get six." The coder comes home with six cartons of milk. Moral: computers do exactly what the code says, not what you meant.

Hands-on activity

Code an automated system

You need: a computer or tablet with a free block-based coding tool such as Scratch (scratch.mit.edu), or paper and pencil.

Choose one system to automate: a crosswalk signal, a porch light, a greenhouse watering system or the recycling sorter.

  1. List the sensors (inputs), the actuators (outputs) and the rules (if... then...).
  2. Write the algorithm in plain steps first.
  3. Code it. In Scratch you can simulate a sensor with a variable. For example, for the sorter, set a variable item to a random number from 1 to 4 (1 = steel, 2 = aluminum, 3 = plastic, 4 = paper), then use if... then... else blocks to make a sprite say which bin it goes to and add 1 to a counter for that bin. Repeat 20 times.
  4. Run your code and test it. Does every possible input go somewhere sensible? Add a rule for an unknown item.
  5. Write two sentences assessing one social, economic or environmental impact of automating this system in real life.

What to look for: code that runs, uses a loop and if/else decisions, and handles an unexpected input. Example for a porch light: forever: if light sensor says dark and motion sensor detects motion, turn light on, wait 60 seconds, turn light off.

Your turn

1

What is automation?

2

Name the three main parts of an automated system.

3

In an automatic door, what is the sensor and what is the actuator?

4

Give one social benefit and one social cost of self-checkouts in grocery stores.

5

Give one environmental benefit of an automated greenhouse watering system.

6

Why did the recycling sorter code stop the belt for unknown items?

7

Name one way AI is changing a skilled trade.

More practice: warm-up

1

What is an algorithm?

2

What is an actuator?

3

Name two automated systems in a home.

4

What does AI stand for?

5

Which kind of sensor could tell a traffic light that a car is waiting?

More practice: on your own

1

Write an algorithm for an automated crosswalk signal that has a push button and gives people 20 seconds to cross.

2

Assess the economic impacts of a dairy farm installing robotic milking systems.

3

A city automates its snowplow routes with GPS tracking and an online map showing where plows have been. Name one social, one economic and one environmental impact.

4

Why is it important for people to check decisions made by AI systems?

5

Find the bug: if temperature > 30, turn fan on. The fan never turns off. Fix the code.

Challenge

1

A company wants to replace all of its warehouse workers with robots. Write a balanced assessment covering social, economic and environmental impacts, and suggest a better plan.

2

Explain how feedback makes the greenhouse watering system more efficient than a simple timer.

3

Automatic doors are often described as an accessibility feature. Explain, and describe one way the system must be designed to be safe.

Check your understanding

Quiz

1.

In an automated system, which part decides what to do?

2.

Which is an actuator?

3.

Which is an environmental benefit of automation?

4.

Which is a social cost of automation?

5.

Why should automated systems include a rule for unexpected inputs?

6.

Why must people check decisions made by AI systems?

For parents and teachers

Big idea (D1.1, A2.1, A2.2): Students assess the social, economic and environmental impacts of automating systems, write and execute code ... with a focus on automating large systems, and describe impacts of coding and emerging technologies, such as AI, on everyday life, including skilled trades.

How to help: Scratch is free and runs in a web browser; your child can model a sensor with a variable. If you do not have a device, writing the algorithm on paper and "running" it by hand with test inputs is fine. Talk about automation you see: self-checkouts, automatic doors, smart thermostats. Ask, "Who benefits? Who might lose out? What about the environment?"

Common difficulties:

  • Only listing benefits. Use the three-column table (social, economic, environmental) and require a cost in each.
  • Code without an else or an unknown-input rule. Test every possible input.
  • Thinking AI is always right. Discuss bias and the need for human checks.