Overall, the general steps to interface the Arduino with a sensor device, as outlined in Chapter 4, Day 2 - Interfacing with Sensors, will be followed once again in this chapter. However, you will notice that for the smoke detector, we do not require an Arduino library. The reason is because the smoke detector's output can be directly read via an analog pin or via a digital pin.
For building the smoke detector project the following parts will be required:
- Arduino Uno R3
- USB connector
- 1 bread board
- 1 MQ2 gas sensor
- 1 Piezo Buzzer
- 1 pc. 100 ohms resistor
- Some male-to-male jumper wires
- Some female-to-male jumper wires
First, let us inspect the method of using the digital pin; after that we will see the method of using the analog pin. Just so you know, it may be a little difficult to trigger smoke detection using the digital pin method, compared...