Introduction: Make a Robot Cleaner

In my class in Making The Future we have a table on which we can write with erasable markers, we all write on this table all the time. So I had the idea of making a robot capable of cleaning this table on its own on this table. So I did it. (many things taken from this tutorial)

Equipment:

  • 1 Arduino Uno
  • 1 Brand board
  • 2 Toy motor 1 L293D
  • 1 hc-sr04
  • 2 6F22 9V battery
  • A lot of wires
  • 2 Wheel
  • 1 Bovine Wheel
  • 1 whiteboard eraser

Step 1: ​Step 1

Step 1

We can therefore start to create the circuit, if your toy motor have no wire on it you will have to solder it. To create the circuit I let you look at the thumbnail above. On peut donc commencer à créer le circuit, si vos toy motor n'ont pas fil dessus il faudra que vous le soudier. Pour créer le circuit je vous laisse regarder les vignette ci dessus.

Step 2: Step 2 : Code

Step 2

Once the circuit is finished, we can start to make the code. This code should allow that if the sensor detects something less than 5 centimeters the robot advances normally but if the sensor detects more than the robot moves back that allows it not to drop it from a table for example. For the first part, the two motors must go in the same direction and the second part must reverse and the other must continue in the same direction. Do not copy paste the above code: Une fois le circuit terminé, nous pouvons commencer à faire le code. Ce code doit permettre que si le capteur détecte quelque chose inférieure à 5 centimètres le robot avance normalement mais si le capteur détecte plus alors le robot recule cela lui permet de ne pas le faire tomber d'une table par exemple. Pour la première partie, les deux moteurs doivent aller dans le même sens et la deuxième partie doit reculer et l'autre doit continuer dans la même direction.

Ne copiez pas collez le code ci-dessus:

Code :

const int trig = 12;

const int echo = 11;

const int leftForward = 2;

const int leftBackward = 3;

const int rightForward = 4;

const int rightBackward = 5;

int duration = 0;

int distance = 0;

void setup() {

pinMode(trig , OUTPUT);

pinMode(echo , INPUT);

pinMode(leftForward , OUTPUT);

pinMode(leftBackward , OUTPUT);

pinMode(rightForward , OUTPUT);

pinMode(rightBackward , OUTPUT);

Serial.begin(9600);

}

void loop() {

digitalWrite(trig , HIGH);

delayMicroseconds(1000);

digitalWrite(trig , LOW);

duration = pulseIn(echo , HIGH);

distance = (duration/2) / 28.5 ;

Serial.println(distance);

if ( distance >5 )

{

digitalWrite(leftForward , HIGH);

digitalWrite(leftBackward , LOW );

digitalWrite(rightForward , LOW);

digitalWrite(rightBackward , HIGH);

delay(1000);

}

else { digitalWrite(leftForward , LOW);

digitalWrite(leftBackward , HIGH);

digitalWrite(rightForward , HIGH);

digitalWrite(rightBackward , LOW);

}

}

Step 3: Step 3 :

Once you have verified that the code works well and that the circuit works well, then you must think of creating a support for the robot personally, I chose to make a box. I use Boxe.py for the dimensions of the box then once the box is created, I use Affinity Designer to cut all the notches of the components that we need to exit like the hc-sr04 sensor, the two motors and the wheel bovine. And to cut it with the laser I use the LightBurn software.

Une fois que vous avez vérifié que le code marche bien et que le circuit fonctionne bien, alors vous devez penser à créer un support pour le robot personnellement, j'ai choisi de faire une boîte. J'utilise Boxe.py pour les dimension de la boite puis une fois la boîte créée, j'utilise Affinity Designer pour couper toutes les encoches des composants dont nous avons besoin pour sortir comme le capteur hc-sr04, le deux moteurs et la roue bovine. Et pour le découper au laser j’utilise le logiciel LightBurn.

To install everything in the box you can use hot glue, it will not damage your component.

Step 4: Step 4 :

Now that the robot is finished you can clean the table with the eraser.