The Janitor 2.0 is the ultimate cleaning robot that acts in every way as a school Janitor! He complains a lot when he needs to start working, tries to delay the job as much as he can, and when it finally starts, he stops every 5 seconds to tell unfunny jokes. Unpleasant and annoying, as we like!
- It behaves like a janitor!
- It keeps complaining and it is not in the mood to start its job.
- When it starts cleaning, then it makes bad jokes.
The 3D model was developed using the software Fusion 360 and then the slicing was done with Cura. The model has been printed at the Bitz unibz fablab.
- The tool Fritzing was used for prototyping.
- Instead of the button a potentiometer has been used. This made it easier to attach it to the lid and use long cables.
- There are two 360° Servomotors in order to implement the movements of the robot.
- The jokes that the robot says have been found on different websites.
- And with an AI on Internet, the voice was generated.
- The DFPlayer Mini library allowed to play and control MP3 files. Those are taken from the SD card.
Have a look at the complete code here!
void loop() {
//the robot is off, waiting for the user to turn it on
while(working == 0) {
if(robotIsWorking()==true)
working = 1;
}
//the robot is on, and it will start "cleaning"
Serial.println("Robot is working");
execute();
}
This loop is where the robot is activated by the user. A person has to press the button on top of the robot. Sometimes this take multiples trials and the robot might even complain in the meanwhile.
void execute() {
powerMotorRandom();
delay(3000);
stopMotor();
myDFPlayer.play(random(3,11));
delay(12000);
myDFPlayer.pause();
delay(800);
}
execute is the function responsible for what the robot does once it is on:
- the robot moves randomly for three seconds. There are four possible movements;
- it stops for twelve seconds to say a joke;
- and it repeat forever.