Run motor from rc helicopter through Arduino

Hi,
I just took apart my rc helicopter S022 (I lost the remote). Just for a start, I was trying to simply power the motor through Arduino.
The motor has no specs, so I don't know what resistor (if any) I should use because I don't want to burn out the motor.
The motor has just 2 wires - red and black. I connected the red to digital pin 6 and the black to ground.
But do I control the motor through analog or digital write? How do I control how many Volts are applied?
When I tried analogWrite(motorPin, 150) nothing happened except for something that sounded close to a quiet beep (like voltage was applied), but no motor movement.
What's wrong?
Thanks. Any help is appreciated.

You dont like your uno do you you can't run the motor from a pin off the uno
You need more power or even volts that the pin can output 40ma 5 volt max that motor may us over a AMP.

You'll need a transistor as switch Arduino Playground - DCMotorControl

I have a transistor. I also have a 9V battery ready to be connected to Vin.
What do I need to power my transistor and make it work?

You say you don't know the specs of the motor. Do you know what battery was used with it before?

7.4V battery that says:

7.4V
702540K
-031

Not sure what battery that is. It looks two cell.

What do you need that motor to do for you? Fly, or ?? If you want to to fly you may need the full voltage, and amps, but for most other uses, the 5 volt would probably be just fine.

For right now just get it to spin (to a desired speed).
The image at the following link looks like the one I'm using (but the words on the front look wrong and there the back on mine is the same on both sides).

Here's a better link:
http://www.rchelicoptershop.com/rc-helicopter-parts/toy-helicopter-parts/syma-s022-parts/syma-li-po-battery-for-s022-chinook.html
That's the battery I have. Any more info about it would be great.

Ok,

I have a transistor.

Is it npn or pnp, or better yet what is it? TIP120, or what?
If you hook the motor across the 9 volt battery, does it spin as you would expect?
Do you also have a diode we can place across the motor to help protect the transistor?
We are just about there.

Once we get all these parts in place, what do you want the arduino to do first, Turn the motor on and off ever second. (Just first test?). Sounds good. Use the blink example program (have you got that working yet?), then we can change the output pin to control the transistor. (I am hoping that is an NPN transistor). Let us know .
It's getting sorta late here. If you don't hear back, that means I have turned in for the night, and will be back on tomorrow.

I'm not sure, but I got the canaKit for arduino (sparkfun inventor's kit) and am right now using the online manual for the motors on page 67 of the manual:

One problem is I'm missing my diode (for right now I can't find it).
Without the diode, the gear on my motor moves a drop, but it I think is too much torque to turn the bigger gear which turns the propeller.

Update: I connected the + and - pins from my 7.4V battery to the breadboard circuit. Pin #6 was connected to 330 Ohm resistor to the middle pin of the transistor. The 7.4 V were connected to the motor, and the ground of the motor was connected to the collector. The emitter was connected to ground of the battery. When I turned it on, the motor turned fast. I'm worried something will burn out if I apply to many amps or something.

Here is a link that has a video that really explains a lot of what you are looking for. I hope it helps.

I found 4 of these things on my circuit board of the helicopter. By the letters and numbers on it, I found the product online:
http://pdf1.alldatasheet.com/datasheet-pdf/view/85382/FAIRCHILD/FDD8896.html
So it's a semiconductor resistor (I believe).
So what does all of that data mean? Am I able to use my 40V 200 milliamp resistor? The semiconductor's datasheet says 30V 94A 5.7 milliohms.
There are normal yet strange results when I make my motor spin but it's hard to explain:

  1. Doesn't seem like I can set the speed.
  2. When I tried a for loop for speeding up and down, it didn't work.
  3. When I press reset when the motor is spinning to restart, the motor just goes faster (I assume it's a build up of power in the resistor)
  4. Sometimes, the motor just makes a very quiet noise as if there's voltage of some sort applied, but not enough to spin the motor
  5. When that happens (not sure if this is always true), if I nudge the gear/propeller, the motor starts spinning.
    What does this all mean? How can I fix it (without buying extra parts other than what's in my kit)?
    Thanks.

Please give us a schematic. If you have a camera, you can draw it on paper, and take a photo.

A schematic of what?
I tried following the lines on the circuit board but there's no lines to follow.
Do you want a schematic of the breadboard circuit I made?
My father knows all about current, circuits, resistors, voltage, transistors, semiconductors etc. (mechanical engineer) so he's telling me about voltage dividers and how to make one.
See attachment for schematic of my circuit.

Schematic for Heli Motor Control.txt (657 Bytes)

Ok. Looks like your hardware is hooked up alright.
Now you want to try to make the arduino control the motor.
Try the blink program, and use your pin D9 rather, or in additional to the pin D13

That should make the motor turn on and off.
About my bed time. I will be back tomorrow.

Last night I managed to get it to go alright.
However, the motor won't budge until you give the gear a small push to start moving. The reason why that's so is because that small bit of friction it makes gives a little more power to the motor, and because that helps the motor overcome the torque and inertia.
Doing that only starts working when the pwm is set to 45-255.
As a side point, the transistor gets slightly hot when I run the program (especially when I try to do two motors from the same transistor).
When I tried doing 2 motors at a time, it seems like they split the current between the two so they were going very slow.
The motors have not heated up at all so maybe it's not anywhere near it's max current so I can get a better battery?

You could be loading down your battery. Check it with a volt meter, while the motors are running on it.
It would be normal for the transistor to get hot. As a rule of thumb, if you can hold your finger on it for 5 seconds without getting a blister, it is not over heated.

I'm going to try hooking up my 9V battery to the motors.
If 4 motors are running on a 7.4V battery, then on max speed, each motor is getting 1.85V.
If none stop, then each motor is getting 1.85V.
If one stops, then 2.46V are going to each of the other motors, giving them a boost.
If two stop, then the other two have a major advantage, 3.7V each.
If three stop, then remaining motor has a full 7.4V!
Problem 1) The motors are never running full throttle which doesn't make sense
Problem 2) Programming with quadcopters/helicopters gets hard because when you try to balance it by giving a slightly less Voltage, the other motors go stronger and unbalance it [so I'd have to distribute the voltage programmatically so no undesired effects happen.]
Is that semiconductor I found fixing that?

Things don't seem to be working anymore.
Both motors won't run.
I checked the resistance of the motors and that's normal. But when I tried measuring the voltage of the 5V and gnd pins, I couldn't get any reading out of them! I don't know what to do. Something wrong with it? Is it my meter or is it the arduino? Is it the shield that's on the arduino? Help please.

If you want the helicopter to fly, you need to test the motor with the helicopter rotor attached.
Helicopter motors draw amps , not ma , which is one reason that model helicopters use lipo batteries.
Model helicopters also have ESCs on the control board to power the motors.
You need to use the hardware in the helicopter to power the motors.
It may be possible to use the arduino to control the ESC in the helicopter to control the motor speeds.
If you know the AH capacity of the helicopter battery , and the average flight time , you can work out
the average motor current.