vishal soniParth KhannaHarneev KourHarshit ChhapliyalShlok Gupta
Published © MIT

ROS Ranger Mini: Radar & Depth Enabled AMR

An AMR using ROS, Particle Photon for remote or autonomous movement, and Particle Cloud for real-time data storage, and environmental mapping

AdvancedWork in progressOver 2 days542
ROS Ranger Mini: Radar & Depth Enabled AMR

Things used in this project

Hardware components

Photon 2
Particle Photon 2
×1
Raspberry Pi 5
Raspberry Pi 5
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×2
DF Robot Tank Chasis
×1
Usb Camera
×1
Servo
×1
IMX219-83 Stereo Camera
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Robot Operating System
ROS Robot Operating System
Fusion
Autodesk Fusion
MIT App Inventor
MIT App Inventor
VS Code
Microsoft VS Code
Particle Console CL

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Paste, Tub
Solder Paste, Tub
Desoldering Set, Tweezer
Desoldering Set, Tweezer
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Custom parts and enclosures

Fusion Files

Schematics

PHOTON2 - Raspberry HAT

Code

Particle Web IDE CODE

C/C++
//https://docs.particle.io/reference/discontinued/hardware/core-shields/?q=motor
//0a10aced202194944a056838 id
//b648206178aff3a71dcdd8e3f32db6b99dac6d98 token


// -----------------------------------
// Controlling Motors with L293D
// -----------------------------------

// Motor control pins (connected to L293D inputs)
const int INA1 = D2;  // Motor A direction pin 1
const int INA2 = D3;  // Motor A direction pin 2
const int INB1 = D4;  // Motor B direction pin 1
const int INB2 = D5;  // Motor B direction pin 2

void setup()
{
  // Set motor control pins as outputs
  pinMode(INA1, OUTPUT);
  pinMode(INA2, OUTPUT);
  pinMode(INB1, OUTPUT);
  pinMode(INB2, OUTPUT);

  // Register cloud function
  Particle.function("motor", motorControl);
  
  // Start with motors stopped
  stopMotors();
}

void loop()
{
  // Nothing needed here
}

int motorControl(String command) {
  if(command == "forward") {
    forward();
    return 1;
  }
  else if(command == "backward") {
    backward();
    return 2;
  }
  else if(command == "left") {
    left();
    return 3;
  }
  else if(command == "right") {
    right();
    return 4;
  }
  else if(command == "stop") {
    stopMotors();
    return 0;
  }
  else {
    return -1;
  }
}

// Motor control functions
void forward() {
  // Motor A forward
  digitalWrite(INA1, HIGH);
  digitalWrite(INA2, LOW);
  // Motor B forward
  digitalWrite(INB1, HIGH);
  digitalWrite(INB2, LOW);
}

void backward() {
  // Motor A backward
  digitalWrite(INA1, LOW);
  digitalWrite(INA2, HIGH);
  // Motor B backward
  digitalWrite(INB1, LOW);
  digitalWrite(INB2, HIGH);
}

void left() {
  // Motor A backward
  digitalWrite(INA1, LOW);
  digitalWrite(INA2, HIGH);
  // Motor B forward
  digitalWrite(INB1, HIGH);
  digitalWrite(INB2, LOW);
}

void right() {
  // Motor A forward
  digitalWrite(INA1, HIGH);
  digitalWrite(INA2, LOW);
  // Motor B backward
  digitalWrite(INB1, LOW);
  digitalWrite(INB2, HIGH);
}

void stopMotors() {
  // Stop all motors
  digitalWrite(INA1, LOW);
  digitalWrite(INA2, LOW);
  digitalWrite(INB1, LOW);
  digitalWrite(INB2, LOW);
}

Ros repository

Credits

vishal soni
9 projects • 10 followers
Engineer ,Electronic Enthusiast
Parth Khanna
1 project • 2 followers
Harneev Kour
1 project • 3 followers
Harshit Chhapliyal
1 project • 2 followers
Automation and Robotics Engineering || CAD || CAM ||
Shlok Gupta
1 project • 5 followers
Just another developer

Comments