Skip to content

Project 4.1.47: Agriculture Environment Convergence System

Overview

Build and prototype an agriculture environment convergence system using the Raspberry Pi Pico 2 W and MicroPython.

This expert project is designed as an open-ended research and prototype challenge. Learners should use the concept, suggested components, and starter code as a guide, then conduct further research, improve the design, and build a working prototype.

The final result should demonstrate a working embedded system prototype with clear documentation, testing evidence, and a short presentation of design decisions.

Required Components

Pico 2 W
Raspberry Pi Pico 2 W
Breadboard
Breadboard
Jumper Wires
Jumper wires

Components

Circuit Connections

Component Pin Connects To Pico GPIO / Physical Pin Number Notes
Sensor Power 3.3V Physical Pin 36 Use 3.3V-compatible modules
Sensor GND GND Physical Pin 38 Use a common ground for low-voltage modules
Signal Pins Selected GPIO Pins As defined in your design Document your selected pin numbers
Actuators Driver/Relay Module GPIO Control Pin Do not power actuator directly from GPIO

Step-by-Step Assembly

Step 1: Plan the System Architecture

Plan the complete system architecture and identify each subsystem that will be included in the project.


Step 2: Wire One Input Sensor First

Connect and test a single input sensor before adding additional hardware.


Step 3: Add Output or Actuator Modules

Add output devices, relay modules, or actuator systems one at a time and verify proper operation.


Step 4: Verify Power Connections

Check all 3.3V and GND connections carefully before powering the system.


Step 5: Document Final Design Choices

Record the final GPIO assignments, subsystem layout, and any design changes made during development.


Testing Individual Components

Before running the full project, test each subsystem separately. This makes it easier to find wiring, code, or logic problems.

  • Test each sensor reading in the Thonny Shell.
  • Test each actuator using a safe low-power test.
  • Verify communication between system layers.
  • Record results and adjust the prototype before final integration.

Full Project Code

After completing and checking the circuit connections, open Thonny IDE, copy and paste this code into a new file or upload the project file to the Raspberry Pi Pico 2 W, then run it from Thonny.


# Starter code placeholder

from machine import Pin
import time

print("Expert project ready")

while True:
    # Add your system logic here
    time.sleep(1)

How the Code Works

Code Section What It Does Why It Matters
Pin setup Creates input and output objects The Pico needs to know how each GPIO pin will be used
Main loop Runs the system repeatedly Embedded systems usually monitor and respond continuously

Expected Result

The system should collect data, process it, control the required outputs, and show clear evidence that the prototype solves the intended problem.


Troubleshooting

Problem Possible Cause Solution
No readings appear in Thonny Incorrect wiring, wrong pins, or missing library Recheck the circuit, confirm pin numbers, and test each module separately
Import error appears Library file is missing or saved in the wrong location Check the Pico file structure and save libraries exactly as instructed
Actuator does not respond Relay/driver wiring or external power issue Verify driver input, external power, and shared ground where required
Results are unstable Sensor noise, loose wiring, or poor calibration Secure the wiring and add calibration or averaging in code
Prototype works only sometimes System is too complex to test all at once Return to subsystem testing and integrate one part at a time