Breath Sensor

by JacobMorrissette in Circuits > Arduino

19 Views, 0 Favorites, 0 Comments

Breath Sensor

image0.jpeg

Blow Activated LED (Breath Sensor) Project

Objective

The objective of this project is to develop a simple sensor circuit using an Arduino microcontroller that activates an LED when you blow into the sensor. Although originally intended as a sound sensor, the module was very unstable, only detecting extremely loud sounds, making it useless for its intended application. It will be repurposed as a breath sensor, detecting breath instead of sound.

Supplies

Components

  1. Arduino board (Uno, Nano, etc.)
  2. Analog sound/airflow sensor (4-pin module with AO pin)
  3. LED (any color)
  4. 220Ω resistor for LED
  5. Breadboard and jumper wires
  6. Arduino IDE (Coding Software)


Wiring

Wiring

  1. Sensor:
  2. + → 5V
  3. - → GND
  4. AO → Arduino A0
  5. DO → left unconnected (not used)
  6. LED:
  7. Anode (long leg) → Arduino pin 8 through a 220Ω resistor
  8. Cathode (short leg) → GND
  9. Power Rails:
  10. Red rail → 5V
  11. Blue rail → GND
Note: This was my first time using a breadboard, so building the circuit involved learning how to properly connect components, organize power and ground rails, and arrange the wires and components securely. It was a hands-on introduction to electronics prototyping.


How It Works

How it Works


  1. The sensor gives an analog output (AO) proportional to the detected vibrations, airflow, or sound.


  1. The Arduino reads the analog output using analogRead(A0) and compares it with a threshold value (in this case, 35).


  1. The Arduino then lights the LED when the reading is above the threshold.


  1. The LED is off when the reading is below the threshold.


Since the sensor is now detecting air movements near the sensor, the sensor is now a breath sensor instead of a sound sensor. The reason for this is that the original function of the sensor was not working well because the sensor could only detect loud sounds.


Code

#define SENSOR_AO A0 // AO pin from sensor

#define LED_PIN 8 // LED pin


int threshold = 35; // LED lights up when reading exceeds this


void setup() {

pinMode(LED_PIN, OUTPUT);

Serial.begin(9600); // open Serial Monitor to see readings

}


void loop() {

int val = analogRead(SENSOR_AO);

Serial.println(val); // see the readings in real time


// LED logic: light up if reading > threshold

if(val > threshold) {

digitalWrite(LED_PIN, HIGH);

} else {

digitalWrite(LED_PIN, LOW);

}


delay(50); // small delay for readability

}

Demonstration

In the video, you see the LED lighting up when I blow on it, but when I strike the desk, making a lot of noise, it doesn't light the LED.

Downloads

Conclusion

Conclusion

The project shows a creative use of a low-cost sensor. The sensor was adapted from a faulty sound module to a breath-controlled LED.


More than this, this was the first time I worked with a breadboard. I learned a lot about planning the connections of the wires, handling the power and ground rails of the board, and ensuring that all the elements are secured appropriately. This was a good learning experience.


It was a good example of a creative problem-solving exercise in a maker project.