Challenge - 5 Problems
Master of Multiple Sensor Fusion
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of fused sensor data averaging
Given two sensors providing integer readings, what is the output of the fused average printed by the Arduino code below?
Arduino
int sensor1 = 30; int sensor2 = 50; int fusedValue = (sensor1 + sensor2) / 2; void setup() { Serial.begin(9600); Serial.println(fusedValue); } void loop() {}
Attempts:
2 left
💡 Hint
Think about how averaging two numbers works.
✗ Incorrect
The code adds sensor1 and sensor2 (30 + 50 = 80) and divides by 2, resulting in 40.
❓ Predict Output
intermediateOutput of weighted sensor fusion
What value does the Arduino print when fusing two sensor readings with weights 0.7 and 0.3 respectively?
Arduino
float sensor1 = 20.0; float sensor2 = 40.0; float fusedValue = sensor1 * 0.7 + sensor2 * 0.3; void setup() { Serial.begin(9600); Serial.println(fusedValue); } void loop() {}
Attempts:
2 left
💡 Hint
Multiply each sensor by its weight and add the results.
✗ Incorrect
20.0 * 0.7 = 14.0, 40.0 * 0.3 = 12.0, 14.0 + 12.0 = 26.0.
🔧 Debug
advancedIdentify the error in sensor fusion code
What value does the following Arduino code print?
Arduino
int sensor1 = 10; int sensor2 = 20; int fusedValue = sensor1 + sensor2 / 2; void setup() { Serial.begin(9600); Serial.println(fusedValue); } void loop() {}
Attempts:
2 left
💡 Hint
Remember operator precedence in arithmetic expressions.
✗ Incorrect
Division happens before addition, so sensor2/2 = 10, then add sensor1 (10 + 10 = 20).
❓ Predict Output
advancedOutput of sensor fusion with conditional logic
What is the output of the Arduino code that fuses two sensor values but uses a condition to select the higher value?
Arduino
int sensor1 = 45; int sensor2 = 55; int fusedValue; void setup() { Serial.begin(9600); if(sensor1 > sensor2) { fusedValue = sensor1; } else { fusedValue = sensor2; } Serial.println(fusedValue); } void loop() {}
Attempts:
2 left
💡 Hint
Check which sensor value is bigger.
✗ Incorrect
Since 55 is greater than 45, fusedValue is set to 55.
🧠 Conceptual
expertNumber of fused data points after combining three sensors
If you fuse data from three sensors each providing 5 readings, how many total fused data points do you get if you combine readings pairwise and then fuse those results?
Attempts:
2 left
💡 Hint
Think about how many readings are combined at each step and if the number changes.
✗ Incorrect
Pairwise fusion combines readings at the same index, so total fused points remain 5.
