GithubHelp home page GithubHelp logo

shitan198u / radar-using-arduino-and-python Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 514 KB

This project involves creating a radar system using an ultrasonic sensor, an Arduino, and Python. The Arduino is responsible for controlling the servo motor and collecting distance data using the ultrasonic sensor, while Python is used to visualize the data on a polar plot.

License: MIT License

C++ 35.95% Python 64.05%

radar-using-arduino-and-python's Introduction

Radar System with Ultrasonic Sensor and Arduino

Overview

This project involves creating a radar system using an ultrasonic sensor, an Arduino, and Python. The Arduino is responsible for controlling the servo motor and collecting distance data using the ultrasonic sensor, while Python is used to visualize the data on a polar plot.

Components Required

  • Arduino board
  • Ultrasonic sensor
  • Servo motor
  • Jumper wires
  • Computer with Python installed
  • (Optional) Breadboard for prototyping

Wiring Connections

Arduino UNO Ultrasonic Sensor Servo Motor
(+5V) VCC VCC (Positive +) VCC (Red)
GND GND (Ground -) GND (Black)
D10 Trig Pin -
D9 Echo Pin -
D3 - OUT (Orange)

Wiring Connection Diagram

Wiring Connection Diagram

Radar Plot Diagram

Radar Plot Diagram

Working Circuit

Working Circuit

Arduino Setup

  1. Connect the ultrasonic sensor to the Arduino:

    • Connect the sensor's trigPin to pin 10 on the Arduino.
    • Connect the sensor's echoPin to pin 9 on the Arduino.
  2. Connect the servo motor to the Arduino:

    • Connect the servo's control pin to pin 3 on the Arduino.
  3. Upload the provided Arduino code (arduino_radar.ino) to the Arduino board.

Python Setup

  1. Install required Python libraries:

    pip install pyserial matplotlib numpy
  2. Copy the Python script (radar_plot.py) to your computer.

Usage

  1. Run the Python script (radar_plot.py):

    python radar_plot.py
  2. The script will automatically detect the Arduino port, open a serial connection, and start plotting the radar data in real-time.

  3. The servo motor will rotate from 15 to 165 degrees, and the corresponding distance measurements will be plotted on the polar plot.

  4. The plot will continuously update as new data is received from the Arduino.

Customization

  • You can modify the Arduino code to adjust the servo motor's rotation range, delay, or any other parameters based on your requirements.

  • The Python script can be customized for different plot styles, colors, or additional features.

Troubleshooting

  • Ensure that the Arduino is properly connected, and the COM port is accessible.

  • Check that the Python script has the necessary permissions to access the serial port.

  • Verify that the required Python libraries are installed.

Notes

  • This project provides a simple demonstration of creating a radar-like visualization using affordable components. Feel free to expand and enhance it based on your creativity and requirements.

radar-using-arduino-and-python's People

Contributors

shitan198u avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.