0
0
Arduinoprogramming~20 mins

Multiple sensor fusion in Arduino - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Master of Multiple Sensor Fusion
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output 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() {}
A50
B80
C30
D40
Attempts:
2 left
💡 Hint
Think about how averaging two numbers works.
Predict Output
intermediate
2:00remaining
Output 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() {}
A26.0
B30.0
C28.0
D32.0
Attempts:
2 left
💡 Hint
Multiply each sensor by its weight and add the results.
🔧 Debug
advanced
2:00remaining
Identify 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() {}
APrints 15
BPrints 30
CPrints 20
DPrints 25
Attempts:
2 left
💡 Hint
Remember operator precedence in arithmetic expressions.
Predict Output
advanced
2:00remaining
Output 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() {}
A55
B45
C100
D0
Attempts:
2 left
💡 Hint
Check which sensor value is bigger.
🧠 Conceptual
expert
2:00remaining
Number 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?
A25
B5
C15
D10
Attempts:
2 left
💡 Hint
Think about how many readings are combined at each step and if the number changes.