KS0320 Keyestudio Electromagnet Module (Black and Environmental-friendly)

From Keyestudio Wiki
Jump to: navigation, search

Keyestudio Electromagnet Module(Black and Environmental-friendly)



This module mainly contains an electromagnet. A magnet that generates a magnetic field from an electric current.
It uses the principle of electro-magnetic. With a straight metal wire passing through the current, the space around the wire will produce a circular magnetic field. In order to concentrate the magnetic field, the coil inside the electromagnet is wound into a coil, and many lines are arranged side by side, so that all the magnetic fields of the coil pass through the center of the coil, forming a strong magnetic field there, which can make it absorb a 1kg ferromagnetic.
When using this module, you can control the electromagnet on and off by controlling the High or Low level on its Signal end.



  • Small electromagnet induction, with high strength suction.
  • Electromagnet built-in pure copper coil, strong conductivity, low power consumption.
  • Electromagnet electric iron shell, less remanence, integrated molding, strong magnetic conductivity.


  • Working Voltage: 3.3-5V
  • Wiring Type: 3PIN


Connection Diagram

Connect up this module and UNO board like this: SIG pin to Digital port 3, VCC pin to 5V, GND pin to the ground port. Shown as below.


Example Code

Now, open up the Arduino IDE and type in the following code:

int Solenoid = 3;    //define digital port 3
 void setup()  
  pinMode(Solenoid, OUTPUT);  //set Solenoid as OUTPUT
 void loop()                     
  digitalWrite(Solenoid, HIGH);// Solenoid is effective
  delay(2000); // delay 2S
  digitalWrite(Solenoid, LOW);  // Solenoid is non-effective
  delay(2000);  //delay 2S      

Example Result

After wiring, upload the above code to the board, if put an iron screwdriver close to the electromagnet module, they should be available to attract together for two seconds, then lose its magnetic attraction for two seconds, circularly.


File Download

Buy From