競賽 · ArduinoCompetition · Arduino
Arduino 系統工程設計競賽Arduino System Design Contest
參與「Arduino 系統工程設計競賽」,開發具備智慧尋跡、超聲波避障與藍牙控制功能之智慧小車系統。Participated in the Arduino System Engineering Design Contest, developing a smart car system with intelligent line-following, ultrasonic obstacle avoidance, and Bluetooth control.
概述Overview
本專案為大一時期參加「Arduino 系統工程設計競賽」的作品。團隊名稱為「大義智機」,目標是從零開始組裝一台具備自動化巡航能力的自走車。透過整合紅外線感測器與超聲波模組,車輛能精準偵測地面黑線進行尋跡,並在遇到障礙物時自動執行規避動作。This freshman-year project for the Arduino System Engineering Contest involved building a self-driving car from scratch. Named "Da-Yi Smart Machine," the vehicle uses infrared sensors for precision line following and an ultrasonic module for autonomous obstacle avoidance.
這項作品源自一個由老師帶領的自走車學習社群——我們從領取材料、接線組裝到程式除錯一手包辦,最後還實際帶學弟妹一起做。這是我最早一批的嵌入式硬體實作經驗,也讓我在「教中學」的過程中把基礎打得更紮實。It grew out of a teacher-led self-driving-car learning community: we handled everything from collecting parts and wiring to debugging, and later taught the project to underclassmen. It was one of my earliest hands-on embedded-hardware experiences, and teaching it cemented the fundamentals.
硬體架構Hardware
- 主控板Controller
- Arduino UNO
- 驅動模組Motor Driver
- L298N 雙 H 橋直流馬達驅動板L298N dual H-bridge DC motor driver
- 擴展板Shield
- Sensor Shield V5.0
- 感測器Sensors
- 超聲波感測器 (HC-SR04)、紅外線尋跡感測器 ×3Ultrasonic Sensor (HC-SR04), IR Tracking Sensors ×3
- 底盤Chassis
- 四輪驅動底盤、TT 馬達 ×44WD Chassis, TT Motors ×4
- 電源Power
- 18650 鋰電池(供電 L298N,再經 L298N 供電給 Arduino)18650 Li-ion battery (powers the L298N, which in turn powers the Arduino)
軟體功能Software
- 智慧尋跡演算法:利用三個紅外線感測器判斷偏離方向,執行補償轉向,確保車輛維持在黑線上。Smart Tracking: Uses three IR sensors to detect deviation and perform compensatory steering to stay on path.
- 動態避障機制:HC-SR04 超聲波以「發射—接收」往返時間換算距離(距離 = 時間 ÷ 2 ÷ 29.1 cm),一旦前方障礙物 ≤ 10 cm 即啟動避障——先倒退、右偏、直行、再左偏回正道。Dynamic Avoidance: An HC-SR04 derives distance from the ultrasonic round-trip time (distance = time ÷ 2 ÷ 29.1 cm); when an obstacle is within 10 cm, the car reverses, veers right, drives forward, then veers left back onto the path.
- PWM 速度控制:透過
analogWrite精細控制馬達轉速,提升轉彎平順度。PWM Control: UtilizesanalogWritefor fine-tuned motor speed control, enhancing steering smoothness.
成果Results
作品完成後實測時遇到不少狀況——撞牆、尋跡中途突然迴轉、直角彎轉不過去、繞過障礙後回不到正軌。我們把三顆紅外線感測器往中心靠攏,並反覆修改控制邏輯與轉向參數,最終讓自走車能穩定尋跡並順利跨越障礙,完成初賽備審與實體展示。Testing the finished car surfaced plenty of issues — colliding with walls, sudden U-turns mid-track, failing right-angle corners, and not returning to the line after avoiding an obstacle. By moving the three IR sensors closer to the center and repeatedly tuning the control logic and steering parameters, we got it tracking reliably and clearing obstacles, completing the preliminary review and a live demonstration.