Driving a motor question

So I've been playing around with my new board. I really never had any intentions to build a robot but I figured it might be a good idea to learn as much as I can before moving on to serious projects.

I've been working on the ASK manual tutorials to get acquainted with basic operations. Project 11 deals with driving a basic DC motor.

A few notes though... I'm not using the exact parts listed on the project. I have a 10k pot, a 2N3906 transistor, and a 1N4004 diode.

I got everything together and wasn't able to get it running my first go. After being puzzled for a while I decided to try a smaller motor and got it working. The first motor I had was supposed to be rated at 3v-18v but at 3.15v I couldn't get it to drive.

My questions...

  1. What do I need to do to increase the voltage to the motor? ... my guess is just to switch the power on the motor from 3.3v to 5v+.

  2. If I do switch to 5v, what changes, if any, should I make to the rest of the circuit to make sure I don't damage my board?

  3. Can you please explain how a 10k pot affects this over the listed 4k pot?

  4. The transistor... I understand the basic concept, but don't fully understand a few things and I've tried to read up on a few sites but come away more confused.

a) Gain (Hfe) - please explain how this affects a circuit like this

b) I don't think I quite grasp the amplification aspect of a transistor. As I understand it, it seems more like a variable switch to me...not sure exactly how to ask the question to fix my confusion, maybe explaining a transistor from your point of view?

Anyway, thanks for the help!
Gannon

If you are powering the motor from the Arduino board your problem probably isn't voltage but current.

You should use an external powersupply that can provide more current than you can draw from the Arduino board. Also the 3904 transistor could be a little to small, the TIP120 can handle a lot more current.

Your 10k pot is fine, actually a 10k pot is the recomended value for hooking up to an Arduino analog pin.

Sorry for being off topic, but I've seen the diagrams above in many sites. Is there any software for generating those Arduino diagrams?

thanks.

fritzing

its the transistor + taking power from the arduino... try a transistor that can support more current..and an external power supply

  1. What do I need to do to increase the voltage to the motor? ... my guess is just to switch the power on the motor from 3.3v to 5v+.

As others have said really you could do with changing the voltage and possibly the transistor you are using to put a bit more current through it. The TIP 120 has been around for many years and is a good robust all rounder. If you posted a picture of the circuit diagram with the various components labelled we could suggest how to change it. I don't like directly coupling any load on to an output pin not even and LED and similarly I don't like noisy spiky things like motors using the same supply rail as a processor though I will readily admit I'm a complete noob on these boards.

  1. If I do switch to 5v, what changes, if any, should I make to the rest of the circuit to make sure I don't damage my board?

Post a circuit diagram and I'll tell you

  1. Can you please explain how a 10k pot affects this over the listed 4k pot?

You basically have two limits at the input pin on the board that is zero volts and full line volts and by putting a variable resister between the two you can generate any voltage between the two. The problems would be if you had a variable resister that was too high say 100 M ohm then though you are still generating the same voltage at the pin the current available gets too small for the internals of the processor to work on. On the other hand if you go too small ie a 0.1 ohm variable then the current going through the resister would be too large and would fry the PSU the resister and possibly other stuff. So in short the difference between the 4k and the 10 k should be negligible in this case and it is better to use the higher one as it uses less energy and thus generates less heat in usage.

  1. The transistor... I understand the basic concept, but don't fully understand a few things and I've tried to read up on a few sites but come away more confused.

I'm not sure how much detail you want here as you've already noticed it can be a pretty huge topic. I hope this helps :-
Think of a transistor as a tap in the middle of a piece of pipe.
You connect one end of the pipe to the water mains and with the tap closed you will see full mains pressure on one side of the tap and as the other end of the pipe is open to air you see no pressure on the other side of the tap.
As you slowly open the tap you will see the pressure on the mains side decay and by careful adjustments you can set this pressure anywhere between full mains pressure and atmospheric pressure. If you whack the tap open and closed then yes it acts like a switch but by careful design very small variations in the position of the tap handle can produce large variations in pressure. Does this make sense so far? Using a small pressure variation on the handle produces big variations in the pipe? Thus you have amplification the Hfe in this analogy is really how many turns you've got on the tap handle as it'll determine how big the variation of pressure is per turn. Back with transistor now the base terminal of the transistor is the tap handle and you use it in exactly the same way as the tap in the above example.
Say you have a 10v battery the positive goes to the collector of the transistor and the negative goes to the emitter then as the transistor turns on you have a bang as it shorts the battery so you put a resistor in the collector leg to restrict the maximum current flow you also need one in the emitter line for thermal runaway but this is a different talking point. Now with the transistor turned off you have 10v at the resister to collector joint as there is no current flowing, and with the transistor turned on you have near zero volts as the transistor is shorting the collect resistor joint to the negative rail. By applying the right conditions on the base you can achieve (like the tap) any value from 10v to 0 v at the collector/ resistor joint. The right conditions depend on what transistor and it's characteristics and how you arrange the circuit but let's just say a common example would to set it up in a single stage amplifier circuit and a change of 1 mV at the base can give a change of Collector voltage of 1V so 1000 times amplification. I hope I haven't been too simplistic I don't want to offend being a nooby. Incidentally once you add a load on the collector/ resistor joint you can no longer achieve the 10v rail supply at the joint as you have a potential divider with current going through your load with the transistor off and through the transistor with it on.

That helps a lot thanks Perfo.

Glad to be of service.