1 / 7
Arduino obstacle avoidng car frame — zdjęcie 1
1 / 7

Arduino obstacle avoidng car frame

Zamów wydruk tego modelu

Obliczymy ostateczną cenę na podstawie wybranego pliku. Sprawdzisz ją i zaakceptujesz przed płatnością.

Zapisane na tym urządzeniu.

you will need an arduino uno an H-bridge 2 motors and an ultrasonic sensor

Ocena
0 / 5
Polubienia
2
Pobrania
33
Wydruki
0
Wyświetlenia
170
Oceny
0

Aktualizacja u źródła:

Informacje o modelu

Źródło
Printables
Kategoria
RC & Robotics
Licencja
Creative Commons — Attribution — Noncommercial

Design Concept

This model is designed for creating a basic Arduino-controlled obstacle-avoiding vehicle. The frame provides a sturdy base for mounting components needed for building a small robotics project.

Purpose

The main use is in educational environments or DIY projects to get hands-on experience with electronics and robotics. It can be easily customized with additional sensors and components to enhance functionality.

Printing Suggestions

To ensure durability, print with PLA or PETG with a high infill density. Use support material as needed for complex geometric parts.

Assembly Instructions

Once printed, begin by attaching the wheels and motors to the main frame. Mount the Arduino and motor driver on the provided platforms, ensuring all electronic components are secure. Wire the components following standard Arduino covered car wiring guides, ensuring the ultrasonic sensor is positioned upwards to detect obstacles correctly.

i used the L298N motor controller, the arduino uno R3, and the standard arduino motors and ulstrasone sensor.

 

if you want the code here it is:

int trigPin = 9; // trig pin of HC-SR04

int echoPin = 10; // Echo pin of HC-SR04

int revleft4 = 4; //REVerse motion of Left motor

int fwdleft5 = 5; //ForWarD motion of Left motor

int revright6 = 6; //REVerse motion of Right motor

int fwdright7 = 7; //ForWarD motion of Right motor

long duration, distance;

void setup() {

  delay(random(500,2000)); // delay for random time

  Serial.begin(9600);

  pinMode(revleft4, OUTPUT); // set Motor pins as output

  pinMode(fwdleft5, OUTPUT);

  pinMode(revright6, OUTPUT);

  pinMode(fwdright7, OUTPUT);

  pinMode(trigPin, OUTPUT); // set trig pin as output

  pinMode(echoPin, INPUT); //set echo pin as input to capture reflected waves

}

void loop() {

  digitalWrite(trigPin, LOW);

  delayMicroseconds(2);

  digitalWrite(trigPin, HIGH); // send waves for 10 us

  delayMicroseconds(10);

  duration = pulseIn(echoPin, HIGH); // receive reflected waves

  distance = duration / 58.2; // convert to distance

  delay(10);

    // If you dont get proper movements of your robot then alter the pin numbers

  if (distance > 19)

  {

    digitalWrite(fwdright7, HIGH); // move forward

    digitalWrite(revright6, LOW);

    digitalWrite(fwdleft5, HIGH);

    digitalWrite(revleft4, LOW);

  }

  if (distance < 18)

  {

    digitalWrite(fwdright7, LOW); //Stop

    digitalWrite(revright6, LOW);

    digitalWrite(fwdleft5, LOW);

    digitalWrite(revleft4, LOW);

    delay(500);

    digitalWrite(fwdright7, LOW); //movebackword

    digitalWrite(revright6, HIGH);

    digitalWrite(fwdleft5, LOW);

    digitalWrite(revleft4, HIGH);

    delay(500);

    digitalWrite(fwdright7, LOW); //Stop

    digitalWrite(revright6, LOW);

    digitalWrite(fwdleft5, LOW);

    digitalWrite(revleft4, LOW);

    delay(100);

    digitalWrite(fwdright7, HIGH);

    digitalWrite(revright6, LOW);

    digitalWrite(revleft4, LOW);

    digitalWrite(fwdleft5, LOW);

    delay(500);

  }

}

Tagi