Arduino Soil Moisture Project
by Sebastian95 in Circuits > Arduino
1404 Views, 3 Favorites, 0 Comments
Arduino Soil Moisture Project
Hello guys
Today I am presenting you my first project on instructables.
It's about measuring soil moisture with Arduino and only one sensor. This project is very easy to make, and everybody who wants to start learning work with Arduino platform should try it. This project can also help someone who has previous experience with Arduino.
Obtaining of All Parts
This project uses only few parts. They are also very cheap to get so don't worry about price.
Parts used in this project:
- Arduino uno rev3
- LCD 1602 green display with I2C
- FC-28-d Soil hygrometer detection module + soil moisture sensor
- Red LED diode
- Blue LED diode
- 2 resistors 220 ohm
- Few jumper cables to connect all of the parts
- Arduino battery connector
Always keep in mind that you can use any other Arduino for this project. You can also change LCD display to any other.
Connecting All Parts Together
In this step you can see the schematic I made with fritzing. I will also write down how to connect every key part of this project down here.
As you can see we are using 5V and GND from arduino to power the breadboard.
LCD :
- VCC to 5V (+ part on breadboard)
- GND to gnd (- part on breadboard)
- SDA to analog pin A4
- SCL to analog pin A5
Soil Moisture Sensor:
- VCC to 5V (+ part on breadboard)
- GND to gnd (- part on breadboard)
- D0 to digital pin 2
- A0 to analog pin A0
Diode connecting:
- one part of diode goes into - part of breadboard
- second part goes through resistor of 220 ohm and after that is is connect to pin 12(blue diode) or 11 (red diode)
Writing Code
I'll try to explain this code in few parts. There will also be written full code so you can copy it and also change it if you see any need.
- First thing to keep in mind is that you need to instal LCD i2c library
- LiquidCrystal_I2C.h
- You also need to configure your lcd on the start of the code
- Set up variables used in code, connecting sensor to pins, and diodes
- In the third part there are methodes created so loop part can be easier written
- Setup for arduino, in this part you are setting up LCD you are using for this project
- Loop part is the main part of this project
Full code is in attachment of this step.
Downloads
Using Your Arduino
Here you can see how does the sensor works.
Red diode is signalizing that sensor has small value of detection. It is around one. In this picture sensor is not placed in ground so the normal result here will be somewhere around one.
On the other picture sensor is placed near plant that was watered few hours ago. As you can see the blue diode is ON.
If there is any other question you can ask me.
Thank you guys for looking at my first project.
With all regards.