Electronic – arduino – How to make a circuit to run DFRobot with a Netduino

arduinomotornetduinorobotics

So I ordered a DF Robot kit and got some help to put it together.

I want to control the wheels with my netduino.

What I want to do is simple. Press the netduino's button, and start the 4 wheels in the same direction, full power.

When I try to make it run with one wheel plugged in my breadboard, it works, the wheel move.

But when I add a second wheel, nothing happens. It seems that I don't have enough power to make the wheels move.

The netduino is powered by a 9volt battery. When I press the button, the netduino let the big power source ( 5 AA batteries , as suggested in the kit) flow in the motors. (this is how I see it correct me if I'm wrong.)

Here's a scheme that my friend made me back when I was playing around before I had this kit. ( note that I removed the resistor)

Basically, I'm doing the exact same thing with my df-robot kit.

The motors negative wires are all lined up in the #5 pin of the 4n35 transistor.
The 4 positive wires are all lined up with the positive power source positive wire. (5 new AA batteries)

I'm using the 4n35 transistor that came with my netduino kit I ordered.

But before I go on and buy something along the lines of a motor shield, is there a way to get it working with my current setup ?

Best Answer

There are a couple of issues with the proposed design:

  1. The 4n35 is an optocoupler, not a regular transistor. While the output side can conceptually be treated as a BJT, the maximum collector current rating for it is 100 mA, which may be insufficient for driving multiple motors, or even one motor, depending on the motor's current requirement.
    • For the switching element, use a Bipolar Junction Transistor (BJT) such as the 2n2222 (800 mA maximum continuous collector current) or a logic-level MOSFET such as the IRLML2502 (3.4A @ 4.5 Vgs, at least 2 Amperes at 3.3 Vgs) instead. Depending on the motor current requirement, and the number of motors to be run, you may need a higher current rated BJT or MOSFET.
  2. The NetDuino IO pins output 3.3 Volts, with an absolute-maximum current rating of 25 mA per pin, 125 mA total. Even if the 4n35 is to be used for optical isolation, which is its purpose, adding an indicator LED in series with the input of the 4n35 is not a good plan, as the voltage drop for the LED (e.g. 2.2 to 3.4 Volts) will leave too little headroom for the 4n35 internal IR LED (~1.2 to 1.5 Volts).
    • Using the LED in parallel with the input too isn't a good idea, since the current for the 4n35 (e.g. 20 mA) and for the LED (e.g. 10 mA) will add up as the load on the IO pin, thus loading the Netduino's GPIO pin beyond its rating.
    • In other words, either drive your indicator LED from a separate GPIO pin, or move it to the output side.

A high-level solution, leaving you to work out the specifics:

schematic

simulate this circuit – Schematic created using CircuitLab

  • (optional for isolation) Drive the 4n35 input from the GPIO pin with a series resistor to limit GPIO current to under 20 mA
  • Use the output to drive a MOSFET (or use a BJT with appropriate biasing if desired)
  • MOSFET (or BJT) as switch to power the motor(s).

Note that the motor will be on when the netduino output is low, and vice versa. The circuit can be reshuffled to eliminate this inverting of logic, if required.