Less power through digital pins?

Hi, This is probably a stupid question, but why am I getting less power through the digital pins than if I connect directly to the gnd and 5v pins? I know this because if I connect a small motor to the 5v and gnd it spins a lot faster than if i connect it to digital pins (such as gnd and 13) and then switch it to HIGH. I thought setting it to HIGH would connect it to the 5v line?

I do hope it's a very small motor, because if it isn't you've probably drawn too much current from your I/O pin (or sunk too much). (Note: even tiny phone vibra motors can pull twice the allowed current)

According to the AVR datasheet, a HIGH with a supply voltage of 5V has a minimum voltage of 4.2V, sinking 20mA.

Oh ok. Is there any workaround to this? If it does connect it to the 5v line, what is limiting it and what is the difference between that and a digital pin?

Yes, you can use a transistor. Have a look around the playground or here on the forum.

What sort of motor did you use?

The motor is RF-300C-1427 which should have a voltage between 1.3 to 2.1V. It is from an old Teac walkman. How exactly would I use a transistor? Will I need many of them?

The motor is RF-300C-1427 which should have a voltage between 1.3 to 2.1V. It is from an old Teac walkman. How exactly would I use a transistor? Will I need many of them?

The best way (simplest, cheapest, etc.) cannot be told unless you can determine how much current the motor consumes at it's rated voltage. If you could wire the motor to an adjustable voltage source set at 2.1vdc and then measure it's current consumption, then we can give you the best method. It could be as simple as having a series resistor between the output pin and the motor, if the motor current is 40ma or less. You really should not be connecting a motor rated at 2.1vdc max directly to 5vdc anyway.

Lefty

Ok so basically I shouldn't be using a motor like this.

On another note, I have one of those Cybot robots (you collect parts from a magazine to make this robot). Anyway, it has a motor driver chip which has an 8 pin input to control it, a power source input, and two outputs (one for each motor). I've connected up the 5V power source from the arduino board to the power input of the motor driver and then connected the digital pins from the arduino board to the 8 pin inputs (only the first four) which work by having a HIGH or LOW input voltage (which I believe is 5V). Now, the motors work when I set the output to HIGH through the digital pins.

I have two questions, is this safe, will it damage anything? And is there some way I could control the speeds (I can't use the analog PWM thing).

Thanks.

(I can't use the analog PWM thing).

Why not? And it is a digital thing.

You need to know a lot more about what you have than you have told here in order to answer your question? What exactly is the part number of this device?

will it damage anything

Have you got a diode across the motor, is it one way or two way drive?

I thought I couldn't use the PWM pin because the motor is either in HIGH or LOW modes to turn it on and off respectively (and no in-betweens).

I am quite new to electronics though I have some first year engineering experience in circuits, though still fairly noob in using arduino and components.

There are many diodes on the motor controller as well as capacitors. I don't know about one-way/two-way drives but a different pin must be set to HIGH to spin the motor backwards.

Also, here are links to descriptions of the motor controller: http://www.mstracey.btinternet.co.uk/technical/Actual/Motorctrl.htm and http://www.lpilsley.co.uk/cybot/driver.htm

pwm is more like quickly flicking a light switch to make the light appear 50% less bright (or whatever the target is)