New to arduino and need some help with power issue

Hi all,
As i said in the title i am new to arduino development (and electronics). i have been programming for a while now but although i know the software side the hardware side is a different kettle of fish.

so my question is as follows.

How can i give mutliple power sources to elements that i have hooked up to the bread board.

In my case I have a servo and a motor. if i have either one connected the standard usb connections powers each individually fine. however if i have both hooked up, it only powers the servo (and at a very low power as the servo runs slow (most likely due to the power being shared between both elements)).

so just to clarify a little i want to be able to run both the motor and the servo at the same time. i know i will need more power (maybe just a 9v battery for the servo and a 9v battery for the motor). However i just need some help in understanding how i will feed this seperate power to them.

If you need more info just ask and i will tell you.

Cheers
Mark

You should use some transistors and external power supplies (like batteries, as you suggested).

You attach the base of the transistor (Through a resistor) to and Arduino pin, which can turn on or off (and stages in between via PWM) the power flow.

When you use external power sources, you must always remember to connect the grounds (negatives) of the external sources to the grounds of the Arduino. IE, connect the negative of the 9 Volt battery to a ground pin on the Arduino.

Hi TchnclFl,
Thanks for the swift reply. I believe i get what you are saying. however i just have a little question with regards to where i connect the live and ground from the battery.

so on the bread board i have a strip for the live and ground which i use when plugin in the ground and the 5V from the arduino. now for the battery do i simply plug the negative into the negative strip and the positive into the positive or do i connect them in a different way?

Regards
Mark

so on the bread board i have a strip for the live and ground which i use when plugin in the ground and the 5V from the arduino. now for the battery do i simply plug the negative into the negative strip and the positive into the positive or do i connect them in a different way?

If the negative strip is connected to one of the Arduino's grounds, then yes, you plug the negative into negative strip.

However, if you plug the positive into the positive strip, you will be putting the power supplies in parallel which isn't really what you want to do.

You either need to make a new strip for the external power, or else only connect it to the motor.

You may also want to look up a transistor circuit to better understand it, if you don't already.

cool cheers TchnclFL, Thanks very much for the help i will have a look at it tomorrow as i am a little tired and need some sleep (it is 2:16am after all lol). Thanks again.
Regards
Mark

Happy to help :). Good night! :smiley:

When you wake up try looking at this:-
http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

Hi Grumpy,
Cheers for that i will give that a read so i understand more fully.

However, as it stands now my motor and servo both run. however with the dedicated power feed going to my motor my motor just does not appear to take any notice of the signals i am sending it through analogue(this worked before it had a dedicated power supply).

my motor (on pin 9) should accelerate up then down then stop then the servo should run then the process is repeated.

i have set the pin on the external power supply (for the motor) on pin 2.

at the start of the acceleration sequence i set it to digital write HIGH (to turn it on) then when it has finished accelerating i set it to LOW (to turn it off).

Have you any thoughts as to why it is not functioning as it should? my guess is that the external power is having some effect on the pulse that is sent to the motor so the motor never gets the speed it should be at and there for it gets just a standard HIGH LOW digital signal.

any thoughts much apprechiated and if you need more info let me know.

regards
Mark

i will give that a read so i understand more fully.

When you do that you will see you have not connected the grounds together. :wink:

i have set the pin on the external power supply (for the motor) on pin 2.

?????

Have a read of:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html
and
http://www.thebox.myzen.co.uk/Workshop/Motors_2.html

Hi Mike,
Sorry about that it was not that clear. when i talk about pin 2 i mean the following.

The transistor i am using for my external power source has its based bridged with a 2.2k resistor and then is then connect to pin 2 on the board ( to control its on and off state).

on the emitter of the transistor i have that grounded and then the collector i have connected to the motor which in turn has the collector from another transistor (the one used to control the motors acceleration and decelleration) the collectors of the 2 transistors only connect to one of the leads of the motor and then lead they connect to has a diode that hooks up the other wire of the motor.

hope that clears things up a little.
Regards
Mark

hope that clears things up a little.

Sorry even more confused.
If two collectors are wired together then you have what is known as a wired OR. This allows the collector to be connected to ground when either transistor is turned on. I am not sure if this is what you want to do.

my motor just does not appear to take any notice of the signals i am sending it through analogue

Do you mean through an analogWrite() command? All this does is produce a PWM signal. These are hard on and hard off repeatedly. The value you write in determines the time ratio. However you might be shorting this out with the second transistor.

It would be good if you could post a schematic of what you are trying to do

hi grumpy i will get the schematic drawn up for you (i was thinking of doing that as it hopfully should help a little) and yeah i do mean using an analogWrite().

I'll get the schematic draw up asap cheers
Regards
Mark

Hi Grumpy,
right i dont no how useful this is as i am no master at drawing schematics and i really have very little experience with the symbols apart from basic GCSE level in science.

anyway here it is
http://www.markwilliamdavies.co.uk/images/motor.jpg
Regards
Mark

Thanks for that. I have redrawn it a bit more conventionally:-

What you have as I said is a wired OR system. That means if pin 2 OR pin 9 is high then the motor will turn on.
There is little point in having one of these transistors fitted at all as all the functions can be done with just one transistor. So Tr1 (pin 2) could be removed and the motor is controlled with an analogue write to pin 9. To turn the motor off simply write a value of zero to it.
I suspect this is not what you were trying to do so could you explain please what that is and I will see if I can get you a circuit to do it.

Note that I have shown the battery connected to the same ground as the arduino and transistors.

Hi Grumpy,
What i was trying to achieve is have a dedicated power supply to the motor as i have a servo in the circuit as well.

Well this gives you that providing you use a different power source for the servo and make it's ground common with the rest of the circuitry.

what i was trying was to have the separate power supply on the motor and the servo just uses the arduino power.

Well that is what you have.

cool cheers for the help fella. i will give what you suggested ago and see how it turns out.
Cheers
Mark