Current output from PWM pin

Hey!

First time posting!

When the Arduino outputs the PWM signal, what is the current it is doing that at? What determines it?

If I have an electromagnet at 5V, and its driver takes in PWM signals to drive and control it, what is the current coming out of the PWM Pin? does it use current from the 5V pin on the Arduino to power it or does it use the PWM current to do so?

Sorry for the basic stupid question.

Thanks!

Usually, vanishingly little current, unless the driver uses an optocoupler, in which case the pin has to power the input LED (a few mA).

For questions about specific modules and devices, always post links to the product pages or data sheets.

  • Time to learn what Ohms Law is about.
    V = A * R
    (Voltage = Amperage x Resistance)

  • Hence:
    A = V รท R

Output pins can supply 3-20 mA, depending on controller technology.

Thanks!

sorry, this is the link to the electromagnet, I asked them and they said max 180mA to power the coil. I wasn't sure if that's from the 5V output or from the PWM pin output.

But is there a way to calculate how much current is drawn from the PWM pin output to the CoilCell to control it?

Is it correct to assume that the 180mA to power it at max will come from the 5V Arduino pin (with a max of 500mA)

Thanks

but is that the current coming out from the 5V pin or from the PWM pin?

so v=5v, resistance based on data sheet 24ohm, so current max is about 200mA, but that from 5V or PWM pin?

According to the product page:

The CoilCell is a planar PCB coil with an on-board DRV8837

You can learn about the DRV8837 driver from its data sheet. It is a MOSFET driver and the current draw from a PWM output by a driver input pin is negligible.

Is it correct to assume that the 180mA to power it at max will come from the 5V Arduino pin

It is a never a good idea to use the Arduino 5V pin to power motors, servos or solenoids. Use a separate power supply and connect the grounds.

1 Like

See the data sheet of the

on-board DRV8837 h-bridge chip
Any PWM pin should work.

The Arduino is not a power supply. Use a separate 5V supply to power both the Arduino and the coil(s).

1 Like

V / R = A

5v / 24R about 200mA

  • However there is internal resistance on the Arduino output pin which needs to be taken into consideration And there is a maximum current that can be accommodated by the Arduino pin โ‰ˆ 20mA is safe.

  • Remember, current can go out of or into an output pin.

1 Like

okay I understand, so the 20mA current rating for the PWM Arduino output PIN is not important in this situation?

I will power it externally, but just to debug and play around, the 180mA from the 5V should be okay?

The data sheet mentions a 0.1mF capacitor between Vcc and ground for the driver, what is that for?

Thank you so much for all your help!

thank you!

For reducing the severe voltage transients in the power leads, induced by switching transients.

just to debug and play around, the 180mA from the 5V should be okay?

Absolutely not OK. See the linked article. But Arduinos are cheap, if you want to "play around" and don't mind replacing them frequently.

I see, I just went through that link.

Can I ask, does this spiking not happen with an external power supply? Will the problem powering with an Arduino be that I fry my coil cell with high voltages?

will the addition of the 0.1mF capacitor not sort that out?

Why cant the 5V from the Arduino be trusted compared to say the 5V outputted from a portable battery pack usb output?

You're a legend, thank you

Nothing to do with "trust".

The problem is that Arduino MCUs can instantly be destroyed by voltage transients produced by motors, servos and solenoids, or the on board voltage regulator overheats and melts down internally.

2 Likes

The driver should protect the Arduino from excess current and from the solenoid's inductive kick-back.

Ideally, the 5V power to the driver board shouldn't go through (or come from) the Arduino. But with 5V to Vin, or with USB power, 180mA is OK.

If you are using the Arduino's on-board voltage regulator, things get "fuzzy". The heat generated from the regulator depends on the voltage dropped across it and the current through it. 12V into the voltage regulator is "worse" than 7V, but 180mA should be OK either way.

The voltage regulator is also thermally protected. Worst case, the Arduino should just shut-down or "glitch". It's shouldn't burn up & die.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.