Table of Contents

Gas Detection with MQ Sensor and Quarky

Example Description
Learn how to interface an MQ sensor with Quarky to detect the presence of gases like alcohol.

Introduction

The MQ series of sensors comprises a range of gas detectors used to detect multiple gases like CO2, LPG, CO, and more. These sensors find applications in various scenarios, from detecting fire-induced smoke in buildings to detecting gas leaks, making them crucial for mining and other industries.

Buy MQ-137 NH3 Gas Sensor Module Online in India | Robocraze

In this example, we will interface an MQ sensor with Quarky to specifically detect the presence of alcohol. Our objective is to detect alcohol levels and trigger an alarm if they exceed a certain limit. Let’s embark on this exciting journey of gas detection with Quarky!

Circuit Diagram:

Code:

  1. Create the circuit as per the provided circuit diagram.
  2. Open Pictoblox and create a new file.
  3. Select Quarky from the Board menu.
  4. Drag the “if-then-else” block from the controls palette into the scripting area.
  5. From the operator palette, add the “greater than” operator into the “if” conditional part.
  6. Insert the “read analog sensor () at pin()” block from sensor palette Quarky into the space provided in the “greater than” operator block.
  7. As the sensor is connected to A1, set the condition to check if the value generated by the sensor is greater than 50. If it is, it indicates that the gas (alcohol) is above the desired level, and Quarky should trigger the LED connected to pin D1. Otherwise, the LED should remain off.
  8. Drag the “forever” block from the controls palette into the scripting area and place the above code block inside the “forever” block.
  9. Now your script is complete. Add an event to start the script by dragging the “when flag clicked” block from the events palette to the beginning of the script.

 

Script

 

Output

With this exciting project, you have learned how to interface an MQ sensor with Quarky to detect alcohol gas levels. Explore the diverse applications of MQ sensors, from detecting smoke in buildings to monitoring gas leaks in industrial settings. Create your own gas detection system with Quarky, and unleash the potential of gas sensing technology! Keep experimenting, and the world of robotics and AI will become your playground!

 

Output gifs are need to be updated.