I have a toy car that I wanted to make autonomous.

Arduino-powered Car

It has a motor for rear drive (seen in the bottom of the photo hidden in the gear-box) and a motor for rack and pinion steering (located just above the webcam in the photo). Reversing the polarity allows the car to reverse, as well as steer in the opposite direction.

I have successfully added break out cables from these two motors, hooked up in addition to the toy's original wires to them. These cables (red/black for drive motor and light/dark green for steering motor in photo) have been hooked up to an Arduino. I was able to control both motors with relative ease using Node.js.

However, the toy car has four 1.5v batteries to power it. When I check how much power arrives at the motors using the Arduino, it's under 1v, and the toy car can't drive when placed on the ground, nor can it steer the wheels (I just hear a click and see the rack move about 1mm each way).

If I check with a multimeter, the lines seem to get ~5v, but once they're connected to the motors, they drop to under 1v.

I tried desoldering the original lines that went from the car's PCB to the motors, but it didn't seem make a difference. If I use the car's original remote control, the wheels fly along and receive the normal ~5v.

I am wondering if it's possible to use relays to let the Arduino control the switching and polarity, but have the car's original power source provide the final power. I'm aware how relays work, but I'm curious if they're compatible with requiring the polarity switch. If it's possible, would I need special relays or just one of the normal Arduino ones?

In case you couldn't tell, I'm new to Arduino, with this as my first project.

  • 2
    \$\begingroup\$ Not enough drive current to the switch, MOSFETs would be better. Got schematic? \$\endgroup\$
    – user26530
    Jul 27, 2013 at 10:29
  • \$\begingroup\$ @Heysoos I do not, for what I've done so far it's very simple (simply going straight from the motors to the Arduino and switching its polarity there). \$\endgroup\$
    – alex
    Jul 27, 2013 at 10:41
  • \$\begingroup\$ The inverting switch or H bridge is a special current driver. You cant just XOR it with logic. \$\endgroup\$
    – user26530
    Jul 27, 2013 at 11:02
  • \$\begingroup\$ You do realize the Arduino won't be able to do anything with the webcam, right? For that you would need something like a raspberry pi, beagle bone, allwinner-based android stick, etc - but you might keep the arduino as a serial or spi controlled motor supervisor. \$\endgroup\$ Jul 28, 2013 at 5:49
  • \$\begingroup\$ @ChrisStratton Yes, I have a Raspberry Pi. Unfortunately though, I couldn't get it to work with the webcam (yet). \$\endgroup\$
    – alex
    Jul 28, 2013 at 5:54

2 Answers 2


Your Arduino output ports can't supply the kind of current needed by your motors. Worse, they are not prepared to take the inductive spikes that can be caused by brushed DC motors.

The solution to both problems is to use either a relay, or an H-bridge (with kickback diodes). Unfortuantely most H-bridges are not optimized for 6V, most prefer 12V or higher. For low currents you might check an LD293D, although it won't do that well at 6V.

If you use a relay note that you can't connect a relay directly to the Arduino pins. There are plenty of relay boards for Arduino that combine a relay with a transistor and the kickback diode (which is now needed for the relay coil).

Note that it might not be a good idea to use the same power for both the motors and the Arduino. Start with two separate battery sets. If you get everything working you might try combining the batteries, maybe with some spike suppression. If anything goes wrong then you know the likely cause.

  • \$\begingroup\$ A TB6612FNG will probably give much better performance than an L298 which has a much higher internal loss. However, that loss may have already been taken into account in the toy's original cell count. Another option is to try to borrow the drive components from the original PCB. See for example if you can find a bunch of transistors (such as on the left of your PCB) driven by identical resistors all connecting back to an IC. \$\endgroup\$ Jul 28, 2013 at 5:46

This is how you can drive a motor which consumes a considerable amount of current using relays


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.