I guess I should start by admitting that this article was inspired by my own stupidity. When I was a kid, I left a frying pan on a lit stove. I was probably confused by the tactile controls on the vitroceramic hob. Unfortunately, I unwittingly turned the stove up to maximum. Thinking I had actually turned it off, I went to watch TV.
Some minutes later, the living room started filling with smoke. To make a long story short: The oil in the pan was on fire and, to make things worse, I tried to put it out by running it under a faucet.
So, I was a dumb teenager, but this kind of thing could happen to anyone. Fortunately, cheap and easy solutions are available for monitoring your home to minimize risks of fires, gas leaks, and damage by water.
This article describes how to create an alarm system on par with commercial home alarm systems (Figure 1). I’ll focus on monitoring the kitchen, which is where accidents are more likely to happen.
Sensors are a common theme in articles about Arduino and Raspberry Pi: distance sensors, humidity sensors, luminosity sensors… In this case, I’ll focus on sensors that can detect dangers in the home. Because fire is one of the most common and destructive hazards, I’ll look at some devices that are normally very small and are commonly used for fire detection.
In the first example, I will build a homemade fire detector with a smoke sensor . This sensor is tiny, as you can see in Figure 2, and it has six pins that allow you to measure the presence of various types of gas, but its main function is to indicate the presence of smoke. Figure 3 shows the schematics of the pins and the basic configuration. I have to feed in 5 volts between pin H (5V and GND) and pump 5 volts into A as well to get the analogical signal proportional to the amount of smoke from B. To adapt the current, place an RL resistor of between 3K and 30K between the signal in B and ground. In this example, I used a 4K7 resistor.
The second example in this article uses a methane sensor  to detect possible gas leaks in the kitchen. The methane sensor allows you to detect fires and methane leaks in homes and small workshops. The configuration for the methane sensor is similar to the smoke sensor.
Of course, you can add many other kinds of smoke and gas detectors with similar characteristics. By studying the spec sheets , you can see the basic circuits of each, so it shouldn’t be difficult to adapt these concepts to your needs. As you can see in the CO2 sensor in Figure 4, for example, the sensors are similar in size and are encapsulated in similar way, so you can develop a very modular system.
Another danger in the home is the possibility of flooding caused by leaks or broken pipes. To detect this kind of hazard, I will use a system  that detects water based on the principle that water conducts electricity.
For more detail: Arduino watches for a kitchen catastrophe schematic