Connect Grove Electromagnet to external power supply

Hi, I'm a beginner with Arduinos and trying to get the Groove electromagnet v1.1 to work, using an Arduino Mega but without a Shield. I am missing the very basics and have two questions:

The specification looks like this:

| Working Voltage: | DC 5V | | - | - | | Working Current: | 400mA | | Standby Current: | 200uA | | Load Weight: | 1KG |

  1. I already connected the electromagnet to the Arduino directly: Black -> GND, Red -> 5V, Yellow -> D2. I used the sketch that was provided and it worked. But it is very weak, because the Arduino can't output such a high current, right? How would a shield be able to increase the strength of the magnet?

  2. I have an external power supply with 5V 1A. Can I just hook it up to that or would I first need a 12.5Ω resistor to get down to 400mA?

Thanks already, Paniac

USB can provide 500mA, so its likely the performance you've seen with the Mega is all you get.

The 5V 400mA specification tells you the electromagnet has a resistance of about 12.5 ohms. Connect it to any 5V supply it will always be 12.5 ohms, and pull only 400mA (assuming the supply can supply at least that amount).

To get more current through it takes more voltage, as I = V/R

Note that that load rating of 1kgf is likely for ground-flat iron or steel objects - intimate contact with the electromagnet poles is needed for maximum force, any air-gap will drastically reduce the pull force.