For a pet project I am doing (trying to fly a kite using my computer) I need to move and reverse an electro motor to my liking (I took the motor from an old hand-held vacuum cleaner). I need to control this movement from a Raspberry Pi.

From what I understand there are 3 basic types of electro motors: DC, Single phase AC and 3 phase AC. From these three only the DC motor reverses when you switch polarity (which I guess means switching positive and negative). On this page however, I read that "for a DC motor which has a wound field winding instead of a permanent magnet you have to reverse the connections either to the field winding or to the armature.". And here I'm lost.

So I thought to simply try it out: I hooked up the + of the battery to the - of the motor and vice versa. The motor did in fact move, but still in the same direction and a lot slower. Unfortunately, after a few seconds it smelled like something was burning. So I quickly took the load of the motor. Luckily it still works..

The things I now wonder about are:

  1. What kind of motor do I have (see pics below)?
  2. How do I reverse this motor?
  3. Can I reverse this motor from the Raspberry Pi using the Gertboard's on board motorcontroller (as far as I understand the motorcontroller on the Gertboard simply reverses the positive and negative when it wants to reverse the motor)?
  4. If this motor cannot be reversed using the Gertboard, where would I be able to get a motor that can actually be reversed using the Gertboard (preferably by getting it from an old home appliance)?

All tips are welcome!

Motor from the side Motor from the back Motor inside


5 Answers 5


The components on the back of the motor are three capacitors to suppress the contacts, and a diode to protect whatever switched it from a back-emf.

If you reverse the polarity without removing the diode, then you will just put the current through the diode not the motor, and possibly either destroy it or damage your power supply, or both.

So you need to remove the diode, and if you are using a simple transistor to switch the motor, provide some other protection. If you're using an h-bridge with diodes, then you're ok (I'd imaging the gert-board does, but don't know for certain).

You also need to remove the larger black capacitor - it is polarised, so will be damaged and possibly explode if you connect it the wrong way round. Previously the diode prevented the current going through it when you did that. If the motor generates lots of electrical noise when you run it without the capacitor - interfering with radios and so on - then you will need to add a similar value of non-polarised capacitor to suppress that.

Also check that board you're using can supply the motor's required current.

  • \$\begingroup\$ Thanks for the answer! Since your text is quite a challenge for me I hope you can clarify a few things. (1) Which part is the diode? On wikipedia I read that diodes always have 3 connections, but I don't see anything with 3 connections. (2) On this page it says the Gertboard has an built-in H-bridge motor controller. It doesn't say anything about diodes though. Does an H-bridge imply that it has diodes? \$\endgroup\$
    – kramer65
    Mar 18, 2013 at 14:38
  • \$\begingroup\$ @kramer65 I can't seem to find a schematic or bom for the board - it probably does, given that it's using a h-bridge IC. If you look up the number on the h-bridge IC ( vertical ic with a metal tab, several pins near the fuse ), then the data sheet will tell you. \$\endgroup\$ Mar 18, 2013 at 15:08
  • 1
    \$\begingroup\$ I went to an electronics shop here in Amsterdam, and there they simply cut the wire connecting the middle black thing (capacitator) on the two sides. And now it indeed runs both ways (without significant noise)! You are also talking about removing a diode; which one are you talking about here? And finally, I found the documentation for the Gertboard (link). It says it is for a brushed DC motor, am I okay with this one? \$\endgroup\$
    – kramer65
    Mar 18, 2013 at 18:15
  • \$\begingroup\$ Perhaps. We can't really know the current draw of your salvaged motor to tell if it is within spec of the Gertboard's driver. \$\endgroup\$ Mar 18, 2013 at 20:13
  • \$\begingroup\$ @kramer65 The photo shows two black components connected across the terminals - a vertical cylinder with writing on it (TOP (R) EVA 220uF 25VDC) and a strip pointing at one terminal and below that a smaller horizontal cylinder with a black band at one end. The larger one is the capacitor, the smaller one is the diode. It's likely that the shop removed both. \$\endgroup\$ Mar 19, 2013 at 9:14

In addition to Pete's answer (which is completely correct):

You have a permanent magnet DC motor,most likely with carbon brushes.

This would normally be reversible simply by reversing its supply connections, as you first tried (after removing or reversing the diode and big capacitor as Pete recommends.

However it is likely that the motor is tuned to run in one direction only.

This is done in a brushed motor by rotating the brushes in the direction of rotation (a little bit like advancing the ignition on an IC engine) so that the magnetic field builds up in time to do the most good. It also reduces sparking when the brushes break contact. Looking at the motor, there is a slot through which you can observe the brushes : check for visible sparking both ways round. It may also be possible to adjust the brush position through this slot with a suitable tool, if you are brave enough.

However, even if the motor will run backwards well enough, it is driving a ducted fan. The curved blades will stall when reversed, and deliver a fraction of the expected thrust, possibly consuming higher than normal current. Check the current on the bench. The reduced thrust may or may not be a problem in your application...

If you can't do what you need by reversing the motor, mount the whole ducted fan in gimbals and rotate it 180 degrees.

  • \$\begingroup\$ Thanks for your answer! I just checked, and when I connect the motor its + to the battery its - and vice versa I indeed see sparks within the motor. Is that an indication of anything? Also, strangely enough, the motor actually runs a lot faster when it is connected the "wrong way around" (plus to minus and vice versa). Would you know why? \$\endgroup\$
    – kramer65
    Mar 18, 2013 at 18:21
  • \$\begingroup\$ Some sparking would be normal. If it's much worse in reverse, that would indicate the sort of problem I was warning about; if it sparks the same either way round, you are probably OK. If it's running faster that could be for 2 reasons : (1) the fan blades are less effective (not biting into the air) or (2) less magnetic field (because of rotated brushes). If you can remove the fan blades you can eliminate (1) as a possibility. \$\endgroup\$
    – user16324
    Mar 18, 2013 at 19:15
  • \$\begingroup\$ With normal drive (not reverse) there is no sparking, and with reverse there is constant sparking. Does this mean my motor will set fire, or can I let the sparking simply continue? \$\endgroup\$
    – kramer65
    Mar 18, 2013 at 19:23
  • \$\begingroup\$ It probably won't catch fire, but it will wear out much faster (the brushes and commutator will overheat) - this is only a guess, but it might last a few hours instead of a thousand. If the commutator melts it may short circuit the speed controller (BAD) - is the speed controller short circuit protected? \$\endgroup\$
    – user16324
    Mar 18, 2013 at 21:15
  • \$\begingroup\$ I won't be running in reverse for more than 20 seconds per minute (switching between drive, reverse and standstill constantly). So I suppose this won't melt it.. I have no clue whether the circuit speed controller is short circuit protected. I will ask on its forum. I can't really open the motor so I can't really adjust the brush position. I messed with a screwdriver through the opening, but to no avail (no clue what I'm doing). I Thing I'm just gonna go for it how it is now. When using it I'll simply check for overheating.. :) Thanks a million! \$\endgroup\$
    – kramer65
    Mar 18, 2013 at 22:36

The motor in the question has an electrolytic, polarized capacitor, and a diode, across its leads - this in itself clearly says that the motor was not supposed to be driven with reversed polarity. The capacitor in question is the black can.

The burning smell was either the short-circuit through the diode frying your wiring, or if the diode had already failed, the capacitor getting extremely upset at being connected to an inverted polarity. You may have been fortunate in that electrocaps tend to explosively express unhappiness at being connected the wrong way around. The white strip on the capacitor casing, seen at the left edge of the capacitor in the last photo, indicates the negative voltage connection.

That the motor moved at all in reverse seems to indicate that the diode had already blown, and the power the motor was receiving was whatever was left over after leakage across the reversed capacitor - not much. That may explain the slow reverse rotation.

Do not use that motor even with the correct polarity before replacing that capacitor and the diode. Further, check if the motor can run acceptably in reverse at all, as the other answers have pointed out.

For operating a DC motor in either direction, use a H-bridge circuit:

MOSFET H-bridge (Source)

Instead of discrete MOSFETs or transistors, you can also use a H-Bridge IC such as the Freescale Semiconductor 5 Ampere H-bridge MC33887 or Texas Instruments DRV8837, so long as the voltage and current requirements of your motor are met by the IC selected.

Also, replace the capacitor with an unpolarized one (for electromagnetic noise suppression, if this is necessary), remove the diode from the motor leads and use 4 suppression diodes at the H-bridge terminals, as shown in the above diagram.

If you cannot find a suitable non-polarized capacitor, see this answer, for a way to achieve unpolarized capacitor behavior from two polarized ones.


With addition to above answers, check these data sheets you will get every thing you need,

L293 and L298

  • \$\begingroup\$ No, those are very poor choices, as they have extremely high internal losses. \$\endgroup\$ Oct 14, 2020 at 3:53

It's hard to tell from the pictures if it is a ducted fan or centrifugal fan with curved fixed blades on the outlet to straighten the flow & convert the rotation of the air into more thrust. All the vacuum cleaners I have seen have centrifugal fans, which will not pump backwards even if the motor is reversed. They will still pump forward, but less efficiently, so you will need to redirect the air through reversing gates.

Also, the motor is probably around 48W. That means, if it runs on 6V, it takes about 8A. The highest output Gertboard I can find is only rated at 4A. If you don't need variable speed, I would recommend a relay. If you do, use a power FET, good for 10A or more and a schottky diode rated at more than 2Aav (the bigger the better) across the motor like the original diode. The output will be pulse width modulated (PWM), using the inductance of the motor winding to smooth the current. Between pulses, the current freewheels through the diode. Hook the gate of the FET to one of the motor o/ps of the Gertboard.

Our old Whirlpool washing machine had a reversing valve like this on the water pump to reverse flush the filter & empty the machine.enter image description here

  • \$\begingroup\$ A simpler way would be to get a length of plastic drain or sewer pipe with the wide end for the next pipe to fit in, or put a coupling on it. Mount the motor in a small piece, with the electrical terminals on the side, and jam it in one way for suck, and the other for blow. \$\endgroup\$ Jan 28, 2021 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.