Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Data sensing acquisition and notification framework using moisture sensor

By Dishant Shah February 27, 2022

 

India is an agricultural country & farming is a basic occupation in our country. Since today farmers are watering the plants everyday but this is the project which helps the farmers & in farming field for watering without any problem because here there is watering system is made. In this system the thirsty plant gives message to the farmer that it needs water and then we can water the plants. Nowadays, people have nursery at their home and some people have hobby of gardening. So at these places also this watering system is very useful for people. In nursery there are many types of plants. From those many plants need more water & some plants need less water depending on the level of moisture in the soil.People use this system in their daily life & this system is called botanical system.

 

        

                                                         

Botanical systemThere is one problem with this system that if plants need water and at that time the farmer or owner is outside from the place so they are not capable for watering. The solution of this problem is to attach water pump with every plant and when plant needs water it will be watered automatically using pump. Both the processes, one is to receive the message by the owner and second is watering to the plant occurs simultaneously in this system.

 

Hardware & Description

Block diagram:

 

         

Block Diagram

Description of block diagram:

Figure shows the block diagram of data sensing, acquisition and notification framework using moisture sensor. It contains 6 sections.

Power supply:-

The power supply section consists of step down transformers of 230V primary to 5V secondary voltage for the +5V power supply. This circuit provides 5V to the whole circuit.

GSM modem:-

QUECTEL M 10 is interfaced with ATmega16 microcontroller to decode the received message and do the required action. The protocol used for the communication between the two is AT command.

ATmega16 microcontroller:-

The microcontroller is the heart of the system. It constantly monitors the digitized parameters of the humidity sensor and verifies them with the predefined threshold values and checks if any corrective action is to be taken for the condition at that instant of time.

Humidity sensor:-

We are using SY-HS 230 humidity sensor.

LCD display

16×2 LCD display is used to display the RH value of humidity sense by humidity sensor.

Relay

We are using KT-603 relay to control the water pump.

Schematic diagram Schematic Diagram for Power Supply & Microcontroller shown in circuit diagram tab 1.

 

GSM Schematic & Working

GSM Schematic Diagram

Shown in circuit diagram tab 2. 

Working:

          1. 5V power supply given to the microcontroller and humidity sensor simultaneously.

          2. Humidity sensed by the humidity sensor which is in analog form.

          3. Analog value is given to the ADC pin of microcontroller.

          4. ADC works with count form.

          5. Analog value of the humidity is converted in the count form.

          6. This count value is converted in the RH value automatically. 

{         7. At the time of programming one threshold value in the form of relative humidity is set.

          8. Both RH values are compared with each other.

             If received RH value is less than the fix RH value then through GSM message is received and via microcontroller relay will on and so pump will start watering to the plant.

         9.Process will continue till the received value will become equal to the threshold value.

       10.When received value exceeds the threshold value then through GSM message is received and via microcontroller relay will off and pump will stop watering.

Component List

Component list  

COMPONENT

VALUE/MODEL NAME

QUANTITY

Microcontroller

Atmega16

1

Soil Moisture sensor

SY-HS-230

1

GSM module

Quectel M10

1

Relay

KT-603

1

Sim card

–

1

Transistor

BC547

2

IC

7805

1

Resistor

220ohm,22ohm

15

Capacitor

1000uF,100uF,10uF,1uF

6

Led

–

5

Antenna

–

1

Diode

–

7

Water pump

–

1

Technical specification of componentsKT-603  relay

Features

value

Contact Material

 

Silver alloy

 

Operate time

 

10ms

 

Release time

 

5ms

 

Temperature range

 

-40°C to85°C

Humidity

40-85%

Coil power

 

0.36W

Max Operating voltage

3.75 V

 

Component List Contd and Flowchart..

SY-HS-230 moisture sensor specification

Features

Value

Rated Voltage

 

5 V

Operating temperature

 

0-60 ?

Operating humidity

 

10-90%RH

Storage humidity

 

Within 95%RH

Storage Temperature

 

-30 to 85?

Accuracy

+/- 5% RH(25?)

 

Moisture Sensor Specification

7805 IC specification

Features

Value

Output current

1.5 A

Operating temperature

-40-150?

Storage temperature

-55-150?

Maximum junction temperature

150?

BC547 specification

Features

Value

Maximum voltage

65 V

Maximum current

100mA

Junction temperature

150?

Storage temperature

-65-150?

Quectel M10 GSM  module specification

Features

Value

Quad band

850/900/1800/1900 MHz

Operating temperature

-45? to +85?

Supply voltage range

3.4-4.5 V

Dimensions

29mm*29mm*3.6mm

External sim

3V

FLOW CHART

Flow Chart

Result & Conclusion

TEST & Results

Test set-up

Troubleshooting

        LCD display was not working  properly. So it is replaced.

        GSM was not working  properly. So it is replaced. 

Result

Humidity(%RH)

Message

47

Plz give me water

62

Plz give me water

80

Thank You

 

                                         

 

Image of the Output

Conclusion & Future expansion

Conclusion

We conclude by this project that if moisture level is below threshold value then plant will notify us for giving it water by message through GSM and if moisture level is above threshold value then it also notify us by message through GSM. We got different results through testing.

Future expansion

·         This concept can be used for different plants simultaneously.

·        We can attach temperature sensor for measuring temperature.

·        All data can be received from different farms of state or country and can be centralized into one database in the main central station.

                  ·         We can make program for different RH value for different plants.

 

 

You may also like:


  • What are the top development boards for AI and ML?

  • What are different types of industrial robots?

  • How does LoRa modulation enable long-range communication?

  • What is the role of embedded software in electric vehicles?

  • What are the components of robotic arms and industrial robots?

  • What is the Modbus protocol and how does it work?

Project Source Code

 

Project Source Code

 ###


 

$regfile = "M16def.dat"

 $crystal = 8000000
 $framesize = 24
 $hwstack = 32
 $swstack = 8
 $baud = 19200                                               '****BAUD RATE IS AUTO DETECTED BY GSM SO YOU CAN TAKE ANY ONE
 Dim A As String * 5 , Rcvd As String * 5
 Dim I As Integer
 'Config Portc = Output
 
 Config Lcdpin = Pin , E = Portc.4 , Rs = Portc.5 , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0
 Config Lcd = 16 * 2
   Config Adc = Single , Prescaler = Auto , Reference = Avcc
 
 Start Adc
 
 Dim S As Integer
 
 Dim W As Word
  Dim H As Integer
  Config Portd.6 = Output
 
 
 
 Config Serialin = Buffered , Size = 254
 Config Serialout = Buffered , Size = 254
 Enable Interrupts
 Config Portd.6 = Output
 'Set Portc.6 '
 'Waitms 500'
 'Reset Portc.6 'POWER KEY (LOW)PULSE
 'Wait 2'
 'Set Portc.6'
 ' Cls
 
  Lcd "gsm"
  Wait 1
  Cls
 
 Wait 25                                                     'WAIT FOR FINE NETWORK
 
 Do
 Cls
 
 
 For S = 0 To 100 Step 1
 
 W = Getadc()
 
 W = W / 8
  Locate 1 , 1
 
 Lcd "HUMIDITY:"
 Locate 1 , 10
 Lcd W
 
 Waitms 100
 Next
 
 Cls
 
 If W > 70 Then
 Reset Portd.6
 H = 1
 Else
  Set Portd.6
 H = 2
 End If
 
 
 Cls
 Locate 1 , 1
 Lcd "Power UP"
 Wait 2
 Cls
 
 Do
 Cls
 Locate 1 , 1
 Lcd "Waiting"
 Print "AT"                                                  'SENDING "AT" FOR CHEKING THE GSM MODEM IS WORKING
 A = Inkey()
 Loop Until A = "O"                                          'RESPONSE OF "AT" IS "OK" SO WAITING FOR  FIRST LETER "O"
 
 Rcvd = A
 
 Do
 A = Waitkey()
 Loop Until A = "K"                                          'RESPONSE OF "AT" IS "OK" SO WAITING FOR  SECOND LETER "K"
 
 Rcvd = Rcvd + A                                             'COMBINE "O & K" FOR FINAL RESPONSE"OK"
 
 
 
 
 Cls
 Lcd Rcvd
 
 Wait 2
 
 Rcvd = ""                                                   'MAKING RCVD EMPTY FOR OTHER RESONSE
 
 Cls
 Print "AT+CMGF=1"                                           'TO ENTER IN TEXT MODE OTHER WISE MODEM WILL BE IN PDU(PACKET DATA UNIT) "AT+CMGF=0"
 Locate 1 , 1
 Lcd "AT+CMGF=1"                                             'FOR DISPLAY
 
 Do
 A = Inkey()
 Loop Until A = "O"                                          'RESPONSE OF "AT+CMGF=1" IS "OK" SO WAITING FOR  FIRST LETER "0"
 
 Rcvd = A
 Do
 A = Inkey()
 Loop Until A = "K"                                          'RESPONSE OF "AT+CMFG=1" IS "OK" SO WAITING FOR  SECOND LETER "K"
 Rcvd = Rcvd + A
 
 Lowerline
 
  Lcd Rcvd
  Wait 4
 Cls
 
 Print "AT+CMGD=1"                                           'TO RECIVE THE NEW MESSAGE IN 1ST INDEX WE ARE DELETING THE FIRST ENTRY                                       ' ; I
 Lcd "AT+CMGD=1"
 Rcvd = ""
 Do
 A = Inkey()
 Loop Until A = "O"
 
 Rcvd = A
 Do
 A = Inkey()
 Loop Until A = "K"
 Rcvd = Rcvd + A                                             'RESEPONSE IS "OK"
 
 Lowerline
 
 
  Lcd Rcvd
 
 
  Wait 4
 Rcvd = ""
 Cls
 Locate 1 , 1
 
 Lcd "AT+CMGW=" + Chr(34) + "9974621247" + Chr(34)

'TO WRITE RECIPIENT'S MOBILE NUMBER TO MEMORY THE AT COMMAND IS "AT+CMGW=1"

Print "AT+CMGW=" + Chr(34) + "9409085769" + Chr(34)        

'examlpe - - > At + Cmgw = "9904353830" , Chr(34) Replaces DOUBLE QUOTATION
 
 Do
 A = Inkey()
 Loop Until A = ">"                                          'RESPONSE OF AT+CMGW="9904353830" IS ">" SO WAITING FOR ">"
 Cls
 Lcd "OK"
 Wait 1
 
 Wait 2
 Rcvd = ""
 Cls
 Locate 1 , 1
 
 Lcd "system is WORKING"
 
 
 If H = 1 Then
 
 Print "THANK YOU"
 
 Elseif H = 2 Then
 
 Print "PLZ GIVE WATER"
 
 End If
                               'TO WRITE MESSAGE TO MEMORY
 Print Chr(26)                                               'IT IS NECCESSARY TO GIVE CTRL+Z AFTER WRITING MESAGE, CHR(26) = CTRL+Z
 
 
 Do
 A = Inkey()
 Loop Until A = "O"                                          'RESPONSE AFTER CTRL+Z IS "OK" SO WAITING FOR "O"
 
 Rcvd = A
 Do
 A = Inkey()
 Loop Until A = "K"                                          'WAITING FOR "K"
 Rcvd = Rcvd + A
 
 Cls
 Locate 1 , 1
 Lcd Rcvd
 Wait 2
 Cls                                                         '***** MESSAGE IS STORED AT FIRST INDEX BEACAUSE WE ARE DELETING 1ST ENTRY
                                                             'WE HAVE CHECKED IT THROUGH HYPER TERMINAL, SEE "HYPER TERMINAL OUTPUT.DOC" FILE
 
 Print "AT+CMSS=1"                                           'TO SEND SMS STORED IN 1ST INDEX WE WRITE "AT+CMSS=1"
 Lcd "AT+CMSS=1"
 
 
 Clear Serialin
 Rcvd = ""
                                                 '****** RESPONSE OF "AT+CMSS=1" IS +CMSS: 1
 For I = 1 To 10
 A = Waitkey()
 
 Clear Serialin
 
 Rcvd = Rcvd + A                                             'RESPONSE IS COLLECTED IN Rcvd STRING VARIABLE JUST TO SEE
 
 
 Next
 
 Locate 2 , 1
 
 Lcd Rcvd
 
 
 
 
 Do
 A = Inkey()
 Loop Until A = "O"                                          'FINALLLLLLLLLLLLLLLLLLLLYYYYYYYYYYY  MESSAGE FORM MICROCONTROLLER TO MOBILE
 
 Rcvd = A
 Do
 A = Inkey()
 Loop Until A = "K"
 Rcvd = Rcvd + A
 
 Cls
 Locate 1 , 1
 Lcd Rcvd
 Lowerline
 Lcd "MES SENT"
 Wait 2
 
 Loop
 End

 

 

###

 


Circuit Diagrams

Image2
GSM-image


Filed Under: Electronic Projects
Tagged With: data acquistion, microcontroller, moisture sensor, sensor
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Power Efficiency
Discover proven strategies for power conversion, wide bandgap devices, and motor control — balancing performance, cost, and sustainability across industrial, automotive, and IoT systems.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions.

  • CST Studio Suite 2021 – New Project Window Shows Black Screen
  • Introduction to the Principle of Human Detection by Millimeter-Wave Radar Modules
  • Biasing an AC signal
  • SiC FET turn-off in 2000W PFC
  • Why SG3525 + TL431 + PC817 feedback is not working on ±35 V push-pull SMPS?

RSS Electro-Tech-Online.com Discussions

  • restarting this Christmas project
  • desoldering
  • Unknown, to me, electric motor fitting
  • Can a small solar panel safely trickle-charge old NiMH AA batteries?
  • KiCad custom symbol definition correct approach

Featured Tutorials

Real Time Hardware Filter Design

  • Practical implementation of bandpass and band reject filters
    Practical implementation of bandpass and band reject filters
  • Practical application of hardware filters with real-life examples
    Practical application of hardware filters with real-life examples
  • A filter design example
    A filter design example
  • Types of filter responses
    Types of filter responses
  • What are the two types of hardware filters?
    What are the two types of hardware filters?
  • What are hardware filters and their types?
    What are hardware filters and their types?
More Tutorials >

Recent Articles

  • Taiwan Semiconductor adds 24-V automotive TVS devices
  • ST e-fuse controller enables fast, flexible automotive power protection
  • Posifa sensors improve low-flow accuracy in compact systems
  • Acopian releases low-profile power supplies rated to 900 W
  • Octavo Systems OSDZU-3 REF Development Platform

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe