Introduction: The Ultimate Floor Cleaning Robot (v2.0)

Around 5 years back I made a Floor Cleaning Robot (CleanSweep) from scratch, which was a hit and a lot of people followed the guide and tried making their own robot. But that design actually had some flaws. So last year I had to make my Engineering Mini Project and I decided to work on the same idea but with some improvements. However, it is quite ironical that even after 3 years of university I worked on the same project that I built when I was in school (lol).

In this instructable, I will present you Version 2.0 of the Floor Cleaning Robot, with some improvements over the previous version. This one is also controlled from a phone app via bluetooth but here I have also added autonomous control (which a lot of people requested). I used 3 ultrasonic sensors- one looks at the front, one looks left and one looks right. A latching switch is used to switch between Autonomous and Manual Mode. The roller at the back was useless so I removed it. The 2 rotating mops at the front obstructed movement so I replaced that with a single fixed mop. Apart from that I also added an LCD display (which is optional) for displaying commands or debugging. I also used lithium-ion batteries instead of a bulky lead acid battery which gives us more capacity and smaller size. We can also control the flow of water for which I used glucose drip infusion mechanism.

In short here are the changes I made compared to the previous version:

  • Added Autonomous Mode
  • Fixed mop instead of rotating ones
  • Removed roller and servo motor
  • Added LCD Display
  • Used Lithium-ion Batteries instead of lead acid
  • Used Arduino Nano (cheaper and smaller in size) instead of Uno
  • Added Water Flow Control

I have tried to make the instructions as clear as possible. I hope you find this guide useful.

Also, Subscribe to my YouTube Channel if you haven't.

____________________

Thanks to NextPCB for helping me with this project.

NextPCB is one of the most experienced PCB manufacturers globally. It has specialized in the PCB and assembly industry for over 15 years. Not only could NextPCB provide the most innovative printed circuit boards and assembly technologies in the highest quality standards, the fastest delivery turnaround as fast as 24 hours.

If you have a PCB project, please visit their website and get exciting discounts and coupons!

Only 0$ for 5-10pcs PCB Prototypes: https://www.nextpcb.com/?code=Kumar

Register and get $100 from NextPCB: https://www.nextpcb.com/register?code=Kumar

See more info about PCB Assembly Capabilities: https://www.nextpcb.com/pcb-assembly-services

Supplies

Following are the parts that we will need for this project:

  • Arduino Nano (or any other compatible board) (Buy on Amazon)
  • HC-05 Bluetooth Module (Buy on Amazon)
  • L293D Motor Driver Board (L293 or any other motor driver will also work) (Buy on Amazon)
  • 3x HC-SR04 Ultrasonic Sensors (Buy on Amazon)
  • 3x Clamps for Ultrasonic Sensors (optional)
  • 16x2 LCD Display (Buy on Amazon)
  • Single Channel 5V Relay Module (Buy on Amazon)
  • 2x 100 RPM Geared Motors (or anywhere between 50-500 RPM) (Buy on Amazon)
  • 2x Wheels for Motors (Buy on Amazon)
  • 2x Clamps for Motors (Buy on Amazon)
  • 12V Diaphragm Water Pump (Buy on Amazon)
  • 3x 18650 Lithium-ion Batteries (Sparkfun)
  • 3 Cell Holder or 3x Single Cell Holders (Sparkfun)
  • 7805 Voltage Regulator
  • 1K, 2K, 10K resistors (1 each)
  • Male/Female Headers
  • Screw Terminal
  • Latching Push Button
  • On/Off Switch
  • Perf Board
  • Female to Female Jumper Wires
  • Wire
  • Nuts & Bolts
  • Spinning Mop attachment (found in spin mop & bucket kit) (Buy on Amazon)
  • Vinyl Tubing
  • Glucose Drip Pipe (can be found in medical stores)
  • A Small Water Bottle (as water reservoir)

Apart from this, you will also need some basic tools like Soldering Iron, Drill, Wire Cutter, Screwdriver, Pliers etc.

Step 1: Prepare the Base

We start by preparing the chassis or base of the robot. I used 6mm thickness plywood as the material. I have attached a very basic 2D CAD layout so you can follow that.

First, the plywood was cut using hacksaw. Then I used a flat file to round the two corners at the front. After that I sanded all the corners with some sand paper and finally spray painted the base black.

Step 2: Mount Motors to Base

I used mounting brackets to mount the motors to the base. First, measure and mark where to place the the motors. Don't forget to take wheels into consideration when measuring.

Then drill some holes for the mounting bracket and put them in place with some nuts and bolts. Now attach the motors to the mounting brackets.

Before attaching the motors, solder two wires to both the motors as it will be difficult to solder them later.

Step 3: Attach Wheels

First drill a hole for the motor wires to pass through.

Then attach the wheels to motor by fastening the screw on wheel with the motor shaft.

Step 4: Drill a Hole for Mop & Place Sensor Clamps

Drill a large hole (depending on your mop size) at the front of the robot for placing the mop.

For the sensors, I got these 3D printed clamps. You can make your own or find them on Amazon or any hobby electronics store. They will enable us to install the sensors very easily.

Now drill some holes for the sensor clamps and install them in place with some nuts and bolts. Place the clamps in such a way that one sensor in the middle will face forward and the other two will face left and right at an angle of 45 degress.

Step 5: Circuit Diagram

I have attached the complete circuit diagram with all the parts. You will have to follow it for the next few steps. Have a look at it very carefully. If the above image is not clear, you can download the high quality pdf version from below.

1K and 2K resistors are conneced to Tx pin on arduino to create a voltage divider, since the HC-05 bluetooth module works on 3.3V logic level but arduino would give 5V signals which might damage the bluetooth module.

If you don't want to use an LCD, just don't connect it. The project will still work perfectly without any changes in wiring or code.

The circuit was designed using Fritzing.

Step 6: Circuit Assembly

Get a piece of perf board (zero PCB). To place the arduino first solder some female headers and then connect male headers parallely to each of the female header which corresponds to each pin on arduino. All external components will be connnected to these male headers.

To connect the LCD, again solder some female headers.

Add a screw terminal (to connect power supply from battery), latching switch and voltage regulator to the PCB. Solder some male headers in front of the voltage regulator.

Now add all the resistors as well and connect everything as per the schematic using wires.

Why use an external voltage regulator if arduino already has one in-built? Since we are using a lot of components that need to be powered at 5V (3 ultrasonic sensors, a bluetooth module, a motor driver, a relay, an LCD), powering so many of them using arduino's in-built voltage regulator can overheat and damage it. So, we will be connecting some of the components to an external 5V voltage regulator. However, this is completely optional.


Step 7: Connect All Components to Main Circuit Board

After our main circuit board is complete, now we have to connect all the external components to it.

Start by connecting the bluetooth module, followed by relay board and motor driver. Just follow the schematic.

At last, connect both motors to the motor driver as well.

I placed all the components on the robot base with some hot glue.

Step 8: Connect the Ultrasonic Sensors

Connect all the three ultrasonic sensors to their respective pins using jumper wires, as per the schematic.

Since our sensor clamps are already in place, hot glue the sensors on the clamps.

Step 9: Water Spraying Mechanism

To spray water on the mop, I used a 12V Diaphragm pump with a very simple mechanism. There are two pipes, one is the inlet pipe that will go to the water reservoir and the other one is the outlet pipe which will go to the mop.

For the inlet pipe, I used 8mm thickness tubing.

For the outlet, I used a thinner pipe I got from drip infusion system which is connected to a small flow control valve to control the flow of water. (since we don't want our mop to be drenched with water)

A small 200ml bottle is used as a water reservoir.

Make sure you connect inlet and outlet pipes as per the marking on the water pump.

Step 10: Install the Mechanism on Robot

I used some zip ties to place the water pump on robot base.

For the water bottle, first I drilled a hole for the inlet pipe. Then I hot glued the bottle in place.

I also hot glued the flow control valve at the front.

The outlet pipe should be placed as such that water falls directly on to the mop.

Step 11: Power Supply

For the power supply, I decided to use 3x 18650 Lithium ion batteries, 3000mAh each. This is probably the best option to power our robot since lithium batteries have high energy density so they take up very less space. All the 3 batteries are connected in series so we get roughly 12V which is optimum for our application.

I used 3 single cell holders, hot glued them on a hard board piece and connected them in series since I could not find 3 cell holder.

I connected a switch as well to turn the robot On/Off.

Finally, I connected the supply to the main circuit board.

One thing that you need to take care of is, not to discharge the batteries too much since we are not using a battery management system or any other kind of protection circuit. Also, lithium batteries are dangerous so avoid any short circuits!

To make the robot run longer, you can increase the capacity by adding one more battery system (with 3 batteries in series) in parallel.

Step 12: Attach the Mop to Base

Attach the mop to the robot via the hole that we drilled earlier and with lots of hot glue.

Place the water outlet pipe on the mop such that water falls directly on it.

Step 13: Upload the Code

I have attached the code for this project. You can download it from below.

Before compiling it, you will need to install 2 libraries- one is for the ultrasonic sensors and other for the LCD.

  • So go to Sketch > Include Library > Manage Libraries
  • Under the search bar type 'NewPing'
  • Install the NewPing library by Tim Eckel
  • Similarly search for 'LiquidCrystal'
  • Install the LiquidCrystal library by Arduino (in newer versions of IDE it might be already intalled)

Now, to upload the code, first you will need to remove your arduino from the circuit. Why? Because there should not be anything connected to Rx and Tx wires of Arduino while uploading a code and here we have our bluetooth module connected. So either remove Rx and Tx wires from bluetooth module before uploading or remove the entire arduino from circuit and then upload. After it's done uploading, you can put everything back in place.

Step 14: Configure App

For controlling the robot via a phone, we will be using the Bluetooth Serial Controller app. So first download it from Play Store.

Now we need to configure it such that it works with our robot.

  • First go to Preferences, scroll down
  • Under Orientation, select Potrait
  • You can also turn on White Background if you want
  • Now go to Button > Visibility
  • We need button 2, 5, 6, 7, 10 so keep them checked and uncheck others
  • Now go to Button Size and set size under potrait to 100
  • If you go back, you can see 5 buttons in place, but they're not named yet
  • Go to Button > Name
  • Name Button 2 as Forward, Button 5 as Left, Button 6 as Pump, Button 7 as Right and Button 10 as Back
  • Next, go to Button > Command
  • We need to send a character command when we press a button. Each button has it's own command.

Following are the commands (case sensitive):

  • Button 2 (Forward): 'F'
  • Button 5 (Left): 'L'
  • Button 6 (Pump ON): 'P'
  • Button 7 (Right): 'R'
  • Button 10 (Back): 'B'

We also need to set up Stop Commands. These are commands that are sent when the button in unpressed. If we don't add the stop commands and press the forward button for example, the robot will keep on moving forward and won't stop even after we have released the button.

So under Button > Command > Stop Command, check Button 2, 5, 6, 7, 10

Following are the Stop Commands (case sensitive):

  • Button 2: 'S'
  • Button 5: 'S'
  • Button 6: 'p' (for pump off)
  • Button 7: 'S'
  • Button 10: 'S'

There is one more optional feature that you can add, which is robot speed control. I have already added it in the code. There are 3 speed control options- Low, Medium and Maximum. To add them, first make buttons 13, 14, 15 visible. Then name them as Low, Medium and High respectivetly. Lastly, set their respective commands:

  • Low Speed: '1'
  • Medium Speed: '2'
  • Max Speed: '3'

In the above images you can see how our app looks both with and without speed controls.

Step 15: Testing & Troubleshooting

After everything is done, it's finally time for testing. Turn on your robot and check if the LCD displays 'Welcome' message. If it doesn't, try tuning the trimmer pot or recheck your connections.

On your phone, turn on Bluetooth and search for devices. Pair up with HC-05. Password will usually be '0000' or '1234'.

Now check if on pressing a button on your phone is moving the robot. If it doesn't move, check if the command is displayed on LCD. If the LCD is displaying correctly but there is no movement, that means Arduino is receiving the command correctly. It can then be a problem with your motor driver connections.

If neither does the robot move nor it displays anything on the LCD, then check if your bluetooth module is connected properly. Tx wire on bluetooth module goes to Rx on arduino and vice versa. Also, check if you have set the commands on the app properly (refer Step 14).

Step 16: Conclusion

You can try further improvements to this project by making it WiFi controlled or maybe making the algorithm more intelligent. The algorithm that I used for autonomous mode is very basic and it fails sometimes which makes the robot move in a loop. You can try making some improvements to the code and probably suggest me as well!

One more problem that I faced was when the mop was drenched with water, it would be so heavy that the wheels would slip wouldn't push the robot. This limits us to only moderately wet the mop. We can probably solve this using some higher power motors or larger wheels, or putting more weight on the robot such that there is more traction and it doesn't slip.

I am always in for any questions or tips.

You can comment below or send me an email: saiyamagr@gmail.com

Follow for more.

Thanks for reading! :)

Anything Goes Contest 2021

Participated in the
Anything Goes Contest 2021