Robotic Smell?
Robots use chemical sensors to detect invisible hazards like gas leaks, or to perform quality control by "smelling" food. The most common type is the MOS (Metal Oxide Semiconductor) gas sensor, widespread in hobbyist and safety electronics.
Metal Oxide Semiconductor (MOS) Gas
The most common electronic nose sensor. Measures resistance change when gas molecules react with a heated metal oxide surface.
Electrochemical Sensors
Uses chemical reactions to generate tiny electrical currents proportional to gas concentration. Very accurate/specific.
Photo-Ionization Detectors (PID)
Detects Volatile Organic Compounds (VOCs) using UV light to ionize gas molecules.
Electronic Nose (E-Nose)
An array of different semi-selective sensors combined with AI to learn and recognize complex "smells" like coffee or bacteria.
// MQ-2 Gas Sensor (Smoke/LPG/CO)
// Requires 5V and ANALOG PIN
const int sensorPin = A0;
int gasLevel = 0;
void setup() {
Serial.begin(9600);
// Allow heater to warm up for accuracy (datasheet says 24h, practically >5m)
Serial.println("Warming up...");
delay(2000);
}
void loop() {
gasLevel = analogRead(sensorPin);
Serial.print("Gas Level: ");
Serial.print(gasLevel);
// Thresholds need calibration in clean air vs gas
if(gasLevel < 200) {
Serial.println(" (Clean Air)");
} else if (gasLevel < 400) {
Serial.println(" (Smoke Detected)");
} else {
Serial.println(" (HIGH GAS DANGER!)");
}
delay(500);
}