Aruino Amperage

I am having issues with my Arduinos (Mega 2560 & Uno R3) and they are not outputting their rated amps.

void setup() {
    pinMode(7, OUTPUT);
    digitalWrite(7, HIGH); 
    Serial.begin(115200);
}
void loop() {
    digitalWrite(7, HIGH);
    Serial.print("ON. ");
    delay(5000);
    digitalWrite(7, LOW);
    Serial.print("OFF. ");
    delay(5000);
}

As you can see, its super basic code, but my multimeter is reading 0.7mA output when the pin is on, with both boards. the datasheet says it should be outputting 40.00mA per I/O pin.

I think it may be an issue with my code, but I think I could also be something else I'm missing as I am new to this.

Any help would be great :slight_smile:

Welcome to the forum

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

What are you using as the load on the pins when you measure the current ?

Are you familiar with Ohms Law ?

What's the load on the pin? Just because a pin is able to give pinAmps does not mean the pin will output max pinAmps all the time. The current drawn is dependent upon the load requirements. It comes back to

?

1 Like

The result is the same, with or without load. The intended load is a 24v relay but my issue is that it isn't being triggered as the .7mA is too low.

How are you measuring the current without a load attached ?

What is the resistance of the relay coil ?

Which 2 pins on the relay are connected to its coil ?

Please don't tell me that you have got the multimeter on a current range when using that circuit

Double check. Chances are good you are actually measuring 0.07A or 70mA. The data sheet doesn't say "it should be outputting 40.00mA". It says 40mA is the maximum that you can draw without damaging the pin. So you are either measuring 70mA, or a damaged pin measuring 0.7mA.

The sensible place to put the probe would have been in series with the line to the relay board, which would tell you the actual current into the relay board. Instead you short circuited the pin.

If you are powering a bare relay, don't. You need an interface circuit, that is why people use modular relay boards.

1 Like

This is a datasheet for the relay.

If you look at some of the diagrams on there, it shows all the pins and what they do. The ones I am connected to are the IN1 (relay control 1), VCC and ground. The 24v side of the setup is connected to a pump controller and is working and connected properly so that isn't the issue.

The multimeter is set to mA so I'm certain of the result.

If the relay is has opto-isolation circuitry, then there should be no problem driving the relay. If you are trying to directly drive a relay coil. You'll be needing to have a spate of on hand replacement MCU's.

So we don't play 1000000's of questions and you don't feed us the deets in little pieces. Just fully explain the project.

Post the schematic and images of the project all wired up.

How is the relay module configured to run? Is the relay module powered by the MCU? Just post a schematic and pics, please.

1 Like

The output on the relay (24v side) will read 24v if the code is on or off regardless. The relay is connected to a pump controller. I am connected to a logic I/O port which responds to our non-Arduino interface, have a look at page 5 for the logic I/O port.

Dumb question i know, but how can i measure it in series, i thought measuring across the connectors would be fine?

Break the circuit at some point and connect the multimeter across the gap in the circuit

Make sure that the meter is on a current range and that you are using the correct sockets on the meter. Some meters have one common socket and separate sockets for current and other measurements

1 Like

Measuring across the connectors puts a dead short on the pin, because that is what a current meter looks like. It is basic electricity theory, measure across the load for voltage, measure in line with the load for current.

So you might have damaged the pin and you will have to try another.

No it does not say that at all. It says:-

See the bit where it says prolonged use at that level will cause damage. Notice this is not the maximum the pin can supply, but the maximum it should supply.

In fact depending on the load the current can be almost double this absolute maximum. Which kills the pin a lot quicker.

It is normal to consider 20mA as the rated output, you can push this up to 30mA with some reduction in voltage but never run it any harder.

It shows the maximum operating voltage as 6.0V but as the notice says it might not work at this voltage. We had a user recently that mistook that figure as the maximum they could apply and still have it working. He was wrong.

1 Like

Thank you for being straightforward. I am new to this.

This is a simplification as this is free software and doesn't have all the parts i use. Resistor representing the load on the circuit and relay showing how one of the modules would be connected. Arduino wont allow me to upload more than one photo at a time as this is a new account

I understand these are maximums and running them at those values will cause inevitable damage, but the load required as shown in the relay datasheet is 5mA which is far below any damaging value. I have since tried new pins and measured in series for the current and there is no change.

Is it safe to assume this is an electrical fault and not a code fault?

It is a pity you wasted it on such a useless diagram.

So it is not worth posting as it gives zero information.

Yes but the load was not your relay it was your meter.

How does the power get from the Uno through the breadboard to the relay coil?

From the pic the red line from the relay goes to the breadboard power rail but nothing is connected to the power rail.

Yes there is a red line from the Uno to the breadboard. But there is no connection from the + side where the Uno connects to the other side of the breadboard.

As a note the Uno is NOT a good power source for the relay coils. Especially 8 relay coils. The relay module should use an external power supply instead of sucking power from the Uno.

1 Like

Also the relay positive is shown as being on the same rail as the relay ground. Which as pointed out is not connected to anything.

That's not very nice.

and also,

My colleague, a chartered electrician, has seen the setup and has verified me it is sound. He has measured the current, in series, on the Ardunio side of the relay, and has shown it is not drawing enough current from any of the digital pins.

That is a good note, I can add a 5v supply now and test it. Thank you.

I messed up the layout and forgot the 24v supply.