Switching a circuit from a 2 wire dc motor to 3 wire motor

thanks for checking out my question. I am an extreme newbie (having done software all my life, hardware is making me feel super dumb), and big picture is I am trying to replicate this work: http://words.iame.li/post/112091812552/buttonpusher although he seems to be taking some shortcuts which I don't quite understand (where does the yellow and green wire go on the pi? How does he join the green wire up to the power supply?)

As part of my learning, I decided to do it by steps on an established kit. I have just completed this circuit: https://www.sunfounder.com/forum/superkit-v2---lesson-7--dc-motor?p=2

as you see from that rather complicated chart (which i assume is for protecting the RaspPi) the motor is ultimately powered by two wires, positive and negative.

I now want to take this setup, WHICH WORKS!, and apply it to the Futaba servo which he uses (https://www.amazon.com/Futaba-FUTM0031-S3003-Standard-Servo/dp/B0015H2V72) but simply plugging in my wires to the red and black receptors of the Futaba servo didnt work, presumably because I need a neutral wire to ground the new white wire from the Futaba? I must be sounding so retarded now to you guys, but I appreciate any and all tips as to fundamental concepts i must go and learn and terms and things i need to google. Please help!


The standard motor they use, and a standard Futaba servo, work in different ways.

A standard permanent magnet DC motor just turns continuously when you apply power to it, speed more or less proportional to voltage, or in the case of PWM, to duty cycle. It's just dumb physics-obeying hardware. The L293 is a power switch, a full H-bridge, which takes the low power logic levels from the Pi, and switches higher currents capable of turning the motor. It can drive +/-, or -/+ to the motor to make it turn in either direction, those wires to the motor are not power supplies or always +ve or -ve. U2 and 3 are opto isolators, for bomb-proof isolation between the Pi and the motor and its power supplies, but not absolutely necessary for function.

A standard servo contains a motor in it somewhere, but has a very different function. It is intended to go to a specific shaft angle within an angular range of about half a turn. It is used for controlling rudder and throttle position on radio controlled models. It contains a gearbox, position sensor, and some comparator and drive electronics. The desired angle of the shaft is encoded in the length of logic pulses sent into the white wire. A 1.5mS pulse is central, 1mS full left, 2mS full right. Typically, pulses are delivered every 20mS or so. In the absence of a pulse, it will hold the last position.

If you want to drive it directly from your Pi, connect red and black supply wires to +5 and gnd respectively. Connect the white wire directly to the one of the GPIOs, or to the output of either U2 or U3 if you want the opto-isolation for safety, or via the 1k resistor (some protection) that your first project uses. Use your software skills to generate a stream of pulses on the GPIO, length 1mS to 2mS, 20mS apart.

I've not looked myself, but I would not be surprised at all if you googled 'pi servo open source', and found stuff ready to run that would put the right sort of pulses onto the GPIO.

The author of the first project was misleading slightly when he said 'the servo spins for a few seconds', because it doesn't, it just changes position (noisily, over a second or so) to push the button.

If you connected red and black from your servo to the output of the 293, I hope it didn't go bang when you applied reverse voltage to it. I would hope that as servos are designed to be supplied by batteries (which can be reversed) and used by youngsters, they would be designed to survive supply reversal.

In software terms, what you're trying to do is plug a USB lead into a 3.5mm audio jack! Both have their standards and levels of complexity, but you're lacking the experience at the moment to anticipate how different.

Category: dc motor Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.133 (s). 12 q(s)