Autonomous Vacuum Cleaner

Hi!

I am an engineering student, novice when it comes to electronics. I know the theories, but the applications made me pull my hair.

Basically, we want to build an autonomous vacuum cleaner.

We have the following:
Arduino Mega
Digital Sensors for obstacle/cliff detection
Vacuum Pump
Continuous Rotation Servos for mobility
IR receivers for home base searching
2200 mAh LiPo 3S for power source

So my questions are:

  1. Is this feasible?
  2. We are planning on regulating the battery source using switching regulators to about 7v for Arduino, 6v for 2 servos, 5v for sensors.

11.1v
BAT +--------+---------+---------+---------+ Vacuum Pump 12v
| | |
SWreg SWreg SWreg
7v 6v 5v
| | |
arduino servos sensors

  1. Is the above diagram enough? We will use LM2575 buck switching regulators. Any better alternative?
  2. Arduino will of course control all the aspects of the robot. How do we turn on/off the vacuum pump using digital pin of the uC? Is the PMF290XN mosfet enough? What resistor value shall we connect to the gate?
  3. I have learned that turning on/off a dc motor will make the source line drop, which will affect the voltage fed into the arduino, resetting it. How do I make up for this?

Any help will be greatly appreciated.

Thanks in advance!

using switching regulators to about 7v for Arduino

The Arduino is a 5V device, no?
Why waste power in the on-board regulator?

  1. Is this feasible?

YES

  1. We are planning on regulating the battery source using switching regulators to about 7v for Arduino, 6v for 2 servos, 5v for sensors.

11.1v
BAT +--------+---------+---------+---------+ Vacuum Pump 12v
| | |
SWreg SWreg SWreg
7v 6v 5v
| | |
arduino servos sensors

OK

  1. Is the above diagram enough? We will use LM2575 buck switching regulators. Any better alternative?

You could regulate to +5V and feed direct to Arduino +5V. You are correct to allow 2v or overhead if you use both regulators.

4.a. Arduino will of course control all the aspects of the robot. How do we turn on/off the vacuum pump using digital pin of the uC? Is the PMF290XN mosfet enough?

Dunno, you kept the vacuum motor a secret so we cant help you.

4.b. What resistor value shall we connect to the gate?

Dont much matter if its just on/off, you actually dont need any resistance. Direct connection is fine, you can use 1k just for safety in case you accidentally "fat probe" something.

  1. I have learned that turning on/off a dc motor will make the source line drop, which will affect the voltage fed into the arduino, resetting it. How do I make up for this?

Thats a sign of poor grounding or poor voltage regulation.

Why not regulate it to 5v?
You could no doubt feed it directly to the Arduino, Sensors and servos.

@ AltairLabs
Vacuum pump still on decision process. The original pump is rated at 12v, and we measured the current consumed at about 150mA. However, the pump seems to be weak to vacuum papers.

@ smeezekitty
we want to isolate servo from arduino source. Since reversing the rotation will eat up much current, as described by several documents. 5v to arduino and sensors is not bad though.

Questions:

  1. We want to charge the LiPo without removing it from the system. Basically, the robot will find its home base and attach itself to the charger when a preset threshold is reached. Can this be done without further circuitry? I mean we connect the charger pins to the LiPo, while the system is sourcing current from that battery at the same time.
  2. Plus the battery monitor. Will this simple solution be enough? Since we are going to power the pump directly from the battery, will this connection give false alarm to the digital pin of the arduino?

Thanks for all your replies! Very much appreciated. :slight_smile:

Any ideas? :slight_smile:

Vacuum pump still on decision process. The original pump is rated at 12v, and we measured the current consumed at about 150mA. However, the pump seems to be weak to vacuum papers.

PMF290XN mosfet should handle 12V motor up to 600mA.

  1. We want to charge the LiPo without removing it from the system.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294864688/5

Basically, the robot will find its home base and attach itself to the charger when a preset threshold is reached. Can this be done without further circuitry? I mean we connect the charger pins to the LiPo, while the system is sourcing current from that battery at the same time

probably better if you dont draw battery current while charging. in the charging nest run everything off the charger, see the thread for cactusjack

  1. Plus the battery monitor. Will this simple solution be enough? Since we are going to power the pump directly from the battery, will this connection give false alarm to the digital pin of the arduino?

dont understand the question

Any ideas?

The first place to start is to do a lot of up front research on the type of bot you want to build. You can get a lot of info from sites like below and from the construction details provided for various robot kits. You can find a lot of similar projects in this forum using the search function or looking in the exihibition group.

http://www.seattlerobotics.org/gettingstarted.php
http://www.seattlerobotics.org/WorkshopRobot/index.php

  1. We want to charge the LiPo without removing it from the system. Basically, the robot will find its home base and attach itself to the charger when a preset threshold is reached. Can this be done without further circuitry? I mean we connect the charger pins to the LiPo, while the system is sourcing current from that battery at the same time.

Using the LiPo correctly in your project is the most important thing you will have to get correct. A LiPo charger uses a constant current during most of the charge and switches to a constant voltage to top off the battery. Therefore you would have to add circuitry to disconnect all the loads (regulators, etc) while attempting to charge so that the charge current only goes to the battery. This is not as simple as it would appear because once you 'brains' are turned off it has no way to know when the charge is complete and to be OK to re-power all the loads. Some kind of interfacing from the charger 'brains' to perform the disconnecting/reconnecting of the loads is required.

  1. Plus the battery monitor. Will this simple solution be enough? Since we are going to power the pump directly from the battery, will this connection give false alarm to the digital pin of the arduino?

Should be possible if proper wiring and filtering is followed. Heavy loads like motors should have their own separate wiring runs, including their ground return wires, straight to the battery. Your software could always turn off the motor for a brief period to take a battery voltage reading, if it turns out to be a problem. Your monitoring software should probably have some averaging function to get a more reliable reading, not hard to do.

A very important task you have to do is to check the manufactures datasheet for that specific battery to determine if it has internal low discharge voltage disconnect feature or not. Some do, most don't. If yours doesn't, you really should have a fail safe battery disconnect to prevent discharge voltage from going below the 6 volt value for a 2 series cell Lipo. Over discharge will destroy the battery, it's not a theory, it's a fact and it will cost you $$$ if your vacuum does not make it back to the charging dock in time.

Lipo batteries do have the best energy density per weight, but they bring a lot of safety and extra detail baggage to the game. NiMH batteries are pretty good and if you don't have to carry higher weight airborne, you can save a lot of expense and circuit complexity by using NiMH cells.

Lastly, good luck on your motor powered vacuum pump. I think you will find that vacuum pumps are pretty awful from a efficiency point of view. You should probably work out that before investing a lot of $$ and time just to find out that can't get enough vacuum without X4 motor and X4 battery size. :wink:

Lefty

@retrolefty said

Therefore you would have to add circuitry to disconnect all the loads (regulators, etc) while attempting to charge so that the charge current only goes to the battery. This is not as simple as it would appear because once you 'brains' are turned off it has no way to know when the charge is complete and to be OK to re-power all the loads.

The circuit we helped optimize for @cactusjack does this. Well, actually it does not "turn off" the other loads, rather it switches them to be directly powered from the charger. In this way the battery is isolated from loads so the charger doesnt get confused and ruin the battery.

The advantage of our approach is the "brain" stays awake. A cell phone does this.

The cell phone is more sophisticated than what we did with @cactusjack, the "brain" waits a while to be sure the external power is stable before switching to it and enabling the charger. If external power is intermittent or rapidly changing the simple approach I gave above may have trouble.

@ AltairLabs

Quote:
2. Plus the battery monitor. Will this simple solution be enough? Since we are going to power the pump directly from the battery, will this connection give false alarm to the digital pin of the arduino?
dont understand the question

I mean this link: How to Build a Robot Tutorials - Society of Robots

The circuit we helped optimize for @cactusjack does this. Well, actually it does not "turn off" the other loads, rather it switches them to be directly powered from the charger. In this way the battery is isolated from loads so the charger doesnt get confused and ruin the battery.

Will this be okay?

@zoomkat
Thanks for the links!

@ retrolefty

Should be possible if proper wiring and filtering is followed. Heavy loads like motors should have their own separate wiring runs, including their ground return wires, straight to the battery.

I don't quite understand. ^^

Questions:

  1. The charger for LiPo we bought has outlets for 2S and 3S. The 3S one consists of 4 pins. I did not open the charger, but i think the 3 of 4 pins are for each cell, while the other 1 is the ground. If this is the case, the pin will output just enough voltage and current for each cell, not enough for the requirement of the switching regulators, since they expect about 11.1v from the battery. Where can i get about 12v to supply the regulators? (the "from where" wire above ^^)
  2. Can i really supply 5v directly to arduino? ArduinoMega needs 7-16v. Where shall I connect the regulated 5v to power the arduino?

Power
The Arduino Mega can be powered via the USB connection or with an external power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
The Mega2560 differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega8U2 programmed as a USB-to-serial converter.
The power pins are as follows:
VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.

Silly me.

We now know where.

5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.

Will post the update later.

Thanks!

"from where" is the external power, charging nest, etc.

You also neeed to run the charger off this external power and connect it to battery. This is U1 and associated components. Sounds like you've bought a complete charger that is not directly usable with this scheme. If youre proficient with electronics you might find the components inside are usable here.

Heres how it works:

The FET connects the battery to the regulators / loads only when there is no external power.

With external power applied, the loads are disconnected from battery and entirely supplied by external power. The charger is also supplied by external power. Now the charger can do its job properly.

When robot leaves the nest external power goes away, so charger is dead, and the battery once more suports all the loads.

Now I understand. A few of questions again:

  1. What mosfet shall we use? Can you recommend the exact part no.? We will use 15v dc to "activate" this mosfet by the way.

  2. Will the switching of mosfet be fast enough that the arduino will not reset?

  3. What diode shall we use? Is the common 1n4001 appropriate?

  4. We want the charger to be connected to the AC mains only when the robot is docking on the home base, can we use a relay to do this task?

Thanks again for your ideas. Really helpful. :slight_smile:

  1. What mosfet shall we use? Can you recommend the exact part no.? We will use 15v dc to "activate" this mosfet by the way.

One that handles the voltage and current, and can turn fully ON with the gate drive you have. Cant recommend one without knowing all your sources and loads. The MOSFET is activated by the presence of external power, are you supplying +15 V DC to the interface between docking base and robot?

  1. Will the switching of mosfet be fast enough that the arduino will not reset?

With the usual filtering and bypass capacitors on voltage regulators and Arduino it should not be a problem. Add more capacitance if you have trouble.

  1. What diode shall we use? Is the common 1n4001 appropriate?

Common rectifier is OK if you dont exceed the ratings. That one is good for up to 1 amp. An even better choice would be Shottkey diode which has lower forward voltage drop.

  1. We want the charger to be connected to the AC mains only when the robot is docking on the home base, can we use a relay to do this task?

Yes. Or a mechanical switch.

@ AltairLabs

One that handles the voltage and current, and can turn fully ON with the gate drive you have. Cant recommend one without knowing all your sources and loads. The MOSFET is activated by the presence of external power, are you supplying +15 V DC to the interface between docking base and robot?

Yes. We will create a voltage regulator with output of fixed 15v dc, this way there is enough voltage for good line regulation of our switching regulators supplying the brain. What parameters of fet shall we watch out for?

With the usual filtering and bypass capacitors on voltage regulators and Arduino it should not be a problem. Add more capacitance if you have trouble.

Before or after the switching regulators? Before the IC, we will put 100uF/25v, after we will have 330uF/16v.

Common rectifier is OK if you dont exceed the ratings. That one is good for up to 1 amp. An even better choice would be Shottkey diode which has lower forward voltage drop.

Okay. So we will use 1n5820 (20v 3A).

Yes. Or a mechanical switch.

Do you reckon microswitch is better than relay for connecting AC?

Thanks. Will post partial schematic later. ^^

What parameters of fet shall we watch out for?

One that handles the voltage and current, and can turn fully ON with the gate drive you have.

Before the IC, we will put 100uF/25v, after we will have 330uF/16v.

sounds like enough, try it and see.

So we will use 1n5820 (20v 3A).

good choice, assuming loads are under 3A.

Do you reckon microswitch is better than relay for connecting AC?

cant say, as I dont know the purpose of this. to turn off +15V when the dock is empty? what will activate the microswitch or relay? can it be falsely activated? is +15v easily accessible? current limited? why does it matter?

Tell me if we have in mind a similar idea:

sorry it just makes more sense to me drawn this way.

Since your VEXT is so much above your battery voltage, the body diode of the FET might conduct, so I added a diode after the FET, too. But since you have plenty of overhead voltage you no longer really need the FET, just a pair of diodes will be fine.

This version also shows advice from the various gods, such as the heavy loads need to be wired with their own "home run" to the single point ground. The BRAIN is Arduino plus sensors, no heavy loads. If your other servos are substantial loads they can have their own ground too. This "star" ground ensures the charger and brain dont get confused by IR drop from common ground current.

If you keep your grounds well controlled, there is little reason not to put +5V regulator direct to Arduino +5V per AWOL and smeezekitty. You need to control grounding anyway to keep noise out of analog inputs and low voltage sensors.

For switching heavy loads use FET and include a few K of gate resistance. That way any "ground bounce" can get dissipated harmlessly. This might cause some ugly switching but you'd rather have it there than mixed in with your low level IO.

As the gods pointed out the Arduino battery monitor voltage will depend on loads. Best to monitor voltage when heavy loads are idle. You can test the battery under load, but you need to know the current and use different criteria for voltage vs charge.

@ AltairLabs

Sorry, me being novice. But I am willing to read a lot. Really glad there are people like you.

One that handles the voltage and current, and can turn fully ON with the gate drive you have.

By the way, I have not used MOSFET before, so I don't know what to choose. The LiPo battery will power the ArduinoMega (current consumption I cannot compute), 3 IR sensors (about 100mA max for the three), 2 servos (we checked a while ago, the consumption is about 250mA for the two), LCD (150mA including BKL), and vacuum pump (about 500mA max). What FET do you think will handle this?

cant say, as I dont know the purpose of this. to turn off +15V when the dock is empty? what will activate the microswitch or relay? can it be falsely activated? is +15v easily accessible? current limited? why does it matter?

I hope the image below will clarify what I am trying to say before. ^^

sorry it just makes more sense to me drawn this way.

Don't be sorry. You are the one helping me. The fact that you drew that thing is a big help to teach in the first place.

Since your VEXT is so much above your battery voltage, the body diode of the FET might conduct, so I added a diode after the FET, too. But since you have plenty of overhead voltage you no longer really need the FET, just a pair of diodes will be fine.

I don't understand.

This version also shows advice from the various gods, such as the heavy loads need to be wired with their own "home run" to the single point ground. The BRAIN is Arduino plus sensors, no heavy loads. If your other servos are substantial loads they can have their own ground too. This "star" ground ensures the charger and brain dont get confused by IR drop from common ground current.

So you are saying I need to connect the grounds of heavy loads direct to the negative of the battery?

For switching heavy loads use FET and include a few K of gate resistance. That way any "ground bounce" can get dissipated harmlessly. This might cause some ugly switching but you'd rather have it there than mixed in with your low level IO.

Do you think 2k ohms will do? If I am controlling the FET's gate directly via Arduino, then sending a HIGH will switch the FET? 5v 40mA to a 2k resistor will still switch the FET?

As the gods pointed out the Arduino battery monitor voltage will depend on loads. Best to monitor voltage when heavy loads are idle. You can test the battery under load, but you need to know the current and use different criteria for voltage vs charge.

I have not tried using heavy loads controlled by a uC before. If the vacuum pump + servo are running, will the voltage from battery decrease? By how much? Do you recommend other means of detecting charge of battery other than the voltage divider?

What FET do you think will handle this?

sounds like yer already over 1 amp, the Arduino could draw 200 mA depending on how hard youre working its outputs. And as the gods say you will probably keep upping the vvacuum motor. For example my little home vacuum cleaner at 11 Vdc would pull about 85 amps. So its safe to say the FET could hardly be too big. I'm talkin 'bout a FET to switch the vacuum motor, see below you probly dont need the FET to switch the battery.

I hope the image below will clarify what I am trying to say before. ^^

failure to communicate. you have a charger in the dock powered by mains. i have a charger on board the vacuum bot powered by external 15 Vdc. two completely different approaches. my approach requires no relay no switching, only 2 contacts between dock and bot. The diodes and such do everything to transition between external power and battery power.

I don't understand.

eliminate the FET and connect the battery directly to D2.

So you are saying I need to connect the grounds of heavy loads direct to the negative of the battery?

or else grounds of everyhting including battery to a single point.

Do you think 2k ohms will do? If I am controlling the FET's gate directly via Arduino, then sending a HIGH will switch the FET? 5v 40mA to a 2k resistor will still switch the FET?

2k is good, even up to 10k. sending 5v will switch on FET, the current will be nearly zero (except when the gate voltage is changing). This is a good FET for low side switching of motors http://www.irf.com/product-info/datasheets/data/irlz44n.pdf

If the vacuum pump + servo are running, will the voltage from battery decrease?

yes

By how much?

no simple answer

Do you recommend other means of detecting charge of battery other than the voltage divider?

no simple answer. most simple answer is only measure when motors are idle.