Introduction: EAL - Arduino Car DC

Picture of EAL - Arduino Car DC

Dansk:

Her har vi en lille RC bil der kan køre selv efter en hvid streg

English:

Here we have made a small RC car, there can drive by following a white line

Step 1: Arduino Uno

Picture of Arduino Uno

Vi har valgt at bruge en Arduino Uno til projektet da den er rigelig stor til det der skal laves

den kan købes her https://www.amazon.co.uk/Arduino-A000066-UNO/dp/B0...

English:

we have chosen to use an Arduino Uno for this project, the reason we have picked it is that it has more than the inputs and outputs we need.

It can be bought here: https://www.amazon.co.uk/Arduino-A000066-UNO/dp/B0...

Step 2: Bredboard

Picture of Bredboard

I dette projekt har vi valgt at bruge et bredboard til at samle det hele på

du kan købe den på dette link https://www.amazon.co.uk/TRIXES-Electronics-Solder...

English:

In this project chosen to use a breadboard to assemble it all on

it can be bought here:

https://www.amazon.co.uk/HALJIA-TCRT5000-Reflectan...

Step 3: Sensor

Picture of Sensor

vi har valgt 2 sensorer der kan se forskel på om det er hvid eller sort

den kan købes her https://www.amazon.co.uk/HALJIA-TCRT5000-Reflectan...

English:

We have picked 2 sensors that can tell the difference between black and white

they can be bought here:

https://www.amazon.co.uk/HALJIA-TCRT5000-Reflectan...

Step 4: Servo Motor

Picture of Servo Motor

vi har valgt at bruge en servo motor til at styre RC bilen

den kan købes her https://www.amazon.co.uk/Helicopter-Airplane-Contr...

English:

Vi chose to use a servo motor to control the RC car

It can be bought here:

https://www.amazon.co.uk/Helicopter-Airplane-Contr...

Step 5: Bund Til RC Bilen

Picture of Bund Til RC Bilen

Her er vores print til bunden af bilen vi har valgt og tegne det i Inventor 2017 og har så også en STL.

fil man kan hente

English:

Here is the 3d print for the bottom of the car, We chose to create it in Inventor 2017, here is also a STL. File which can be downloaded here

Step 6: Samler Det Hele På Platformen

Picture of Samler Det Hele På Platformen

Her har vi sat delene fast på bunden

English:

Here we have put our parts on the bottom

Step 7: DC Motor

Picture of DC Motor

vi har valgt denne DC motor til at køre bilen

de kan købes her http://www.miniinthebox.com/da/smart-bil-tt-motor-...

https://www.amazon.co.uk/gp/product/B01CICSUIG/ref...

English:

We picked this DC motor to drive the car, here are the links for where they can be bought:

http://www.miniinthebox.com/da/smart-bil-tt-motor-...

https://www.amazon.co.uk/gp/product/B01CICSUIG/ref...

Step 8: Aksel Til Mellem Motorene

Picture of Aksel Til Mellem Motorene

vi fandt ud af at der skulle bruges en aksel til mellem de to DC. motorer for ellers vil de køre alt for asynkront. vi har valgt og tegne det i Inventor 2017 og har så også en STL. fil man kan hente

English:

We found out that there needed to be a shaft between the two DC motors else it would run asynchronously. We created it in Inventor 2017, the STL file is here and can be downloaded.

Step 9: L293D Mikro-chip

Picture of L293D Mikro-chip

vi har valgt at bruge en L293D mikro-chip til at styre de 2 motorer da vi har valgt at køre dem ens har vi valgt at sætte begge motorer på samme side men denne chip kan også køre 2 udgange til motor så den også kan køre ved at den ene bakker og den anden køre frem.

English:

We have picked the L293Dto control the 2 motors, since we chose to run
both motors the same. We have chosen to put the motors on the same side of the chip, the chip can also set one motor to back and the other to go forward.

Step 10: Lednings Diagram

Picture of Lednings Diagram

her har vi tegnet et lednings diagram som viser hvordan vi har forbundet de forskellige komponenter og hvordan de er forbundet

English:

here we have the wire diagram, it shows our set up and how everything is hooked up on our set up.

Step 11: Arduino Code

Picture of Arduino Code

Her har vi koden vi bruger til projektet

English:

here we have the code for the project

#include <br>int track1 = 3; 
int track2 = 4;
int mode ;
Servo servo1;
int motorpin1 = 6;
int motorpin2 = 7;
void setup()
{
  pinMode(track1,INPUT);
  pinMode(track2,INPUT);
  pinMode(motorpin1, OUTPUT);
  pinMode(motorpin2, OUTPUT);
  servo1.attach(8);
  Serial.begin(9600);
  
  
}
 
void loop()
{
  
  
  mode = 0;
  
  if (digitalRead (track1) == LOW && digitalRead (track2) == HIGH)
       mode = 1;
     
 else if (digitalRead (track1) == HIGH && digitalRead (track2) == LOW)  
      mode = 2;
     
 else if(digitalRead (track1) == HIGH && digitalRead (track2) == HIGH)
       mode = 3;
      
       
  Serial.println(mode);
  
switch (mode){
 
      
    case 1:{
        digitalWrite(motorpin2, HIGH);
        digitalWrite(motorpin1, LOW);
        servo1.write(40);
        
      break;
    case 2:
     digitalWrite(motorpin2, HIGH);
            digitalWrite(motorpin1, LOW);
            servo1.write(120);
            
      break;
    case 3 :
     digitalWrite(motorpin2, LOW);
            digitalWrite(motorpin1, LOW);
            servo1.write(80);
            
      break;
         case 0: 
            digitalWrite(motorpin2, HIGH);
            digitalWrite(motorpin1, LOW);
            servo1.write(80);
            
      break;
   
    }
}
}

Step 12: Forbedringer

Picture of Forbedringer

muligheden for forbedringer er da lys sætningen skal være helt i top for at den køre er muligheden for af købe en linesensor der køre lodrat i stedet for vandret så sensoren køre tættere på jorden og den vil derfor regere bedre på den hvide tape ellers skal man have en noget mindre forhjul

English:

there is
somethings that could be made better or at least make things easier, since the lighting has to be just right for the car to drive, this could be fixed with a vertical sensor that gets closer to the ground. It could also be fixed with a smaller front wheel so it gets closer to the ground.

Comments

Swansong (author)2017-05-16

That looks good, thanks for sharing :)

About This Instructable

163views

2favorites

License:

More by stokholm93:EAL - Arduino Car DC
Add instructable to: