AI-Powered Arduino Radar Tracker

by Latife Kaya in Circuits > Arduino

44 Views, 0 Favorites, 0 Comments

AI-Powered Arduino Radar Tracker

IMG_3936.jpg

This project combines Arduino, an ultrasonic sensor, servo motors, and AI-powered image recognition to create a 2D radar tracking system. It detects a 3D-printed model airplane and records its distance, simulating how smart sensing systems in self-driving cars, drones, or robotics work. The AI model is trained using Teachable Machine and runs in a browser to classify real-time webcam input.

Supplies

Webcam (for AI image input).jpg
Arduino_Uno_-_R3.jpg
Breadboard.jpg
Jumper Wires.jpg
Servo Motor.jpg
USB Cable (for Arduino connection).jpeg
  1. 1x Arduino Uno
  2. 2x Servo Motors
  3. 1x Ultrasonic Distance Sensor
  4. 1x LED (any color)
  5. Breadboard
  6. Jumper Wires
  7. USB Cable (for Arduino connection)
  8. Webcam (for AI image input)
  9. 3D-printed model airplane (or an image/model for detection)
  10. Computer with Google Chrome browser
  11. Tinkercad account (for simulation and modeling)
  12. Teachable Machine account (for AI model creation)
  13. Basic HTML/JavaScript editor (e.g. Visual Studio Code, Notepad++)

Design the Target Object

  1. Open Tinkercad.
  2. Create a new 3D design.
  3. Use basic shapes to model a small airplane (wings, fuselage, tail).
  4. Export your 3D design as an STL file and 3D print it.
  5. If you don’t have a printer, simulate it on screen for detection testing.


Downloads

Scan -r Tinkercad Circuit Design.png

Simulate the Circuit in Tinkercad

  1. Go to the Circuits section of Tinkercad.
  2. Place an Arduino Uno on the workspace.
  3. Add two servo motors:
  4. Connect signal pins to pins 6 and 3.
  5. Connect VCC to 5V and GND to GND.
  6. Add the ultrasonic sensor:
  7. Trig → Pin 5
  8. Echo → Pin 4
  9. VCC → 5V
  10. GND → GND
  11. Add an LED:
  12. Long leg to digital pin 2 through a 220Ω resistor
  13. Short leg to GND
  14. Simulate the setup to test connections.


Train the AI Image Classifier

  1. Visit Teachable Machine.
  2. Select Image ProjectStandard Image Model.
  3. Create two classes: "Plane" and "Not Plane".
  4. Use your webcam to record samples for both classes:
  5. Show your airplane model in various lighting and angles for "Plane"
  6. Show backgrounds or hands for "Not Plane"
  7. Train the model and test it.
  8. Export the model → Choose “TensorFlow.js” format → Download the entire model folder (including model.json and metadata.json).


Build the Physical Circuit

  1. Place your Arduino Uno on a breadboard.
  2. Connect:
  3. Servo 1 (horizontal): Signal to pin 6
  4. Servo 2 (vertical): Signal to pin 3
  5. Ultrasonic sensor: Trig to pin 5, Echo to pin 4
  6. LED: Positive leg to pin 2 with resistor, negative leg to GND
  7. Use jumper wires and make sure all components are powered from the Arduino.


Upload the Arduino Code

  1. Open Arduino IDE.
  2. Paste the provided Arduino code.
  3. Verify and upload the sketch to your Arduino board.
  4. This code:
  5. Listens for direction commands from the browser
  6. Moves servos accordingly
  7. Measures distance with the ultrasonic sensor
  8. Adjusts LED brightness based on proximity


Set Up the Web Interface (HTML + JS)

  1. Open a code editor (e.g., VS Code).
  2. Create a file named index.html.
  3. Paste the full HTML and JavaScript code provided.
  4. Place the downloaded AI model folder (my_model) in the same directory as your HTML file.
  5. Open the HTML file in a Google Chrome browser.


Run the Full System

  1. Plug in your Arduino via USB.
  2. Click the “Start Tracking” button on your HTML page.
  3. Grant camera and serial port access.
  4. The webcam starts detecting.
  5. If the object is recognized as a Plane, the LED turns on and the system reads distance.
  6. If no plane is found for 2+ seconds, the servo motors move automatically in a search pattern.