motor draws much current - diabling other components?

Hello,

building a car, I use a DC motor with a transistor (see attached schematics).

However, the ultrasonic distance module (I use one to avoid crashing with walls) outputs weird results when the motor is on. When I just unplug the motor, the ultrasonic distance module gives the very exact result. ultrasonic distance module is connected just 5v-5v, gnd-gnd, trig-12, echo-11 (very normal) and actually is very reliable!

How can I get rid of that issue?

Thanks in advance

sche.png

  1. get a bigger power supply
  2. add power supply decoupling capacitors
  3. try and suppress the noise from the motor with capacitors and chokes.

Hello,

thanks for the answer. At first, I should've asked whether this issue is normal or if I misconfigured something?

  1. more voltage? How is that concerned? why does it play a role? I just tested using USB power supply and it works much better, not perfect but really good? why do the batteries with ~ 7 V do not work?
  2. to admit, I don't really know that. As far as I understood an expanation I found, using capacitors allows the motors to be first driven by the capacitors which save can some load, because it is diffucult for fragile power supply to give so much current in a short time(?) - I did research here What is a decoupling capacitor and how do I know if I need one? - Electrical Engineering Stack Exchange
  3. I once have a seen a DC motor having switched a capacitor directly between + and -. Or one that was connected with a capacitor to the motor housing. What noise to surpress then?
  1. no not more voltage more current capability.
  2. yes it is a common problem, motors generate interference, you have to reduce it.
  3. yes that suppresses the noise.

Things are always simpler if you run the motor from a separate supply - then spikes and drop-outs don't bring down
the rest of the system. Remember a motor can pull its stall current briefly at startup and when reversing direction,
unless your supply can effortlessly handle that current the voltage will drop.

@Grumpy_Mike:

  1. ok, that's why I am using S8050 transistor, I do not know how much current the motors need, but I think a transistor is the best thing to decide for. How is then the power supply concerned if I use a transistor?
    2/3) I am also using anitparallel diode (flyback diode) and I am going to get a capacitor as well (how much nF are appropiate?)

And I want to stick to the idea of using the board to supply the motor

And I want to stick to the idea of using the board to supply the motor

Then expect the same results. The arduino is not designed to power motors.

of course it is not designed to do so,
I think of using a motor driver (L293D) because it has built-in flyback diode and is able to drive to motors seperately and reverse the poles, which is exactly what I need. someone knows if it hsa builtin transistors i could not find in datasheet.

and am still uinterested in

karlok:
@Grumpy_Mike:

  1. ok, that's why I am using S8050 transistor, I do not know how much current the motors need, but I think a transistor is the best thing to decide for. How is then the power supply concerned if I use a transistor?
  1. ok, that's why I am using S8050 transistor, I do not know how much current the motors need, but I think a transistor is the best thing to decide for. How is then the power supply concerned if I use a transistor?

Because the transistor is only a switch. If the motor demands more power than the power supply can produce then it will drag down the supply voltage and disrupt the rest of the system.
Do some measurements on your system and see if the supply voltage drops when the motor runs.
Then look at the power supply voltage on a scope and look at the interference, then try and reduce it.

2/3) I am also using anitparallel diode (flyback diode) and I am going to get a capacitor as well (how much nF are appropiate?)

Well I hope you don't because an anti parallel diode is two diodes back to back. You want a reversed biased diode across the motor which is what you might mean. As for capacitors 0.1uF ceramic for the high frequency along with at least 47uF bulk decoupling. It would also help to use an inductor like the last circuit in this link
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

karlok:
I do not know how much current the motors need

Why not? Are you incapable of measuring the resistance of the motor, and applying Ohm's Law to figure the stall current? If so - then you need to go back to the basics of electronics, before you continue with your project.

Heck - if you can't do that, then why don't you just measure the current draw directly with your meter?

You do have a meter, right?

/facepalm... :frowning:

@Grumpy_Mike
so, using the transistor, i can, by supplying pwm signal on it, the amount of current to allow to be passed
that means setting this pin to high either means no limit or maximum current. i think the second, because when I connect the motor directly to 5v and GND, the arduino restarts, that means too much current drawn was demanded.
I am using S8050.
So what is the difference between setting the BASE to HIGH , and directly connecting the DC motor to 5V/GND ?

@cr0sh
this is exactly the point, i do not own one at the moment
currently my father uses it and he is away for a longer time, so i thought to make the best for now without out it, in ca. 1 week i can measure the current, no problem

My suggestion would be buy a Arduino Motor Shield R3 (Radioshack) and you got your H-bridge, ports for external power supply, motor ports, and everything right there. Just a though :slight_smile:

So what is the difference between setting the BASE to HIGH , and directly connecting the DC motor to 5V/GND ?

As far as the motor is concerned not a lot.
There is a voltage dropped across the transistor even when it is fully on, this is called the saturation voltage or Vsat, this is in the order of 0.5 to 1.2V, so with a transistor you get slightly less voltage across the motor.

Thanks for the recommendation using a Motor Shield.
Four questions about Motor Drive Shield Expansion Board L293D:

  • can I change the speed of the motors with L293D ? that means: does this H-bridge contain a transistor?
  • assuming I am powering the Arduino board with some battery, can I simply connect the Arduino's VIN to the motor shield's EXT_PWR ? GND is GND anyway, so no connection needed there
  • here, there are on the left and on the right each 5 connectors, 2 for each motor, and why is there a GND in the middle of them?
  • a disatvantage is, that this module can only be stacked on top of others or directly on the arduino but I cannnot connect wires to the pins because there are no openings on the top. Thus, I would connect the module by only connecting the neccessary pins with male-female wires. That means I need to know which pins are used to drive the motors...

Yes a h-bridge contains transistors or FETs

assuming I am powering the Arduino board with some battery, can I simply connect the Arduino's VIN to

Yes but I would add extra decoupling.

You need to know what pins control the motors in order to write the code.

Grumpy_Mike:
Yes but I would add extra decoupling.

do you mean I shall use two power supplies ?

  • one for the arduino board
  • one for the motors

what are good compact power supplies and able to supply much current for the motors?
I am thinking of some rechargable battery charged by the arduino board...

do you mean I shall use two power supplies ?

  • one for the arduino board
  • one for the motors

Well two power supplies are the ultimate in decoupling but are not essential. You can do more with inductors and capacitors. See the last schematic in this link:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

The sagging voltage due to the motor, and interference from the motor, are really two separate issues
and you need to consider both of them.

Get a voltmeter or multimeter and see if the voltage drops when you run the motor.