0

I have a Arduino Mega 2560 connected to

  1. L293D Motor Driver IC connected to two small size dc motors.
  2. MPU-9150 using i2c
  3. Xbee v1.1 arduino shield by seeed
  4. Li-po battery, 7.4 volts, 2200 mah.

All components are tested separately, they all are working fine, the sensor readings showing data on serial monitor, the l293 drives the motors, xbee sends wireless serial data on pc, and li-po is also working fine.

I have checked the wiring alot of times. It all seems to be correct.

The problem arises when i connect all of them together, since I am using a single power source, I power the l293d with the Li-po and the Arduino also with the Li-po.

  1. When the L293D is powered using Li-po and it starts drawing current from the battery, the serial monitor/arduino gets stuck. It doesnt show sensor readings anymore, while the dc motors start spinning. And they continue to spin, until I break connection with the battery.

  2. Without the l293d powered, the sensor readings are working fine, everything is going normal, as it should, but as soon as the l293d is connected, arduino is stuck..

I have searched alot of forums for this, found some info, perhaps something to do analog and digital ground? mpu-9150 is digital ground. So that is why it stops the arduino mega as the l293d starts drawing current. All hell breaks loose.

Can anybody please help me with this? it is giving me headaches ever since!

16
  • 2
    Can you provide a schematic or wiring diagram? Jul 24, 2014 at 22:30
  • 2
    Did you use decoupling caps or are you challenging the laws of nature?
    – jippie
    Jul 25, 2014 at 5:17
  • Try adding a high value capacitor to the 5V. Alternatively try powering the motors using the battery voltage directly instead of (though the regulator) to 5v. Also, what happens if you only disconnect the motor, and not the L293D?
    – Gerben
    Jul 25, 2014 at 13:54
  • @jippie, many of your readers (like me) have a software background, not EE, and may not know what you're talking about with bypass caps. I've seen them used in regulated power supplies. It would be helpful if you provide a link to you would use bypass caps in a circuit that has both power loads and a micro controller on it.
    – Duncan C
    Jul 25, 2014 at 13:56
  • @DuncanC to be honest, that was more or less the reaction I was hoping for. Check these related questions on EE:electronics.stackexchange.com/questions/105820/… and electronics.stackexchange.com/questions/59325/… and electronics.stackexchange.com/questions/90971/… The problem is clearly related to power surges and caps may be able to solve that. BTW OP should really post a circuit diagram, because details unclear.
    – jippie
    Jul 25, 2014 at 15:19

1 Answer 1

2

My guess is that your motors are drawing too much current and the voltage from your battery is dropping too low for the voltage regulator on the Arduino. Looking at the data sheet, the L293D will provide up to 600-mA for up to 2 motors at a time. That's up to 1.2 amps, a whole lot of current. I would suggest trying to power your arduino from a separate 9 volt battery as an experiment.

2
  • i tried having two power sources. Jul 26, 2014 at 15:50
  • 1. Lipo 7.4v for the L293D 2. 9 Volt battery for the Arduino. there is a ground common between all, i hope that isnt creating the problems? Jul 26, 2014 at 15:50

Your Answer

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

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