📖 Scenario: You are working with a SCADA system that reads raw sensor signals. These signals need to be conditioned and scaled to meaningful engineering units before use.For example, a temperature sensor outputs a raw value that must be converted to degrees Celsius.
🎯 Goal: Build a simple program that takes raw sensor signals, applies conditioning by removing noise, and scales the cleaned signals to engineering units.
📋 What You'll Learn
Create a dictionary called raw_signals with exact sensor names and raw values
Add a variable called noise_threshold to filter out noise
Use a for loop with variables sensor and value to condition and scale signals
Print the final scaled signals dictionary called scaled_signals
💡 Why This Matters
🌍 Real World
SCADA systems often receive raw sensor data that must be cleaned and converted to useful units before monitoring or control.
💼 Career
Understanding signal conditioning and scaling is essential for automation engineers and technicians working with industrial control systems.
Progress0 / 4 steps
1
Create raw sensor signals dictionary
Create a dictionary called raw_signals with these exact entries: 'temp_sensor': 523, 'pressure_sensor': 1023, 'flow_sensor': 305
SCADA systems
Hint
Use curly braces to create a dictionary with keys and values exactly as shown.
2
Add noise threshold variable
Add a variable called noise_threshold and set it to 300 to filter out low signal noise
SCADA systems
Hint
Just create a variable named noise_threshold and assign 300 to it.
3
Condition and scale signals
Use a for loop with variables sensor and value to iterate over raw_signals.items(). Inside the loop, if value is greater than or equal to noise_threshold, scale the value by dividing by 10 and store it in a new dictionary called scaled_signals. Skip values below the threshold.
SCADA systems
Hint
Remember to create an empty dictionary before the loop. Use the exact variable names and conditions.
4
Print the scaled signals
Write a print statement to display the scaled_signals dictionary
SCADA systems
Hint
Use print(scaled_signals) exactly to show the final dictionary.
Practice
(1/5)
1. What is the main purpose of signal conditioning in SCADA systems?
easy
A. To display sensor data on a screen
B. To store sensor data in a database
C. To clean and prepare sensor signals for accurate reading
D. To send alerts when sensors fail
Solution
Step 1: Understand signal conditioning
Signal conditioning involves cleaning and preparing raw sensor signals so they can be accurately read and processed.
Step 2: Differentiate from other tasks
Storing data, displaying data, and sending alerts are separate tasks from signal conditioning.
Final Answer:
To clean and prepare sensor signals for accurate reading -> Option C
Quick Check:
Signal conditioning = cleaning signals [OK]
Hint: Signal conditioning cleans signals before use [OK]
Common Mistakes:
Confusing conditioning with data storage
Thinking conditioning means displaying data
Assuming conditioning sends alerts
2. Which of the following is the correct formula to scale a raw sensor voltage (V_raw) to temperature (T) in Celsius if 0V = 0°C and 5V = 100°C?
easy
A. T = (V_raw / 5) * 100
B. T = V_raw * 5 / 100
C. T = 100 / V_raw * 5
D. T = (100 / 5) * V_raw + 10
Solution
Step 1: Understand scaling formula
Scaling converts raw voltage to temperature using proportionality: T = (V_raw / max_voltage) * max_temperature.
Step 2: Apply values
Given max_voltage = 5V and max_temperature = 100°C, formula is T = (V_raw / 5) * 100.
Final Answer:
T = (V_raw / 5) * 100 -> Option A
Quick Check:
Scale voltage proportionally to temperature [OK]
Hint: Divide raw by max voltage, multiply by max value [OK]
Common Mistakes:
Multiplying voltage by 5 instead of dividing
Mixing up numerator and denominator
Adding unnecessary constants
3. Given the Python code below for scaling a sensor signal, what is the output if raw_signal = 2.5?
A. Add a filter to smooth raw_signal and correct formula to (raw_signal / 5) * 100
B. Increase raw_signal by 10 and keep formula same
C. Remove scaling and print raw_signal directly
D. Multiply raw_signal by 5 and subtract 10
Solution
Step 1: Identify noise and formula error
Raw signal is noisy, so smoothing (filtering) is needed. The formula adds 10 incorrectly; scaling should be proportional.
Step 2: Apply fixes
Add a filter to smooth raw_signal. Correct formula is (raw_signal / 5) * 100 without extra +10.
Final Answer:
Add a filter to smooth raw_signal and correct formula to (raw_signal / 5) * 100 -> Option A
Quick Check:
Smooth signal and fix scaling formula [OK]
Hint: Filter noise first, then apply correct scaling formula [OK]
Common Mistakes:
Ignoring noise in signal
Adding constants incorrectly in scaling
Skipping filtering step
5. You receive a raw sensor voltage that ranges from -1V to 6V, but your scaling formula expects 0V to 5V. How should you adjust signal conditioning and scaling to handle this correctly?
hard
A. Add offset to shift signal into 0-5V range, then scale normally
B. Ignore values outside 0-5V and scale only valid range
C. Scale raw signal directly without adjustment
D. Clip values below 0V to 0 and above 5V to 5, then scale
Solution
Step 1: Understand input range mismatch
Raw signal goes beyond expected 0-5V range, which can cause incorrect scaling or errors.
Step 2: Apply clipping before scaling
Clipping values below 0V to 0 and above 5V to 5 ensures scaling formula works correctly without invalid inputs.
Final Answer:
Clip values below 0V to 0 and above 5V to 5, then scale -> Option D
Quick Check:
Clip out-of-range signals before scaling [OK]
Hint: Clip out-of-range signals before scaling [OK]