Mirko Pavleski
Published © GPL3+

Arduino Repulsive Electromagnetic Levitation

This is the simplest example of repulsive magnetic levitation.

BeginnerFull instructions provided19,218
Arduino Repulsive Electromagnetic Levitation

Things used in this project

Hardware components

Arduino UNO
Arduino 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

149 projects • 1283 followers

Comments