输入你的兴趣与活动经历,AI 一键生成专属的硬件产品概念图、技术路线与落地清单
从左侧拖拽模块到画布,点击引脚圆点连线,线随模块实时移动。
# main.py -- Greenhouse Irrigation Robot import RPi.GPIO as GPIO import smbus2 import time import cv2 from sensor import MoistureSensor from motor import MotorCtrl # GPIO pin definitions VALVE_PIN = 22 # relay controlling solenoid valve MOTOR_IN1 = 17 # motor direction pin 1 MOTOR_IN2 = 27 # motor direction pin 2 MOTOR_PWM = 18 # motor speed (PWM) THRESHOLD = 40 # soil moisture threshold (%) # Initialize GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(VALVE_PIN, GPIO.OUT) GPIO.setup(MOTOR_IN1, GPIO.OUT) GPIO.setup(MOTOR_IN2, GPIO.OUT) # Instantiate drivers sensor = MoistureSensor(channel=0) motor = MotorCtrl(MOTOR_IN1, MOTOR_IN2, MOTOR_PWM) def irrigate(duration=2.0): """Open solenoid valve for given seconds.""" GPIO.output(VALVE_PIN, GPIO.HIGH) time.sleep(duration) GPIO.output(VALVE_PIN, GPIO.LOW) def detect_row(frame): """Detect crop row center offset using HSV masking.""" hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) mask = cv2.inRange(hsv, (35, 50, 50), (85, 255, 255)) M = cv2.moments(mask) if M["m00"] == 0: return 0 cx = int(M["m10"] / M["m00"]) return cx - frame.shape[1] // 2 def patrol_loop(): """Main patrol loop: navigate rows and irrigate as needed.""" cam = cv2.VideoCapture(0) pwm = GPIO.PWM(MOTOR_PWM, 1000) pwm.start(60) while True: ret, frame = cam.read() if not ret: break # Visual navigation: steer toward row center offset = detect_row(frame) motor.steer(offset) # Read soil moisture and irrigate if below threshold moisture = sensor.read_pct() if moisture < THRESHOLD: irrigate(duration=3.0) time.sleep(0.5) cam.release() pwm.stop() if __name__ == "__main__": try: patrol_loop() except KeyboardInterrupt: print("Stopped by user") finally: GPIO.cleanup()
树莓派 + 摄像头 + CNN 模型,识别皮肤良恶性病变,封装为便携检测仪原型。适配 ISEF 医学类赛道。
Arduino + PM2.5/CO₂ 传感器节点网络,数据上传 Web 平台展示热力图,软硬双产出。
React Native 开发,集成用药提醒、AI 辅助问答,联系养老院做用户测试,公益属性强。
TCGA 数据集 + Random Forest + PCA,癌症亚型分类,适合发表高中生科研期刊。
超声波测距 + 触觉振动反馈,ESP32 主控,实时感知前方障碍物并通过振动提醒方向。
摄像头识别食物剩余量,统计浪费趋势,联系学校食堂真实部署,数据支撑论文写作。
从兴趣出发,AI 为你匹配最具竞争力的项目方向,并一键生成完整落地方案。