# Automated Systems & Feedback Control Loops

- **Track:** Cambridge IGCSE™ Computer Science (0478 / 0984) (CAMBRIDGE IGCSE 0478)
- **Module:** Section 6: Automated Systems & AI
- **Estimated Duration:** 15 minutes
- **Access:** Open Theory (All-Access for Interactive IDE &amp; Autotests)

---

## Theory & Conceptual Background

An **automated system** is a combination of hardware and software components designed to monitor and control processes automatically without human intervention. From smart thermostats in modern homes to fully automated chemical refineries, automated systems deliver precision, safety, and efficiency.

---

## Learning Objectives

- Define an **automated system** and describe its core components.
- Explain the role of **sensors**, **ADCs**, **microprocessors**, and **actuators**.
- Trace the operation of a **closed-loop feedback control system**.
- Evaluate the advantages and disadvantages of automated control systems in real-world scenarios.

---

## The Anatomy of an Automated Control System

Every automated closed-loop system operates using a continuous cycle of sensing, processing, actuating, and feeding back results:

```text
+-------------------------------------------------------------------------+
|                         PHYSICAL ENVIRONMENT                            |
|                 (Temperature, Moisture, Light, Pressure)                |
+-------------------------------------------------------------------------+
       |                                                    ^
       v (Physical parameter)                               | (Physical action alters
+--------------+                                            |  the environment)
|    SENSOR    |                                            |
+--------------+                                            |
       |                                                    |
       v (Continuous Analogue Voltage)                      |
+--------------+                                            |
|     ADC      |                                            |
+--------------+                                            |
       |                                                    |
       v (Discrete Digital Binary)                          |
+----------------------+      Control Signals        +--------------+
|    MICROPROCESSOR    | --------------------------> |   ACTUATOR   |
| (Compares Setpoints) |                             | (Motor/Pump) |
+----------------------+                             +--------------+
```

### 1. Sensors (Input)

- Measure physical analogue properties of the environment (e.g. thermistors measuring temperature, photodiodes measuring light intensity, moisture probes measuring soil dampness).
- Output a continuous electrical analogue signal (voltage or current).

### 2. Analogue-to-Digital Converter (ADC)

- Because microprocessors understand only discrete binary digits ($0$s and $1$s), the ADC samples the continuous analogue signal at fixed time intervals and converts each measurement into a digital binary value.

### 3. Microprocessor (Controller)

- The "brain" of the automated system running pre-programmed control software.
- Compares the digitized sensor values against predefined stored target values (**setpoints** or **thresholds**).
- Decides what corrective action is necessary based on programmed logic rules (e.g. `IF Temperature > 25°C THEN open window`).

### 4. Actuators (Output)

- Electromechanical devices that convert digital control signals from the microprocessor into physical mechanical action (e.g. spinning an electric motor, opening a water valve, activating a heating element).

### 5. The Feedback Loop

- The mechanical actions performed by the actuators physically alter the environment (e.g. opening roof vents lowers the greenhouse temperature).
- The sensors immediately detect these altered conditions and feed the updated readings back into the microprocessor.
- Once the environment returns to within acceptable threshold parameters, the microprocessor commands the actuators to stop.

---

## Open-Loop vs Closed-Loop Systems

  
| System Type | Description | Example |
| --- | --- | --- |
| **Open-Loop System** | Operates purely on a fixed timer or predefined sequence without checking the output results or environment. | A simple toaster that heats bread for 2 minutes regardless of whether the bread is pale or burnt. |
| **Closed-Loop System** | Continuously measures the output environment using sensors and feeds data back to adjust the input accordingly. | An automated central heating thermostat that cycles heaters on and off to maintain exactly $21^\circ\text{C}$. |

---

## Advantages & Disadvantages of Automated Systems

  
| Advantages | Disadvantages |
| --- | --- |
| **24/7 Continuous Operation**: Operates nonstop without fatigue, illness, breaks, or distraction. | **High Initial Capital Cost**: Purchasing specialized sensors, actuators, and programmable controllers is expensive. |
| **Rapid Real-Time Response**: Reacts in milliseconds to dangerous conditions (e.g. toxic gas leaks or reactor overheating), far faster than humanly possible. | **Vulnerability to Sensor Failure**: If a sensor becomes dirty, damaged, or disconnected, the microprocessor receives incorrect data and may make disastrous decisions. |
| **Human Safety**: Removes human workers from hazardous, radioactive, or chemically toxic environments. | **Redundancy & Maintenance Costs**: Critical automated systems require expensive dual-redundant backup sensors and power supplies. |
| **Consistency & Precision**: Eliminates human variability, producing identical output and optimal energy efficiency. | **Socio-Economic Job Losses**: Automated systems replace manual monitoring and operator jobs, causing technological unemployment. |

## Written practice and self-review

A commercial nursery installs an automated greenhouse climate control system to maintain temperatures between 20°C and 25°C.

1. Describe how the **temperature sensor**, **ADC**, **microprocessor**, and **actuator (ventilation window motor / heater)** interact to regulate the climate.
2. Explain why a **continuous feedback loop** is essential for this system.

Write an explanation before checking the theory. Check that each claim answers the question, uses the correct concept and explains why it applies. Discuss uncertain points with a teacher. The structured exercise below checks specific facts; it does not automatically mark this explanation.

---

## Interactive Exercises & Autotest Specifications

### Exercise 1: Exam-Style Check: Closed-Loop Automated Control (Multiple choice, 25 XP)

**Instructions:**
What is the defining characteristic of a closed-loop automated feedback control system?

**Options:**
- **A**: The computer only accepts human commands via keyboard and never uses sensors.
- **B**: The system shuts down permanently whenever the target temperature is achieved.
- **C**: Sensor measurements are continuously compared against stored target values, and actuators modify the environment which is then re-measured in a continuous loop.
- **D**: The system only operates when connected to a public cloud server.


**Autotest Expectations:**
- **Correct option selected**: `selection_match` -> Expected: `b`

### Exercise 2: Exam-Style Question: Automated Feedback System Components (Fill in blank, 35 XP)

**Instructions:**
Complete each statement describing automated control systems:

1. The physical hardware devices that measure environmental parameters such as heat or light are **[blank_1]**.
2. The converter that transforms continuous analogue sensor signals into digital binary digits is the **[blank_2]** (abbreviation).
3. The electromechanical output devices that physically open valves or spin motors are **[blank_3]**.


**Starter Code:**
```text
{"word_bank":["sensors","ADC","actuators","DAC","microprocessor","RAM"],"template":"1. Measure physical conditions: [blank_1]\n2. Convert analog signal to digital: [blank_2]\n3. Physical output devices taking action: [blank_3]","prompt":"Exam-Style Question: Automated Feedback System Components","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}]}
```

**Autotest Expectations:**
- **Correct automated system terms**: `text_exact` -> Expected: `{&quot;blank_1&quot;:&quot;sensors&quot;,&quot;blank_2&quot;:&quot;ADC&quot;,&quot;blank_3&quot;:&quot;actuators&quot;}`

### Exercise 3: Application: Check the reasoning (Fill in blank, 30 XP)

**Instructions:**
Work out each answer before submitting. Measures the current physical condition: Compares reading with a threshold: Changes the physical condition:


**Starter Code:**
```text
{"prompt":"Application: Check the reasoning","template":"1. Measures the current physical condition: [blank_1]\n2. Compares reading with a threshold: [blank_2]\n3. Changes the physical condition: [blank_3]","blanks":[{"id":"blank_1"},{"id":"blank_2"},{"id":"blank_3"}],"word_bank":["sensor","processor","actuator","ADC","DAC","storage"]}
```


