I'm making a mini RC car with an Arduino nano and wireless communication with RF433, with 2 motors with 2 motor drivers (L293D). I use 4 1.5V batteries to power the arduino nano and another 6V battery pack to power the motors, and use a joystick with an Arduino Mega to send commands. I've written a program that sends specific digits when the joystick is in a certain position, i.e. when the joystick is "bent" to the front it sends a "1", a "2" is sent when the joystick is bent towards the back, and so on.

My problem is this: When I bend the joystick towards a certain direction, the RC car moves accordingly without problem; However, when I bend the joystick towards another direction (in other words send a different command), the RC car doesn't respond. I took a look at what the RC car was receiving, and I've noticed that after the first command was sent (when I bend the joystick towards a certain direction), no more commands get to the RC car (in other words the Arduino Nano). This occurs occasionally, and I can't afford to have defects like this. I think this means the Arduino Nano "froze" after the first command. Is this because of not enough voltage or current? Are there any alternatives to 4 1.5V batteries that are not pricey (I need to build 8 of these RC cars)?

UPDATE: These are the pictures of my breadboard and whole thing. Though I doubt it'll help. enter image description hereenter image description here

  • \$\begingroup\$ Do you have separate power rails for the Arduino vs the motors? Are you certain the batteries are able to deliver the amount of current necessary for the motors (especially the instantaneous in-rush current)? It sounds like the Arduino is suffering a brownout when the motors kick in and cause a dip in the input voltage. \$\endgroup\$ – tangrs Feb 19 '17 at 13:45
  • \$\begingroup\$ There's a few things that don't seem to follow spec in your schematic. According to the L293 datasheets, Vcc1 should be at least 4.5V where you're supplying it with 3.3V. Furthermore, are you certain that Vin on the Arduino is producing >5V? Is the 5V rail actually 5V? A flat battery will cause it to run out of spec. The grounds on pins 4, 5, 12, 13 aren't all tied together to ground either. \$\endgroup\$ – tangrs Feb 19 '17 at 15:26
  • \$\begingroup\$ Hang on, are you using a L293D or are you using a TA7291P? Your schematic doesn't seem to match your question \$\endgroup\$ – tangrs Feb 19 '17 at 15:34
  • 1
    \$\begingroup\$ "I tried with separate power sources, but the problem's still there." - If the motors are powered from a separate battery then it should not brown out. You might have a 'ground loop' (motor current flowing though shared ground wire), or a software bug, or a loose connection. Make the Arduino flash an LED at regular intervals to prove that it is still alive, and turn on the Watchdog timer to reset the Arduino if it locks up for any reason. \$\endgroup\$ – Bruce Abbott Feb 19 '17 at 18:13
  • 1
    \$\begingroup\$ @TrepidClaw0601 Could you build your circuit on a piece of stripboard (Veroboard) so that you have soldered connections? You can use DIP sockets for the DIP components, or turned-pin socket strips. Also, you could use LEDs (with series resistors) in place of the motors to eliminate the motors as the source of the problem. \$\endgroup\$ – Andrew Morton Feb 20 '17 at 20:07

To add to my comment, it sounds like the Arduino is suffering a brownout condition. I think the correct term is actually called voltage sag but essentially it means a temporary drop in voltage due to high current draw and the internal resistance of the battery.

It's likely the batteries you are using are not able to deliver the instantaneous current required to drive the motors. What happens is when the motors are first switched on, they initially draw a very large current and causes the battery output voltage to dip. After a certain point, the Arduino senses a brown-out condition and shuts down.

Depending on how bad the brownout is, you might be able to get away by throwing on a huge capacitor close to the input of your Arduino (after the voltage regulator which I presume you have). Hopefully that will tide over the initial high current draw.

Otherwise, you can try having separate power sources. One dedicated to the Arduino and the other dedicated to driving the motors. I haven't looked into your motor drivers but this configuration is supported by most drivers I've seen and used. They'll usually have two power inputs on the drivers: one for logic level voltage input and one for power input.

If you want to share a single power source, consider using a battery that is able to deliver high currents. You can look on websites like HobbyKing for lithium-ion batteries that can deliver high currents. Do read up on how to handle li-ion batteries if you decide to go this route though.

Without seeing your circuit or any oscilloscope pictures of the power rail, there's not much else I can suggest at this point.

  • \$\begingroup\$ Thanks for the answer. I tried with separate power sources, but the problem's still there. Sadly, I don't use a voltage regulator or a resistor. Do you think adding a resistor (or the voltage regulator) will help kill the voltage sag? \$\endgroup\$ – IronEdward Feb 19 '17 at 14:08
  • \$\begingroup\$ I would recommend putting up schematics of what you have tried or what you have at the moment. Do you have an oscilloscope that you can use to see the voltage fluctuations? \$\endgroup\$ – tangrs Feb 19 '17 at 14:58
  • \$\begingroup\$ I also have no idea what you mean by adding a resistor or voltage regulator. Please add schematics! \$\endgroup\$ – tangrs Feb 19 '17 at 14:59
  • \$\begingroup\$ Ok. I'll make one right now. \$\endgroup\$ – IronEdward Feb 19 '17 at 15:02
  • \$\begingroup\$ I added the schematics. Thanks for the help. And no, I don't have a oscilloscope. \$\endgroup\$ – IronEdward Feb 19 '17 at 15:15

It must be noted that L293d motor driver is capable of delivering only 1A current per channel and L298n is capable of delivering 2A current per channel.Such amount of current may not be sufficient to drive your motors.So,try changing to a high current output motor driver. Hope it works.

  • \$\begingroup\$ A better driver is only likely to make the problem worse by increasing the battery sag and possibly radio interference. In terms of performance (which is not the issue asked about) both the L293 and L298 and all such Darlington bridges are horribly unsuitable choices. An FET bridge should be used and the crude 433 OOK radio replaced with a 2.4 GHz FSK one. \$\endgroup\$ – Chris Stratton Mar 3 at 7:27
  • \$\begingroup\$ It has been said by the author of questions that even after changing the battery to 12 volts it doesn't work. So it may be possible that motor driver is not supplying enough current to motors.I have one case of past in my mind where when I connected LED's in place of motors by L298n motor driver,it worked fine but on connecting motors (which takes about 10A of current on average)it worked abnormally. So here,we can try changing to a high power motor driver. \$\endgroup\$ – Rudresh Dixit Mar 3 at 17:50
  • \$\begingroup\$ No, you fundamentally misunderstand the nature of the failure they are reporting. What they are saying is that the motors spin, but that then control fails. This indicates that lack of power to the motors is not the problem but rather than the motors cause failure of control, either due to loading the battery below the needed voltage or due to generating radio interference. A better driver would only increase the degree to which the motors can load the battery making that problem worse. And it could quite well make RFI worse as well. Your suggestion cannot solve the problem \$\endgroup\$ – Chris Stratton Mar 3 at 17:55
  • \$\begingroup\$ And further your proposed L298 is pretty much just as unwise a choice as the L293 would be, because in still being an antiquated and lossy Darlington device it's just a bigger version of the same bad idea. You might also note hat the question has been abandoned for two years - in reality it should probably be removed from the site. \$\endgroup\$ – Chris Stratton Mar 3 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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