Go Down

### Topic: Mega 2560 Current/Voltage Output Questions (Read 3350 times)previous topic - next topic

#### sygmatious

##### Jan 24, 2015, 12:28 am
Hello,

I am a novice, still learning the in's and out's of working with the arduino.  I am currently trying to work with increasing the current/voltage by creating a circuit on the bb and powering it with a pin from the arduino.  Here is my issue:

I read that the pins were only able to support 20mA-40mA each.  Without connecting anything to the pin (other then my volt meter) I get about 80mA per pin and about 900mA if I measure the current between 5V and ground.

my question is, am I supposed to throw in the resistors myself to limit the amperage or is my board wonky?

Are there any reference sites anyone can recommend to help me with creating a voltage/current multiplier?  I'd like to eventually power up some motors and such and I can't seem to find a proper are for the information.

#### Peter_n

#1
##### Jan 24, 2015, 12:46 am
Use a maximum of 20mA for the Arduino pins.
Only if you are an advanced ATmega chip programmer, you could combine a few pins to increase the total current by using register programming.

I made a voltage multiplier with the Arduino : http://forum.arduino.cc/index.php?topic=142097.msg2016503#msg2016503

When you want to drive a motor, you need a transistor or a mosfet or a H-bridge chip or a driver board. You would also need an external power supply.

#### nickgammon

#2
##### Jan 24, 2015, 06:08 am
I read that the pins were only able to support 20mA-40mA each.  Without connecting anything to the pin (other then my volt meter) I get about 80mA per pin and about 900mA if I measure the current between 5V and ground.
Do you mean you put your meter on current mode and stuck it onto the pins? That is a pretty sure-fire way to damage your output pins. And the voltage regulator on the board. Basically you are measuring how much the pins can deliver when they are way over the absolute maximum ratings. Keep at it for a few minutes and the measurement will drop to zero as the output drivers fail.

Quote
Are there any reference sites anyone can recommend to help me with creating a voltage/current multiplier?  I'd like to eventually power up some motors and such and I can't seem to find a proper are for the information.
Get the pins to drive transistors or MOSFETs which will run the motors. I'm sure if you Google how to do that you will find lots of examples.
Please post technical questions on the forum, not by personal message. Thanks!

#### sygmatious

#3
##### Jan 24, 2015, 06:59 pm
Transistors, mosfets or H-bridge for amplification of motor's and such.  I will make sure to look into that soon.  Thank you for the information.

So my board isn't acting wonky?  I was trying to test the pin out current & the current between the 5V and ground directly and I get that 80 mA & about 900 mA respectively.

I'm assuming that this is what the board is supposed to output and I am supposed to do my thing when it comes to current dividing and all that jazz?  I'd like to make sure I didn't get a bum board.

I don't leave the meter connected to the pins for long, just for a couple of seconds until the numbers stop moving.  All I did was this simple code to test out my pins for output:

void setup(){
for (int i = 0; i < 54; i++)
pinMode(i,OUTPUT);
}

void loop(){
for (int i = 0; i < 54; i++)
digitalWrite(i,HIGH);
}

I read on the product description that the outputs are supposed to be much less, about 40mA & 200-400mA max for the pin output and 5V/ground output respectively.  When I test out each pin I get that 80mA.  I tested each pin separately by connecting a jumper to the board where my meter was already connected to ground and waiting for the output.

ONE MORE QUESTION:

I'm having trouble with an external power source.  For instance I have this relay shield by seeed studio http://www.seeedstudio.com/wiki/Relay_Shield_V2.0 .  How do I connect an external power source when it doesn't come with that connection?  This is why I am trying to build a circuit on the breadboard that will amplify my voltage so I can power up this relay shield properly.

If creating a circuit to be powered from the arduino is not a good way to go, how else can I tie up the relay shield and microcontroller into a neat package that is mobile and does not require a high voltage power source (like say I wanted to place this stuff in an RC vehicle)?  Are there specific batteries for this purpose?

Again, any links or pointing into the right direction would be great.

#### Grumpy_Mike

#4
##### Jan 24, 2015, 08:10 pmLast Edit: Jan 24, 2015, 08:11 pm by Grumpy_Mike
Quote
I'd like to make sure I didn't get a bum board.
You soon will have if you carry on trying to test it like that. You have already damaged the output and it will fail before it normally would have none.

Quote
For instance I have this relay shield by seeed studio http://www.seeedstudio.com/wiki/Relay_Shield_V2.0 .  How do I connect an external power source when it doesn't come with that connection?
Why do you want to connect an external power supply to this? It takes the power to drive the relay from the Arduino's power supply.
Quote
does not require a high voltage power source
The relay board does not need a high voltage supply.

Quote
This is why I am trying to build a circuit on the breadboard that will amplify my voltage so I can power up this relay shield properly.
That makes about as much sense as putting a meter set to current across a power supply. That is no sense at all.

http://www.seeedstudio.com/wiki/Relay_Shield_V2.0

#### nickgammon

#5
##### Jan 24, 2015, 09:30 pm
Quote
I was trying to test the pin out current & the current between the 5V and ground directly and I get that 80 mA & about 900 mA respectively.

I'm assuming that this is what the board is supposed to output and I am supposed to do my thing when it comes to current dividing and all that jazz?
No, as I said earlier, that is not the way to test the board. The datasheet for the processor states how much current a pin can drive (source) and that is around 20 mA continuously. You can source 40 mA briefly. After that you are damaging it.

That's like getting into your car, jamming your foot to the floor on the accelerator, in first gear, measuring that you get up to 20 km/h while the engine is screaming in agony, and then deducing that it is "supposed" to go that fast. No, it isn't.
Please post technical questions on the forum, not by personal message. Thanks!

#### sygmatious

#6
##### Jan 24, 2015, 10:47 pm
Grumpy, if you read the relay shield info, you will see a diagram that shows the green "pins" are to be connected, 1 to the positive of the motor, and the other to an external power supply.  The relay's will not kick in unless an external power supply is added to the green com "pin".  It can handle up to 30V, so I am assuming I can eventually power up some sort of device that will require more then the original 5 volts being sent from the arduino.

If I cannot plug in a power supply to said device, that is mobile, there is no reason for me to use the shield at the moment, since I am looking to build something that will not be restricted to using AC.

I'm just trying to wrap my head around how these micro controllers work.  As I said in my original post, I am a novice and I was assuming many things about this board and how it works since I don't have any real guide.  I just bought a bunch of pieces and started putting things together.

For instance, when I read that the max output per pin was 20 mA, I assumed that right out of the box, when the pin is set to output high, it would just output 20 mA.  I didn't realize I had to reduce the current manually.

Thanks for the help Peter & Nick.  Much appreciated!

#### Grumpy_Mike

#7
##### Jan 24, 2015, 11:12 pm
Quote
The relay's will not kick in unless an external power supply is added to the green com "pin".
No, that is incorrect.

You have missed the whole point of relays.
The relay kicks in when current is placed through the coils, this takes 5V from the arduino.
On the diagram labeled A motor control application with one relay and one motor is shown below:
The bit labeled control circuit is the 5V from the arduino that makes the relay kick in, not the power supply that is in series with the load.

The com connection as you call is is a common connection of the single pole change over switch, there are then two contacts normally closed and normally open or NC and NO. They are simple switches, they don't need power. What needs power is what you are trying to switch on, like a motor or a lamp. See the diagram with the title:- Motor and Relay Shield schematic. That power is ONLY for driving the motor, it has nothing to do with the operation of the relay.

#### nickgammon

#8
##### Jan 24, 2015, 11:33 pm
Here's an analogy. Say you buy a truck, and it is rated to carry a ton of bricks (according to the instruction manual).

Now you can carry less than a ton, no problems. And you can even put more than a ton on, and it will keep working for a while. But if you try carrying ten tons it will probably fail quickly. And seeing that it "seems to work" for a minute, with the ten tons, doesn't prove that it will work for a long time.

The truck, however, does not have a "tonnage" limiter on it. There is no way of telling how much it can carry simply from trial and error.

Quote
Are there any reference sites anyone can recommend to help me with creating a voltage/current multiplier?
I suspect we have an X-Y problem here. Instead of asking about current multipliers, describe what you want to really do.

I gather so far that you want to drive some sort of motor (what sort?) using a microcontroller (which does what, exactly?) to operate some sort of battery-powered thing.

Now, more details about what your project is, will get you more useful responses.
Please post technical questions on the forum, not by personal message. Thanks!

#### sygmatious

#9
##### Jan 25, 2015, 07:23 am
Thanks for clearing that up Grumpy.

As far as what I am looking to do, basically I want to get large electric motors, one for each wheel (4) and power them up to near maximum capacity.  I don't really care if I break something I'm just looking to learn how to power up high voltage/amperage devices without having big bulky batteries and the such.

Like I said before, I'm not worried about breaking stuff or burning things out or even how long it will last.

I'm basically looking to learn how to extend the voltage/amperage of the micro controllers in order to power what I'd like to make, which is a 4 motor, 4WD RC car. I don't want to buy a kit and put the pieces together.  I am most likely going to need to fabricate a bunch of parts but before that can happen I need to learn how to properly power these 4 motors.  My problem is that I don't think it can be done with a simple 5V output.

This is why I am assuming that some sort of voltage/amperage amplification is needed in order to power the motors, while maybe not to their max, to at least 70% or so.

I hope this helps clear things up.  I hate making things complicated for people, which I usually tend to do.

#### nickgammon

#10
##### Jan 25, 2015, 08:11 am
I think you need to turn your thinking around a bit. Instead of wanting to "amplify" the output of the Arduino, think more of using the Arduino as a switch.

For example, a switch that a toddler could press, might turn on a huge machine. You aren't "amplifying" the toddler's fingers, you are merely using them to control a switch.

Likewise, an Arduino can switch on or off a MOSFET, and that MOSFET can let current flow, or not flow, from a high-current source.

If you do this, you can get close to 100% power. That is, once the switch is closed, it lets a lot of power flow, from the source of the power to the motor.
Please post technical questions on the forum, not by personal message. Thanks!

#### nickgammon

#11
##### Jan 25, 2015, 08:15 am
As an analogy, when you get in your car, and press down on the accelerator, the car does not "amplify" the pressure of your foot, and turn it into movement. Your foot merely controls the motor. Your foot is a switching device: pressed, the motor powers the car, not pressed, the motor does not power the car.
Please post technical questions on the forum, not by personal message. Thanks!

#### Paul__B

#12
##### Jan 25, 2015, 08:46 am
Like I said before, I'm not worried about breaking stuff or burning things out or even how long it will last.
Well so far you are certainly going to be putting that to the test.  We hope you bought not one, but a dozen Arduinos to use for your "smoke" testing.

I'm basically looking to learn how to extend the voltage/amperage of the micro controllers in order to power what I'd like to make, which is a 4 motor, 4WD RC car. I don't want to buy a kit and put the pieces together.
Given your present comprehension of electricity, that is precisely what you need to do right now.  Go buy a complete kit, assemble it carefully and play with it.  Read up on how the parts work, and make some measurements.  Once you understand each part, you might then be in a position to make some adaptations.  Eventually you just might have the skill to build another from scratch.  Whatever you may imagine, it is clear to us that you do not at present.

Going again for the metaphor, if your car battery is rated for "300 amps cranking", what you do not do (unless you really are into serious destruction and have an unlimited medical policy) is to short circuit it with an ammeter.  Even one rated at 500A.  Surely you realise that makes no sense?  Do you understand why?  Neither should you abuse a microcontroller in that fashion.

#### raschemmel

#13
##### Jan 25, 2015, 08:34 pm
Another episode of "NOOBS GONE WILD !"

Go Up