0287: MQ-2 Gas sensor, Arduino, Raspberry Pi

Опубликовано: 22 Апрель 2026
на канале: Pier Aisa
8,001
101

💳 Support the channel
🔴Patreon:   / pieraisa  
🔵Paypal: [email protected]
🟢Online Shop https://teespring.com/stores/pier-aisa
📣 Forum: https://www.pieraisa.it/forum/
🎬 Full list of videos https://www.pieraisa.it/videolist
📌 Free Download Area: https://www.pieraisa.it/download
📺 Website: https://www.pieraisa.it/
✉ Email: [email protected]

Sources: http://mylothehack.altervista.org/ope...
I'm testing the MQ-2 sensor, a gas detector suitable for identifying the concentration of gases such as propane, methane, hydrogen, alcohol, and smoke. This sensor has a stannic oxide sensing element, which changes its conductivity as a function of gas concentration, according to a curve provided by the manufacturer. The curve is double-logarithmic and shows an almost straight trend. To calculate the gas concentration starting from the analog voltage value supplied by the sensor, I obtain an approximate linearized curve with a point and the slope, for the case of LPG gas. I experimented with reading the gas concentration in parts per million on Arduino by stimulating the sensor with a camping butane propane canister and saw that the concentration practically changes from 0 to over 10,000 ppm. To perform the same reading with Raspberry, you need to use an external ADC, because unlike Arduino, Raspberry does not have an integrated ADC. I use an MCP3008 connected via SPI interface and use the free source code found on GitHub. As always, you can find all the sources on my portal at http://mylothehack.altervista.org/ope...

#raspberry #raspberrypi