Mirko Pavleski
Published © GPL3+

Arduino Repulsive Electromagnetic Levitation

This is the simplest example of repulsive magnetic levitation.

EasyFull instructions provided3,489
Arduino Repulsive Electromagnetic Levitation

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Transistor BD241
×1
Linear hall effect sensor UGN3503
×1
RobotGeek Medium Solenoid
RobotGeek Medium Solenoid
×1
Big speaker magnet
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

schematic_9ULrNvjVUy.JPG

Code

Untitled file

Arduino
int set_point = 250;  // settings
int sensorPin = A1;
int output_pin = 2;
int sensorValue = 0;

void setup() {
  Serial.begin(9600);
  pinMode(output_pin, OUTPUT);
}

void loop() 
{
  	  sensorValue = analogRead(sensorPin);
    	//Serial.println(sensorValue);
      if( sensorValue <= set_point)
      digitalWrite(output_pin, LOW);
      else
      digitalWrite(output_pin, HIGH);
 }

Credits

Mirko Pavleski

Mirko Pavleski

4 projects • 89 followers

Comments