what is the best way to attach a dc motor to the bbb without a cape or motor controler???
thanks so much,
JonnyZ
Be sure to click 'more' and select 'suggest as answer'!
If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!
what is the best way to attach a dc motor to the bbb without a cape or motor controler???
thanks so much,
JonnyZ
Hi Jonny,
i am sorry to tell you that you can't run a DC Motor from BBB as the out put current from the GPIO's is very low only about 4 to 6 uA. So the motor will not run because of lack of power. I would suggest you to use the L293D Motor Driver IC.. And You can also run a micro servo directly from the BBB.
Hi JohnnyZ,
I agree, you'll need some additional circuitry, you won't get more than a few mA out of most of these types of boards. It depends on the type of motor (e.g. a small DC hobby type motor may require just a few hundred mA current at a low voltage) and whether you need bidirectional control. Something like L293D as mentioned is a popular method. You don't necessarily need a cape, but you do need some driver (e.g. transistor or mosfet based or maybe even a relay) if not a dedicated controller circuit/board.
To control I/O pins, there are lots of options, depending on the programming language you wish to use. Bonescript is one method you may wish to try, since it is built-in to the default image. Adafruit has Python tutorials. There is a C library for I/O too.
Assuming your DC motor is (say) 6V or 12V and uses just a few hundred mA, then L293D is not a bad choice for experimentation purposes - there are some cheap pre-built boards from China on ebay.
what i meant was possibly through a transistor and then have a resistor isolating the beaglebone from the other power supply
i just wasn't too sure as to what would damage the board or not, and how to handle the spikes when the dc motor turns on or off
Hi Jonny,
If you're talking about a smallish motor (say a few hundred mA and maybe no higher than 12V) then a single BJT/resistor is fine (resistor of maybe 1k in series with the base of the transistor). Note that you may need a darlington type arrangement because the gain of the transistor may likely not be sufficient. Yes definitely place some diode across the motor it will fail without it - a small 1N4148 should be fine for a small motor. And a capacitor, maybe 100nF across the supply rails. (Also, you may need to power this from a separate supply, rather than from the BBB header, unless it really is a low power motor. Some motors don't need a lot of current at all, but some do :-(
Hi Jonny,
If you want to eliminate spikes produced by the motor connect a small ceramic capacitor say 0.1mF parallel to the motor, i do this regularly with my projects to handle the spikes which burned my ic once...
Thanx guys so much for all da help!!!
JonnyZ
Jonny Z wrote:
i just wasn't too sure as to what would damage the board or not, and how to handle the spikes when the dc motor turns on or off
The standard way to prevent spikes form motors or other inductive loads is a Flyback Diode. If you drive a motor directly through a transistor, everything is fine until the transistor turns off. The current still needs to flow through the motor until the magnetic field collapses, and since this current can't go anywhere the voltage builds until it finds something to zap, such as the transistor. The flyback diode provides a safe way for the collapsing current to flow back through the motor.
You might find this Raspberry Pi thread useful: Raspberry Pi • View topic - Relay not switching.... The OP was having trouble getting enough current through a relay using a single NPN transistor, but a Darlington pair "did the trick".