Try Sensor-Actuator Mapping in IoT Terms
Try Choose Smart Thermostat under IoT application and leave Setpoint / threshold (%) at 50; lower Sensor reading (%) from 50.
Observe At the default reading of 50 the heater output is 0%; lowering Sensor reading (%) below the setpoint raises the heater bar.
Explain For Smart Thermostat, Sensor reading (%) below the setpoint produces five times the gap as heater power, capped at full output; otherwise the heater is off.
Calculate actuator response
Reset
Technical boundaries. The mapping assumes an immediate response with no room, fan or soil dynamics. Lighting uses the complement of the reading, while heater, fan and pump outputs use fixed gap multipliers of 5, 4 and 3, capped at 100%.
Try Sensor-Actuator Mapping in IoT Terms
Choose a real-world IoT application and adjust the sensor reading to see how different Braitenberg wiring types translate into actuator output. This demonstrates that many everyday IoT devices use simple reactive mappings.
viewof iot_app = Inputs. select (
["Smart Thermostat" , "Adaptive Lighting" , "Fan Controller" , "Plant Watering System" ],
{value : "Smart Thermostat" , label : "IoT application" }
)
viewof iot_sensor_reading = Inputs. range ([0 , 100 ], {value : 50 , step : 1 , label : "Sensor reading (%)" })
viewof iot_setpoint = Inputs. range ([10 , 90 ], {value : 50 , step : 1 , label : "Setpoint / threshold (%)" })
iot_mapping_result = {
const r = iot_sensor_reading;
const sp = iot_setpoint;
let sensorName = "" , actuatorName = "" , sensorUnit = "" , actuatorUnit = "" ;
let output = 0 ;
let wiringType = "" ;
let explanation = "" ;
if (iot_app === "Smart Thermostat" ) {
sensorName = "Temperature sensor" ;
actuatorName = "Heater" ;
sensorUnit = "°C" ;
actuatorUnit = "% power" ;
// Inhibitory: higher temp -> less heating
output = Math . max (0 , Math . min (100 , (sp - r) * 3 + 50 ));
if (r < sp) output = Math . min (100 , (sp - r) * 5 );
else output = 0 ;
wiringType = "Same-side inhibitory (Love)" ;
explanation = r < sp
? `Temperature ( ${ r} °C) is below setpoint ( ${ sp} °C) — heater is ON at ${ output. toFixed (0 )} % to warm the room.`
: `Temperature ( ${ r} °C) is at or above setpoint ( ${ sp} °C) — heater is OFF. The system has "arrived" at its target, like a love vehicle stopping near the stimulus.` ;
} else if (iot_app === "Adaptive Lighting" ) {
sensorName = "Ambient light sensor" ;
actuatorName = "LED brightness" ;
sensorUnit = "lux (%)" ;
actuatorUnit = "% brightness" ;
// Cross-wired inhibitory: low ambient -> high LED
output = Math . max (0 , Math . min (100 , 100 - r));
wiringType = "Cross-wired inhibitory (Explorer)" ;
explanation = `Ambient light is ${ r} % — LED compensates at ${ output. toFixed (0 )} % brightness. Dark rooms get bright LEDs; bright rooms get dim LEDs. The cross-wired inhibitory mapping maintains even illumination.` ;
} else if (iot_app === "Fan Controller" ) {
sensorName = "Temperature sensor" ;
actuatorName = "Fan speed" ;
sensorUnit = "°C (%)" ;
actuatorUnit = "% speed" ;
// Excitatory: higher temp -> faster fan
output = r > sp ? Math . min (100 , (r - sp) * 4 ) : 0 ;
wiringType = "Same-side excitatory (Fear-like)" ;
explanation = r > sp
? `Temperature ( ${ r} %) exceeds threshold ( ${ sp} %) — fan runs at ${ output. toFixed (0 )} % to cool down. Higher temperature drives stronger actuator response (excitatory).`
: `Temperature ( ${ r} %) is below threshold ( ${ sp} %) — fan is OFF. No stimulus above threshold means no response.` ;
} else {
sensorName = "Soil moisture sensor" ;
actuatorName = "Water pump" ;
sensorUnit = "% moisture" ;
actuatorUnit = "% flow" ;
// Inhibitory: high moisture -> no watering
output = r < sp ? Math . min (100 , (sp - r) * 3 ) : 0 ;
wiringType = "Same-side inhibitory (Love)" ;
explanation = r < sp
? `Soil moisture ( ${ r} %) is below threshold ( ${ sp} %) — pump runs at ${ output. toFixed (0 )} % flow. As moisture rises toward the setpoint, the pump gradually reduces (inhibitory), stopping when the soil is sufficiently moist.`
: `Soil moisture ( ${ r} %) is at or above threshold ( ${ sp} %) — pump is OFF. The system has reached its "love" target.` ;
}
return {sensorName, actuatorName, sensorUnit, actuatorUnit, output, wiringType, explanation};
}
html `<div style="background: var(--bs-light, #f8f9fa); padding: 1rem; border-radius: 8px; border-left: 4px solid #E67E22; margin-top: 0.5rem;">
<p><strong> ${ iot_mapping_result. sensorName } :</strong> ${ iot_sensor_reading}${ iot_mapping_result. sensorUnit === "lux (%)" ? "%" : "" } → <strong> ${ iot_mapping_result. actuatorName } :</strong> ${ iot_mapping_result. output . toFixed (0 )}${ iot_mapping_result. actuatorUnit === "% power" || iot_mapping_result. actuatorUnit === "% brightness" || iot_mapping_result. actuatorUnit === "% speed" || iot_mapping_result. actuatorUnit === "% flow" ? "%" : "" } </p>
<div style="display:flex; gap:1rem; align-items:center; margin: 0.75rem 0;">
<div style="flex:1;">
<div style="background:#dee2e6; border-radius:4px; height:18px; overflow:hidden;">
<div style="background:#3498DB; height:100%; width: ${ iot_sensor_reading} %; border-radius:4px; transition: width 0.3s;"></div>
</div>
<div style="font-size:0.8em; color:#7F8C8D; text-align:center; margin-top:2px;">Sensor: ${ iot_sensor_reading} %</div>
</div>
<div style="font-size:1.2em; color:#2C3E50;">→</div>
<div style="flex:1;">
<div style="background:#dee2e6; border-radius:4px; height:18px; overflow:hidden;">
<div style="background:#16A085; height:100%; width: ${ iot_mapping_result. output } %; border-radius:4px; transition: width 0.3s;"></div>
</div>
<div style="font-size:0.8em; color:#7F8C8D; text-align:center; margin-top:2px;">Actuator: ${ iot_mapping_result. output . toFixed (0 )} %</div>
</div>
</div>
<p><strong>Braitenberg wiring type:</strong> ${ iot_mapping_result. wiringType } </p>
<p style="font-size: 0.9em; color: #6c757d; border-top: 1px solid #dee2e6; padding-top: 0.5rem; margin-top: 0.5rem;"> ${ iot_mapping_result. explanation } </p>
</div>`
Back to the chapter