Track relative methane response with MQ-4 after long preheating and calibration; use certified gas detectors for life-safety applications.
Use a reed switch as a magnet-operated contact, adding a pull-up, debounce, and suitable mechanical placement.
Read the YL-99 impact-switch module with a defined pull-up and verify its polarity and board pinout before wiring.
Read the KY-031 as a mechanical impact switch and debounce its short, bouncing pulses in software.