Acidic Rain Detector by Arduino Uni and Ph Sensor

by munaodeh861 in Circuits > Arduino

345 Views, 2 Favorites, 0 Comments

Acidic Rain Detector by Arduino Uni and Ph Sensor

acid-rain.jpg
download.png

Acidic rain, also known as acid rain, is a detrimental environmental phenomenon caused by the presence of pollutants in the atmosphere. It can have harmful effects on plants, aquatic life, and infrastructure. Monitoring the acidity of rainwater is crucial to understanding the impact of pollution on the environment.

The Acidic Rain Detector project aims to provide a simple and cost-effective solution for detecting the pH level of rainwater using an Arduino Uno microcontroller and a pH sensor. By measuring the pH level, we can identify the presence of acidity in rainwater and take appropriate measures to protect ecosystems and minimize its harmful effects.

Downloads

Supplies

  1. Arduino Uno
  2. Rain sensor module
  3. Servo motor
  4. pH sensor module
  5. Liquid Crystal Display (LCD) module with I2C interface
  6. Male-to-female jumper wires
  7. USB cable (for connecting Arduino Uno to the computer)
  8. Breadboard (optional, for prototyping and organizing connections)buffer powders for calibration (optional)
  9. Power supply for the Arduino Uno (can be USB power or a separate power source)

Gather the Required Components

Step 1: Gather the Required Components

Before starting the project, gather all the necessary components. Here's a list of the components you'll need:

  1. Arduino Uno: The Arduino Uno is the main microcontroller board that will control the project. Ensure you have a compatible Arduino Uno board.
  2. Rain Sensor: Obtain a rain sensor module. This module typically includes a control board and a conductive surface for rain detection.
  3. Servo Motor: Acquire a servo motor that can rotate to open and close the water container. Make sure it is compatible with the Arduino Uno.
  4. pH Sensor: Obtain a pH sensor module that provides an analog output. Ensure it is compatible with the Arduino Uno.
  5. Jumper Wires: Gather jumper wires (male-to-male, male-to-female, and female-to-female) to establish connections between the components.
  6. Water Container: Prepare a suitable water container with a lid that can be opened and closed by the servo motor.
  7. Power Supply: Ensure you have a power supply for the Arduino Uno, which can be a USB cable connected to a computer or an external power source.
  8. Breadboard (optional): Consider using a breadboard to create a temporary connection platform for prototyping and testing the circuit.


Wire the Circuit

acidic Rain Circuit diagram.png

To wire the circuit based on the provided code, follow these steps:

  1. Connect the Rain Sensor:
  • Connect the VCC pin of the rain sensor module to the 5V pin on the Arduino Uno.
  • Connect the GND pin of the rain sensor module to the GND pin on the Arduino Uno.
  • Connect the DO pin of the rain sensor module to any digital input pin on the Arduino Uno. In the code, it is connected to analog pin A0.
  1. Connect the Servo Motor:
  • Connect the red wire of the servo motor to the 5V pin on the Arduino Uno.
  • Connect the brown or black wire of the servo motor to the GND pin on the Arduino Uno.
  • Connect the yellow or orange wire of the servo motor to digital pin 9 on the Arduino Uno.
  1. Connect the pH Sensor:
  • Connect the VCC pin of the pH sensor module to the 5V pin on the Arduino Uno.
  • Connect the GND pin of the pH sensor module to the GND pin on the Arduino Uno.
  • Connect the analog output pin of the pH sensor module to any analog input pin on the Arduino Uno. In the code, it is connected to analog pin A1.
  1. Connect the LCD:
  • Connect the SDA pin of the LCD module to the SDA pin (A4) on the Arduino Uno.
  • Connect the SCL pin of the LCD module to the SCL pin (A5) on the Arduino Uno.
  • Connect the VCC and GND pins of the LCD module to the 5V and GND pins on the Arduino Uno, respectively.

Ensure that the connections are secure and properly inserted into the respective pins. Once the circuit is wired, you can proceed to upload the code to the Arduino Uno and test the functionality of the acidic rain detector.

Upload the Code and Test the Acidic Rain Detector



To upload the code to the Arduino Uno and test the functionality of the acidic rain detector, follow these steps:


1. Connect the Arduino Uno to your computer using a USB cable.


2. Open the Arduino IDE on your computer.


3. In the Arduino IDE, go to "File" -> "New" to create a new sketch.


4. Copy and paste the provided code into the Arduino IDE.


5. Verify that the code compiles without any errors by clicking on the "Verify" button (checkmark icon) in the top left corner of the Arduino IDE.


6. Select the correct board and port:

  - Go to "Tools" -> "Board" and select "Arduino/Genuino Uno".

  - Go to "Tools" -> "Port" and select the appropriate port to which the Arduino Uno is connected.


7. Upload the code to the Arduino Uno by clicking on the "Upload" button (right arrow icon) in the top left corner of the Arduino IDE.


8. After the code is successfully uploaded, open the Serial Monitor by clicking on the "Serial Monitor" button (magnifying glass icon) in the top right corner of the Arduino IDE. Set the baud rate to 9600.


9. Ensure that the rain sensor, servo motor, pH sensor, and LCD are properly connected to the Arduino Uno and the power supply.


10. Observe the behavior of the system:

  - When rain is detected, the servo motor should open the water container, and the LCD should display "Rain detected."

  - After a delay of 2 seconds, the pH value of the collected rainwater should be displayed on the LCD.

  - If the pH value is less than 7, indicating acidic rain, the LCD should display "Acidic rain detected." Otherwise, it should display "Healthy rain detected."

  - After another delay of 2 seconds, the servo motor should close the water container.

  - The system should repeat the process after a delay of 5 seconds.


11. Monitor the Serial Monitor for any debug messages or pH sensor values displayed.


By following these steps, you can upload the code to the Arduino Uno and test the functionality of the acidic rain detector. Make sure to check the connections and troubleshoot any issues that may arise during testing.