IoT based Smart Agriculture Monitoring System
We will use IoT to build a Smart Farming System for this project. The goal of this project is to help farmers get Live Data (Temperature, Humidity, Soil Moisture, and Soil Temperature) fo…

Know the mission before touching a wire.
Understand what you are making, prepare the right tools, and make the workbench safe.
Project details
IoT based Smart Agriculture Monitoring System is a iot project. We will use IoT to build a Smart Farming System for this project. The goal of this project is to help farmers get Live Data (Temperature, Humidity, Soil Moisture, and Soil Temperature) fo…
- Source pages
- 1122-1128
- Named parts
- 23
- Build goal
- Working, tested prototype
Tools you need
- Digital multimeter
- Wire stripper and side cutters
- Soldering iron with a fine tip
- Current-limited bench supply
- Computer with a data-capable USB cable
Use eye protection, good lighting, and a clean insulated surface throughout the build.
Safety precautions
- Disconnect every power source before changing a connection.
- Check component polarity, pinout, and supply voltage twice.
- Use a current limit for the first power-up.
- Keep liquids, loose metal, and uninsulated wires away from the bench.
Gather, identify, and understand every part.
Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.
What's this?Image, role, pros, cons, handling & specifications

Hardware
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Hardware; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications
MODULE LEARNING VIEWNodeMCU ESP8266
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for NodeMCU ESP8266; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
What's this?Image, role, pros, cons, handling & specifications

Soil Moisture Sensor
A sensor converts a physical condition into an electrical signal the circuit can measure.
What it does hereIt provides project input as an analogue, digital, resistive, frequency, or calibrated signal.
Buy / compare this part ↗Advantages
- Adds real-world awareness
- Can usually be tested independently
- Often supports calibration
Limitations
- Readings can drift
- Placement affects results
- Some sensors need warm-up or calibration
Handling
- Protect the sensing surface
- Observe supply voltage and polarity
- Keep signal leads away from noisy power wiring
Specifications to verify
- Use the exact model, value, package, and rating listed for Soil Moisture Sensor; similar-looking parts are not always interchangeable.
- Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
What's this?Image, role, pros, cons, handling & specifications

DHT11 Sensor
A sensor converts a physical condition into an electrical signal the circuit can measure.
What it does hereIt provides project input as an analogue, digital, resistive, frequency, or calibrated signal.
Buy / compare this part ↗Advantages
- Adds real-world awareness
- Can usually be tested independently
- Often supports calibration
Limitations
- Readings can drift
- Placement affects results
- Some sensors need warm-up or calibration
Handling
- Protect the sensing surface
- Observe supply voltage and polarity
- Keep signal leads away from noisy power wiring
Specifications to verify
- Use the exact model, value, package, and rating listed for DHT11 Sensor; similar-looking parts are not always interchangeable.
- Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
What's this?Image, role, pros, cons, handling & specifications

DS18B20 Waterproof Temperature Sensor Probe
A sensor converts a physical condition into an electrical signal the circuit can measure.
What it does hereIt provides project input as an analogue, digital, resistive, frequency, or calibrated signal.
Buy / compare this part ↗Advantages
- Adds real-world awareness
- Can usually be tested independently
- Often supports calibration
Limitations
- Readings can drift
- Placement affects results
- Some sensors need warm-up or calibration
Handling
- Protect the sensing surface
- Observe supply voltage and polarity
- Keep signal leads away from noisy power wiring
Specifications to verify
- Use the exact model, value, package, and rating listed for DS18B20 Waterproof Temperature Sensor Probe; similar-looking parts are not always interchangeable.
- Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
What's this?Image, role, pros, cons, handling & specifications
MODULE LEARNING VIEWLDR
A sensor converts a physical condition into an electrical signal the circuit can measure.
What it does hereIt provides project input as an analogue, digital, resistive, frequency, or calibrated signal.
Buy / compare this part ↗Advantages
- Adds real-world awareness
- Can usually be tested independently
- Often supports calibration
Limitations
- Readings can drift
- Placement affects results
- Some sensors need warm-up or calibration
Handling
- Protect the sensing surface
- Observe supply voltage and polarity
- Keep signal leads away from noisy power wiring
Specifications to verify
- Use the exact model, value, package, and rating listed for LDR; similar-looking parts are not always interchangeable.
- Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
What's this?Image, role, pros, cons, handling & specifications
PART LEARNING VIEWSubmersible Mini Water Pump
An output component turns an electrical control signal into light, sound, motion, switching, or displayed information.
What it does hereIt presents the circuit result or acts on the physical world.
Buy / compare this part ↗Advantages
- Makes system state visible
- Can be tested separately
- Supports clear troubleshooting
Limitations
- Loads may exceed controller current
- Polarity or driver direction can matter
- Inductive loads create voltage spikes
Handling
- Use the documented driver stage
- Check polarity and load current
- Add flyback protection for inductive loads
Specifications to verify
- Use the exact model, value, package, and rating listed for Submersible Mini Water Pump; similar-looking parts are not always interchangeable.
- Confirm voltage, current, polarity, interface, driver requirements, and duty cycle.
What's this?Image, role, pros, cons, handling & specifications

V LED Strip
An output component turns an electrical control signal into light, sound, motion, switching, or displayed information.
What it does hereIt presents the circuit result or acts on the physical world.
Buy / compare this part ↗Advantages
- Makes system state visible
- Can be tested separately
- Supports clear troubleshooting
Limitations
- Loads may exceed controller current
- Polarity or driver direction can matter
- Inductive loads create voltage spikes
Handling
- Use the documented driver stage
- Check polarity and load current
- Add flyback protection for inductive loads
Specifications to verify
- Use the exact model, value, package, and rating listed for V LED Strip; similar-looking parts are not always interchangeable.
- Confirm voltage, current, polarity, interface, driver requirements, and duty cycle.
What's this?Image, role, pros, cons, handling & specifications

×TIP122 Transistor
A semiconductor stage performs switching, amplification, regulation, rectification, or logic.
What it does hereIt controls current or signal flow at a defined point in the circuit.
Buy / compare this part ↗Advantages
- Fast and efficient
- Compact
- Can control larger loads from smaller signals
Limitations
- Pin order varies
- Sensitive to overvoltage and reverse polarity
- May need cooling or bias components
Handling
- Verify the datasheet pinout
- Avoid static and soldering heat
- Check notch, stripe, or flat-face orientation
Specifications to verify
- Use the exact model, value, package, and rating listed for ×TIP122 Transistor; similar-looking parts are not always interchangeable.
- Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
What's this?Image, role, pros, cons, handling & specifications
PASSIVE LEARNING VIEWResistor (4.7K, 10K)
A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.
What it does hereIts exact value and tolerance determine how the surrounding stage behaves.
Buy / compare this part ↗Advantages
- Simple and dependable
- Low cost
- Easy to measure before installation
Limitations
- A wrong value can stop or damage the circuit
- Ratings must not be exceeded
- Polarized parts require correct orientation
Handling
- Measure unclear values
- Observe capacitor polarity
- Avoid overheating leads while soldering
Specifications to verify
- Use the exact model, value, package, and rating listed for Resistor (4.7K, 10K); similar-looking parts are not always interchangeable.
- Confirm value, tolerance, power or voltage rating, polarity, and package size.
What's this?Image, role, pros, cons, handling & specifications
PASSIVE LEARNING VIEWCapacitor (0.1µF, 10 µF)
A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.
What it does hereIts exact value and tolerance determine how the surrounding stage behaves.
Buy / compare this part ↗Advantages
- Simple and dependable
- Low cost
- Easy to measure before installation
Limitations
- A wrong value can stop or damage the circuit
- Ratings must not be exceeded
- Polarized parts require correct orientation
Handling
- Measure unclear values
- Observe capacitor polarity
- Avoid overheating leads while soldering
Specifications to verify
- Use the exact model, value, package, and rating listed for Capacitor (0.1µF, 10 µF); similar-looking parts are not always interchangeable.
- Confirm value, tolerance, power or voltage rating, polarity, and package size.
What's this?Image, role, pros, cons, handling & specifications

Online Services
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Online Services; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Adafruit IO
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Adafruit IO; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Smart Agriculture System Circuit Diagram
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Smart Agriculture System Circuit Diagram; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Adafruit IO Setup
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Adafruit IO Setup; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

"Action," and then click on "Create a New Dashboard."
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for "Action," and then click on "Create a New Dashboard."; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

"Create New Block."
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for "Create New Block."; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Humidity, Soil Temperature, and Moisture Value. Finally, we'll add two
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Humidity, Soil Temperature, and Moisture Value. Finally, we'll add two; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications
MODULE LEARNING VIEWSmart Agriculture System NodeMCU Programming
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for Smart Agriculture System NodeMCU Programming; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
What's this?Image, role, pros, cons, handling & specifications

most important parts. The code uses libraries called DHT.h, OneWire
A sensor converts a physical condition into an electrical signal the circuit can measure.
What it does hereIt provides project input as an analogue, digital, resistive, frequency, or calibrated signal.
Buy / compare this part ↗Advantages
- Adds real-world awareness
- Can usually be tested independently
- Often supports calibration
Limitations
- Readings can drift
- Placement affects results
- Some sensors need warm-up or calibration
Handling
- Protect the sensing surface
- Observe supply voltage and polarity
- Keep signal leads away from noisy power wiring
Specifications to verify
- Use the exact model, value, package, and rating listed for most important parts. The code uses libraries called DHT.h, OneWire; similar-looking parts are not always interchangeable.
- Confirm supply range, output type, measurement range, accuracy, response time, and pin order.
What's this?Image, role, pros, cons, handling & specifications

Adafruit MQTT, ArduinoJson, and DallasTemperature. You can download
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Adafruit MQTT, ArduinoJson, and DallasTemperature. You can download; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Temperature, Humidity, and Moisture, one feed to show weather
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Temperature, Humidity, and Moisture, one feed to show weather; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications
POWER LEARNING VIEW7805 - integrated circuit
A power component supplies, converts, stores, or regulates energy for the project.
What it does hereIt must provide the documented voltage, polarity, isolation, and sufficient current safely.
Buy / compare this part ↗Advantages
- Stable power improves reliability
- Current limiting protects first tests
- Regulation reduces resets and noise
Limitations
- Wrong polarity can cause immediate damage
- Underrated parts overheat
- Mains circuits require qualified supervision
Handling
- Measure output before connection
- Use a fuse or current limit
- Insulate exposed conductors
Specifications to verify
- Use the exact model, value, package, and rating listed for 7805 - integrated circuit; similar-looking parts are not always interchangeable.
- Confirm input/output voltage, current, polarity, connector, isolation, and thermal rating.
Connect one verified path at a time.
Explore the named components and standardized signal flow, then use Source Check to verify exact physical pins, values, and topology before applying power.
Trace this circuit.
IoT based Smart Agriculture Monitoring System: interactive parts, standardized terminals, responsive anchored wires, student explanations, and the original circuit reference in one shared system.
Trace before wiring
Follow power, ground, inputs, processing, and outputs in that order. Never guess a pin from package shape alone.
Connect with power off
Make short, labelled connections and share a common ground only where the schematic requires it.
Inspect every joint
Check continuity, polarity, adjacent shorts, and loose connections before the first power-up.
Open all source diagrams and build views 3 visuals



Confirm the hardware-only control path.
This project does not include firmware in the source. The circuit itself provides the required behaviour.
How to connect
- Match every controller label to the circuit view and source pin map.
- Join grounds before signal wires when separate low-voltage supplies are used.
- Keep motors, relays, pumps, and other loads on a suitable driver and external supply.
Common mistakes
Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.
Troubleshoot
Disconnect loads, continuity-test one path at a time, then test with a current limit.
Software preparation
No IDE, board package, library, or firmware upload is required for this project.
If you add a programmable controller as an extension, document its pin map separately.
How to upload code
The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.
Assemble, deploy, test, and troubleshoot.
Use the complete source notes in build order, then pass the final checks before calling the project finished.
Build in functional stages
- Power and regulation
- Controller or processing stage
- Inputs and sensors
- Outputs and loads
- Enclosure and strain relief
Power up safely
- Inspect unpowered continuity first
- Apply the lowest safe current limit
- Measure supply rails before signals
- Add one load at a time
- Record expected and actual results
Work from simple to complex
- Confirm power, ground, polarity, and orientation
- Compare each pin with the source
- Test inputs separately from outputs
- Replace only one variable at a time
- Power off before every correction
Follow the documented instructions.
These notes come from this project's source and remain in their original order.
Project overview
Project build noteWe will use IoT to build a Smart Farming System for this project. The goal of this project is to help farmers get Live Data (Temperature, Humidity, Soil Moisture, and Soil Temperature) for better monitoring of the environment, which will help them increase their overall crop yield and product quality. This smart agriculture system is powered by NodeMCU and uses IoT. It has a DHT11 sensor, a moisture sensor, a DS18B20 sensor probe, an LDR, a
water pump, and a 12V led strip. When the IoT-based agriculture monitoring system starts up, it checks the soil's moisture, temperature, humidity, and temperature. It then sends this information to the IoT cloud so it can be watched in real time. If the amount of water in the soil drops below a certain level, the water pump will turn on by itself. We've already made an Automatic Plant Irrigation System that sends alerts to mobile phones but doesn't check any other parameters. Aside from this, building a Smart Agriculture Monitoring System can also be helped by a Rain alarm and a soil moisture detector circuit.
Components Required
Project build noteHardware NodeMCU ESP8266 Soil Moisture Sensor DHT11 Sensor DS18B20 Waterproof Temperature Sensor Probe LDR Submersible Mini Water Pump 12V LED Strip 7805 Voltage Regulator 2×TIP122 Transistor Resistor (4.7K, 10K) Capacitor (0.1µF, 10 µF) Online Services Adafruit IO Smart Agriculture System Circuit Diagram
This circuit isn't very difficult. Here, we used one 12V LED Strip, a 12V water pump, a 7805-voltage regulator, and two TP122 transistors to control the LED Strip and the water pump. From the 12V adapter, the 7805 is used to get regulated 5V, and the DHT11 sensor is used to read the temperature and humidity. The DS18B20 sensor probe is used to find out the soil's temperature, and a soil moisture sensor is used to find out how wet the soil is, so that the water pump can automatically turn on and off. Adafruit IO Setup Adafruit IO is an open data platform that lets you collect, visualize, and analyze live data in the cloud. With Adafruit IO, you can upload, display, and monitor your data over the internet, making your project compatible with the Internet of Things. With Adafruit IO, you can control motors, read sensor data, and make cool IoT apps that run over the internet. You have to make an account on Adafruit IO before you can use it. To do this, go to the Adafruit IO website and click on "Get started for free" at the top right of the screen.
When you're done setting up your account, log in and click "View AIO Key" in the top right corner to see your account username and AIO key. When you click on "AIO Key," a window will appear with your username and Adafruit IO AIO Key. Copy this password and key. In your code, you'll need it later. Now that you've done that, you need to make a feed. Click on "Feed" to make a feed. Then click "Actions." You will see a list of options. Click "Create a New Feed" from that list. After that, a new window will pop up where you need to type in the Name and Description of your feed. You don't have to write a description. When you click on "Create," you will be taken to your newly made feed. We made a total of eight feeds for this project, including ones for the water pump, the LED strip, the moisture data, the temperature, the humidity, the weather data, and the soil temperature. To make the rest of the feeds, use the same steps as above. After making feeds, we'll make an Adafruit IO dashboard to show all of these feeds on one page. Make a dashboard first, and then add all of these feeds to that dashboard. To make a dashboard, click on the Dashboard option, then click on "Action," and then click on "Create a New Dashboard."
In the next window, give your dashboard a name and click the "Create" button. Now that our dashboard is set up, we'll add our Blocks to it. To add a Block, click the "Gear" in the upper right corner and then click "Create New Block." First, we'll add two toggle buttons blocks to manually turn ON/OFF the LED Strip and Water Pump. Then, we'll add four sliders to show the Temperature, Humidity, Soil Temperature, and Moisture Value. Finally, we'll add two graph blocks to show the Moisture and Soil Temperature Data from the last 30 days. Click on the Toggle block to add a button to the dashboard. How to Get OpenWeatherMap's API As we've already said, we'll also show weather forecasts on the Adafruit IO dashboard. To do this, we'll use the OpenWeatherMap API to ask for the day's weather forecast for a specific location. OpenWeatherMap offers well- known weather products that make it much easier to work with weather data. This data can be accessed through fast, reliable APIs that are in line with industry standards and work with a variety of enterprise systems. OpenWeatherMap has both paid and free plans. For this project, we will use the free plan to find out what the weather is going to be like. Now, to get the API key, you have to sign up on their platform. To do this, first make an account, and once that's done, you'll be taken to the dashboard, as shown below. You can get information from the site by clicking on your name and then on "My API Keys." This will give you a unique API key. Smart Agriculture System NodeMCU Programming
At the end of the document, you can find the full code for the IoT-based Agriculture Monitoring System. Here, we'll talk about some of the code's most important parts. The code uses libraries called DHT.h, OneWire, Adafruit MQTT, ArduinoJson, and DallasTemperature. You can download Adafruit MQTT.h and DHT11.h, and the rest of the libraries can be downloaded directly from the Arduino IDE library manager. After you've added the libraries to the Arduino IDE, you can start the code by including the files for the libraries. Then, enter the Wi-Fi and Adafruit IO passwords that you copied from the Adafruit IO server. The MQTT server, port number, user name, and AIO key will be among these. Then set up the Adafruit IO feeds so that the sensor data can be stored and the LED and water pump can be controlled. In my case, I've set up four feeds to store different sensor data: Soil Temperature, Temperature, Humidity, and Moisture, one feed to show weather data, and two feeds to control an LED strip and a water pump.
How to Read the Weather Report
Project build noteWe will use the code snippets we made with ArduinoJson Assistant to read the weather forecast data from the OpenWeatherMap API. Here in the void loop, we'll only call the API after a certain amount of time has passed, so we don't go over our daily limit.
How to Read Sensor Data
Project build noteNow that we have the weather information, we will read all of the sensor information. We're using the DHT11, DS18B20, LDR, and Soil Moisture Sensor in this project. The data from the LDR and the soil moisture sensor will be used to automate the LED strip and the water pump. So, first we will check the status of the LDR, and if the LDR reading is less than 200, the
LED will turn on by itself. In the same way, if the percentage of water in the soil is less than 35, the water pump will turn on. I grew seeds in a plastic tray, as shown in the picture below, to test this project. I put the hardware box next to the tray, hooked up a water pump to a bottle of water, and hooked up the power supply. After this is done, it starts to keep an eye on things like the soil's moisture, temperature, etc. All of these will be posted on the Adafruit IO dashboard. So, this is how you can set up a smart agriculture system based on the Internet of Things. You can also measure things like PH, etc., in addition to these parameters. I hope the project was fun and that you learned something from it.
You built IoT based Smart Agriculture Monitoring System.
You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.
Browse all 500 projects