DIY Vacuum Robot

102,723

634

162

About: I studied Digital Systems and Robotics Engineering. Currently I'm working as a Software Engineer. I love to do special projects on my spare time. After being waiting for the chance to buy a 3d printer I fina...

This is my first Vacuum Robot, which it's main purpose is to allow anyone to have a cleaning robot without paying so much money, to learn how they work, to build a nice robot that you can modify, update and program as much as you want, and of course to vacuum all that annoying fluff.

This project is intended to be as easy to build as possible since all the elements and parts are easy to find on Digikey, eBay, Amazon, etc.

The whole chassis was designed in Solidworks so that it could be 3d printed.

Currently it uses an Arduino Uno (if you don't like it too much you can easily change it for another micro controller, I decided to use this since my objective is that anyone could actually build it), micro-metal motors, fan propeller, infrared sensors and respective driver modules.

Another one bites the dust!

Step 1: Materials

So, first I will define all the materials that I used and later I will suggest other options with a similar behavior.

Controllers:

  • 1 x Arduino Uno Board (or similar) (DigiKey)
  • 1 x IRF520 MOS FET Driver Module (Aliexpress)
  • 1 x H-bridge L298 Dual Motor Driver (Aliexpress)

Actuators:

  • 2 x Micro Metal Gearmotor HP 6V 298:1 (DigiKey)
  • 1 x Micro Metal Gearmotor Bracket Pair (Pololu)
  • 1 x Wheel 42×19mm Pair (DigiKey)
  • 1 x Fan Blower AVC BA10033B12G 12V or similar (BCB1012UH Neato's motor) (Ebay, NeatoOption)

Sensors:

  • 2 x Sharp Distance Sensor GP2Y0A41SK0F (4 - 30cm) (DigiKey)

Power:

  • 1 x ZIPPY Compact 1300mAh 3S 25C Lipo Pack (HobbyKing)
  • 1 x LiPo Battery Charger 3s (Amazon-Charger)
  • 1 x 1k Ohm resistor
  • 1 x 2k Ohm small potentiometer

3d Printing:

  • 3D printer with a minimum printing size of 21 L x 21 W cm .
  • PLA Fillament or similar.
  • If you don't have, you can print your file on 3DHubs.

Other materials:

  • 20 x M3 bolts with (3mm diameter)
  • 20 x M3 nuts
  • 2 x #8-32 x 2 IN bolts with nuts and washer.
  • 1 x Vaccum bag filter (cloth type)
  • 1 x Ball Caster with 3/4″ Plastic or Metal Ball (Pololu)
  • 2 pushbuttons (Aliexpress)
  • 1 x On/Off Switch

Tools:

  • Screw driver
  • Soldering Iron
  • Pliers
  • Scissors
  • Cable (3m)

Step 2: How Does It Work?

The majority of the vacuums have a motor with a fan. As the fan blades turn, they force air forward, toward the exhaust port. At the exhaust port it has a filter which prevents the dust particles being thrown away again.

How does a vacuum robot work?

The principle is pretty similar but as you can see in the second picture, the fan motor is at the last step which means that the dust is not driven through it. The air that is being sucked is first filtered and then pushed toward the exhaust port.

The main difference between each of the vacuums is that the robot one has a microcontroller and sensors which let the robot make decisions so that it can vacuum your room autonomously. Most of the vacuum robots nowadays have really nice algorithms built-in, for instance, they can map your room so that they can plan a path and perform a faster cleaning. They also have other features like side brushes, collision detection, return to its charging base, etc.

Step 3: About the Ingredients...

As I said at the beginning, I'm going to explain as much as I can so that anyone can understand, but If you already know the basics, feel free to skip this step.

The Fan

The most important thing of a vacuum is to choose the appropiate fan with a decent CFM (Airflow cubic feet per minute), it is the force of this airflow across a surface that picks up the dirt and moves it to the dust bag or container. Therefore, the more airflow, the better the cleaning ability of the vacuum cleaner [BestVacuum.com]. Most of the big vacuums use more than 60 CFM but since we are using a small battery, we are ok with at least 35 CFM. The AVC fan that I will use has 38 CFM [AVC link] and it actually has a lot of power, but you can use any with the same dimensions (See picture 1).

The Fan Driver

Since we need a way to control whenever the Fan is On or Off, we need a Driver. I will use the MOS-FET IRF520 which basically works as a switch, whenever it receives a signal from the microntroller it will supply the input voltage to the output (Fan).(See picture 2)

The H-Bridge

For the motors we'll need something a bit different from the Fan driver since now we will need to control the direction of each motor. The H-bridge is an array of transistros which allows us to control the current flow, and by controlling that, we will be able to control the motors direction. The L298 is a pretty decent H-bridge that can supply 2A per channel so for our motors it will be perfect! Another example is the L293D but that only gives us 800mA per channel. (The picture 3 depicts the concept of an H-bridge)

Step 4: The Design

The design of the robot was done in SolidWorks, it consists of 8 files.

This step was the most time consuming since all the robot was made from scratch considering the bumper, the container, the filter, etc.

The total size of the robot is 210mm x 210 mm x 80mm.

Step 5: 3d Printing

The design was done so that all the parts could be 3d printed. In case you don't have a 3d printer, you can use the 3DHubs wherever you are.

The robot consist of 12 parts (it takes a some time). It was printed on a Robo3d R1 plus using Blue Gray Colorfabb filament.

My printing settings were:

  • 0.2 mm layer height
  • 1.2 mm shell thickness
  • 30% fill density
  • 215 C printing temperature
  • 70 C bed temperature
  • Support type everywhere
  • Retraction (Very important!!) 50 mm/s 0.7mm
  • Printing Speed 60mm/s

Before doing all the prints I recommend to print the test samples that I attached so you can calibrate and modify the parameters. I took me a lot of time since the prints are big.

Note: Remove all the support filament with caution.

Look for the files here: Thingiverse Files

Step 6: Setting the Sensors Up

For each of the two sensors I soldered cables but in case you have the connector, you can skip this step.

Once we have the sensors support, we will assembly them as it is showed on the picture above using the M3 bolts. It is important to mention that one sensor should be flipped because it will help us when we assembly them.

Step 7: Connecting the Motors and H-bridge

The first objects that are going to be mounted, are the motors. Mount them using their brackets.

Once you have set them, you can start mounting the H-bridge as it is showed. After that, we shall start connecting the motors on the dual terminals. Don't worry about how the motors shall be connected, you can connect them in any polarity and we can modify the direction of the motors with the code. They should look like the last image.Mo

Step 8: Mounting the Ball Caster

The ball caster will help the robot to tilt it to the front so that robot can vacuum much better.

The Pololu Ball Caster has already its bolts but unfortunately they're too large. So, we shall cut them for about 3mm. Use a knife or a saw being really careful.

An image above shows the ideal length of the bolt.

Step 9: The Bumper

So what happens when the infrared sensors can't see the object?

Well I have designed a bumper so that it can detect when it touched a close object.

The first image shows the concept and the way it shall be connected.

Mount the push button pushButtonSupport and connect it to the small cilinder (see pictures).

Once both of the buttons are mounted, you can paste the bumper (use a small amount of glue).

Note: I will only use one of the buttons since one push button got broken :( But it still works really nice!

Step 10: Connecting the Sharp Sensors

In order to supply the Sensors I made a small board which will supply the power for each of the sensors.

Cut a small surface 3x3 cm then mount the connectors as it is showed on the second picture. Do the proper soldering being careful. Once it is done, mark the board so that you can know the polarity. I use by convention that the right side is always voltage.

Connect the Grounds of each of the sensors and also one terminal of the push button to GND, and the Red wires from the sensors to VCC (Right connectors).

Once they are all connected, fix the wires and set them nicely.

Step 11: Voltage Divider

We need a way to monitor the battery voltage because the if the voltage of a LiPo cell is dropped lower than 3.0 it can permanently damaged it. Our battery is a 3S LiPo battery which means that it has 3 cells of 3.7V each.

Since we can't connect the battery voltage directly to the Arduino (because you will kill the board), we should find a way to proportionally get the voltage of the battery within the range of the ADC (Analog Digital Converter).

Cut 12cm of wire (Red, Black and White. Use always white or other color for signals but not black nor red)

The Voltage Divider will help us to reduce the voltage proportionally and thus we can connect it to one of the analog inputs.

For this we will need to Resistors. R1 and R2. I recommend to use one fixed and the other one use as a potentiometer so you can manipulate your circuit and calibrate it carefully.

Use an R2 of 1k Ohms and set the Potentiometer to 1536 ohms. See the theory behind that so that you can probe the voltages (Or you can trust me Wiki Theory). I set my desired output to be Vout = 5V and my input was the battery voltage when it was fully charged = 12.68 V.

Once you have finished the circuit, test it! Use a Voltmeter and verify that the Vout is actually 5V when your battery is fully charged, otherwise adjust the potentiometer. (Don't set it above 5V or you can kill the Arduino!)

Step 12: Get Your Hands Dirty

We are going to start connecting a lot of wires right now so we should be really careful or we can make a short circuit.

The Battery will supply 3 different things:

  1. Motors
  2. Fan
  3. Voltage Divider

And everything will be connected to the MOS-FET board (it is not really ideal but it is a thing to improve)

We will need 2 male to male wires one to supply the motors driver and the other for the connector to the switch.

  • 21.5cm Red wire for the motors driver to the MOS-FET
  • 15 cm Red wire with male connector for the switch to MOS-FET

I had to modify the batterys wires since its connector was really big, so I added two new wires, the positive one is a male connector for safety. (see the battery picture)

  1. First we will connect the fan. Cut the wires 12cm length. We will only use the Yellow and the black wires. Connect the Yellow to the V+ and the Black to the V- as it is showed on the picture.
  2. Then we wiil connect 3 red wires to Vin of the MOS-FET: The one of 21.5cm for the H-bridge, the 15cm one for the switch and the Vin for the voltage divider.
  3. Connect the GNDs: Connect the Ground of the battery and the GND of the voltage divider.

See the notes of the pictures for more help.

Make sure everything is well connected! Hold this connection since we are going to use it later.

Step 13: Keep Connecting (Terminals, Fan and Motor Driver)

We can start connecting everything together.

Mount the Arduino first with its respective bolt.

Then follow the steps showed on the picture. Connect the Corresponding wires to the terminals.

Place the Fan.

And connect the Voltage divider wire signal to the A4 analog input of the Arduino.

Step 14: Connecting the Motors Signal Inputs

We will need 4 wires Male to Female 27cm length because they are to be connected from the Motor Driver to the Arduino pins.

They should be connected to the Arduino inputs 3,5,6 and 9 respectively. (See the pictures for help).

Step 15: Connecting the Sensors to the Microcontroller

Start connecting the sensors as following:

  • Left Sharp sensor to A0
  • Right Sharp sensor to A1
  • Pushbutton to Digital pin 10

Using female to mal jumpers, connect the Mosfet Terminasl "Signal" and "GND" pins. The signal must be connected to the digital pin 12 and the "GND" pin to one of the Grounds on the Arduino. (See the pictures)

Step 16: Almost Done

We will need a switch tu turn our robot on so I attached a male and female connectors so that it could be connected to the battery.

I also wanted to use an indicator LED (optional) connected to the digital pin 13 and GND. See the pictures for help.

Step 17: Assembling the Container

Once you have all the Container parts printed we need to assembly it.

Mark the cloth filter to the dimension of the FilterTap then ad 1mm on each side and cut the rectangle.

Joing the pieces as it is showed on the pictures and put the filter inside the containter.

Step 18: Close It!! and Program It!

Close it carefully and make sure everything fits nicely.

You can charge the robot by just pulling the charging cable and connect it directly to the charger without having to take the battery apart from the robot.

I have uploaded an Arduino Code that you can use, it is pretty simple but it works really nice. Download the Arduino IDE, compile the software and program your robot!.

The code includes:

1.- Battery monitor:

* It is constantly measuring the voltage and if the battery voltage is below the threshold it will turn off all the motors and the LED will start blinking.

* When starting it tries to turn on the Fan and if the battery voltage is below the threshold it won't start.

2.- Collision avoidance:

* It measures the distance from the sensors to an object and when it is close it turns to the opposite side.

* It senses when it is on a corner and turn 180 degrees.

* When the bumper touches it turn right.

3.- Fan control

* Turn on/off the fan

4.- Motor control

* With PWM it moves the motors in both directions.

I encourage anyone who wants to improve this to do it and share so that we can enhance our knowledge!

NOTE:

I have added a test code (VaccumCode_test_Motors_1.0.0) to make sure that the motors are wired correctly. If you run this code and the robot is not moving forward you must swap the motor wires on the L298 Driver.

I have also added a Beta Code for side sensors.(VaccumCode_SideSensorsBeta_1.0.0)

I like this project a lot but unfortunately I can't give support forever so I will let the community share their knowledge.

Cheers!

-César Nieto

Step 19: What's Next?

What about adding encoders to the motors so that you can predict the position of the robot?

Adding more sensors? you can follow edges to ensure a better cleaning

Mapping? Once you have the encoders you can save the objects that the sensors see and create a map!

This is a nice project to start building complex codes and complex navigation algorithms so I encourage you to do it!

Any suggestions?

Updates:

04/10/2017

  • Code updated to use Pololu motor encoders with PD controller
  • Almost all the code was modified to be more easy to understand

19/05/2017

  • Code updated (just some comments were erased)
  • Circuit diagram added
  • A better explanation for the battery was written

Step 20: Contribute

The project is now available on Github where you can share all your improvements:

https://github.com/cesnietor/VacuumRobot

If you like the project you can buy me a coffee. You're awesome!
https://www.buymeacoffee.com/cesnietor

Robotics Contest 2017

Grand Prize in the
Robotics Contest 2017

Design Now: In Motion Contest

Second Prize in the
Design Now: In Motion Contest

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

7 People Made This Project!

Recommendations

  • Growing Beyond Earth Maker Contest

    Growing Beyond Earth Maker Contest
  • Paint Challenge

    Paint Challenge
  • Backyard Contest

    Backyard Contest

162 Discussions

0
None
ashscottv

Question 23 days ago on Step 20

Hello, I was wondering how I would put auto mapping in this robot vacuum, So I guess what I am asking is, 1. The robot starts up. 2. He makes a map. 3. He Vaucmes using that map. 4. He automatically returns to his charging station.

0
None
carlosacs

6 weeks ago

It's a Sega Saturn vaccum cleaner robot!

0
None
Pale_Flyer

2 months ago

You might want to consider changing the battery manager code from "disable the motors, and flash the LED" to using a latching relay. IE you mash a button to close the relay, and boot the system, but when the Arduino kicks on, it holds the relay enabled. https://i.stack.imgur.com/q3h8v.png This way, when the Arduino detects the low power situation, it drops the relay, and the battery stops having any real draw.

0
None
PhilD61

Question 2 months ago

I am having an issue getting power to the arduino in order to switch on the modules. I can get power to one side of both of the modules but that is the furthest it will go and it doesnt reach the arduino. does anyone have any ideas?

0
None
Non rubyT

3 months ago

I tested the "testmotors" Code on my bot, it worked fine
But when I put vaccum2.0 code, my not gets stuck on moving left iteration
I chcked output value of sensors on output window it remains same and doesn't change at all, I have used 10-80 cm analog sensors
For that I changed the sdsharp value by comparing datasheets of both 4-30 CM and 10-80cm
I found if a use the function "return(dist * 2335.8), i shud get the correct distance (confirmed it analytically)
But output value of sensors is not changing at all it says sd1= 7.01 and sd2=8.6
And tried to put my hand near sensors to check any change in distance but nothing happened

What m I doing wrong, pls help?

2 replies
0
None
CandiceC37Non rubyT

Reply 2 months ago

I've been having the same problem with my robot. Motors worked fine with the "testmotors" code but keeps turning left with "vacuum 2.0" code. Could you please let me know if you figured out the issue?

0
None
Non rubyTCandiceC37

Reply 2 months ago

U have to check which loop it is stuck at for that check the program
There are three conditions which make the bot go left
1st if the sensor distance is less than 4.3 for which it turns forward for 100milliseconds then 500 backwards
And 300 left

And next one when bumper hits an object for which it moves backward and then turns left for 300ms
And another which makes it turn for 1000ms
Pls, specify which condition is being fullfilled


Solution-
If 1st then, maybe ur sensors are not working
Of 2nd then, maybe u soldered ur pushbuttons in wrong way, chk on YouTube how to do it
3rd
I m not sure why

0
None
CesNieto

Tip 3 months ago

If you are having troubles with the motors, or the robot is not going straight after starting do the following:
Try swapping the wires of the motor that is going backwards, it is that or it might be that it is receiving a signal from the sensors and is trying to avoid obstacles, then you might need to check the sensor logs on the Terminal.

1 reply
0
None
Non rubyTCesNieto

Reply 3 months ago

Vikasb45 and I, both are working on the same not, pls check my comment
I think something is wrong with our sesnors or with the code we used

0
None
taurimenas01

3 months ago

Hi. Great project! I have recently received AVC blower fan, but I can not find any instructions on how to reverse its rotation? When I turn the fan on, it just blows the air, while as I suppose it should suck the air in. Could you point me out or explain me how did you do that? Thank you!

1 reply
0
None
Non rubyTtaurimenas01

Reply 3 months ago

It does blow air from its outlet, but creates suction inside the bot, vaccum is created inside which sucks the dirt inside from that opening given on the back side of base

0
None
EdCetera72

Question 4 months ago

Hi! Great project!!! But I have one question: There is a capacitor soldered between the poles of the motors. Is this really necessary? If so, what kind of capacitor do I need. Thank you!

1
None
arthuraccioly

Question 4 months ago

Hi CesNieto, everyone, before closing my robot, I've turned it on and realized that it keeps spinning to the right all the time. I wonder if this is the same problem that filou63430 had on this thread, but there's no public answer. Can someone help me? I've uploaded this video on youtube showing the problem:
Btw, if someone lives around NY area, it would be great to work on this project together as my intention is to improve this robot more and more. Thank you!

1 answer
0
None
arthuraccioly

5 months ago

Why you'd do that? He's already providing all the 3D model files.

0
None
iLikeit_

8 months ago

Just an idea if no one has posted yet. For the bumper you could use an ir/led sensor device that gets physically blocked when bumped. They use it on the camera heads in nuclear medicine gamma cameras for safety. You can literally use one finger to press on the cameras detector surface and it moves just enough to block a little red led inside. This stops all motion so no one gets hurt. The surface is spring-loaded, moving maybe 1/8 of an inch. Hope this helps!

0
None
apathan

Question 1 year ago

Particularly this GND wire is burning when i turn the switch on. Please help, urgently.

AA093B5E-0751-463D-BC37-FB31133D2403.jpeg
1 answer
0
None
CesNietoapathan

Answer 1 year ago

Hi. Did you make sure that the Motor Driver has the jumpers connected like the image?