sensorProblems = [
{
symptom: "Reading is always zero",
causes: [
{cause: "Wiring disconnected", check: "Verify all connections, especially ground", likelihood: "High"},
{cause: "Wrong pin configuration", check: "Check GPIO pin numbers in code match physical wiring", likelihood: "High"},
{cause: "Sensor damaged", check: "Test with multimeter or replacement sensor", likelihood: "Medium"},
{cause: "Pull-up/down resistor missing", check: "Add appropriate resistor if required by sensor", likelihood: "Medium"}
]
},
{
symptom: "Reading is constant (non-zero)",
causes: [
{cause: "Sensor saturated", check: "Check if measurement is at sensor's max/min range", likelihood: "High"},
{cause: "ADC not configured", check: "Verify ADC resolution and reference voltage settings", likelihood: "Medium"},
{cause: "Floating input", check: "Add pull-up/down resistor to prevent floating", likelihood: "Medium"},
{cause: "Power supply noise", check: "Add decoupling capacitor near sensor", likelihood: "Low"}
]
},
{
symptom: "Reading fluctuates wildly",
causes: [
{cause: "Electrical noise", check: "Add filtering capacitor, use shielded cables", likelihood: "High"},
{cause: "Poor connection", check: "Check for loose wires or cold solder joints", likelihood: "High"},
{cause: "Sampling too fast", check: "Add delay between readings, use averaging", likelihood: "Medium"},
{cause: "Ground loop", check: "Use single ground point, star topology", likelihood: "Medium"}
]
},
{
symptom: "Reading drifts over time",
causes: [
{cause: "Temperature effect", check: "Compensate for ambient temperature changes", likelihood: "High"},
{cause: "Sensor aging", check: "Recalibrate sensor with known reference", likelihood: "Medium"},
{cause: "Self-heating", check: "Reduce sampling rate or add thermal isolation", likelihood: "Medium"},
{cause: "Humidity effect", check: "Use conformal coating or sealed enclosure", likelihood: "Low"}
]
},
{
symptom: "Reading is offset (wrong by fixed amount)",
causes: [
{cause: "Calibration needed", check: "Perform two-point calibration with known values", likelihood: "High"},
{cause: "Reference voltage wrong", check: "Measure actual Vref and adjust calculations", likelihood: "Medium"},
{cause: "Unit conversion error", check: "Verify formula converts raw ADC to engineering units", likelihood: "Medium"},
{cause: "Sensor placement", check: "Ensure sensor is measuring intended quantity", likelihood: "Low"}
]
}
]
viewof selectedSymptom = Inputs.select(
sensorProblems.map(p => p.symptom),
{label: "What symptom are you seeing?", value: "Reading fluctuates wildly"}
)
selectedProblem = sensorProblems.find(p => p.symptom === selectedSymptom)