Floating Globe Project: A DIY Levitating Globe with Gesture-Controlled LED Lights | Kids Robotics

Floating Globe Project: A DIY Levitating Globe with Gesture-Controlled LED Lights | Kids Robotics
Robotics Project · Ages 10+

Can you control a planet without touching it? Build a globe that floats and glows when you wave your hand

A lightweight globe hovers in mid-air above a base. Swipe your hand over a small sensor and the planet changes mood: ocean blue, forest green, sunset orange. A ready-made levitation module does the floating, and an Arduino reads your hand and paints the glow.

Try it: pretend your hand is over the sensor

gesture sensor

Mood: Ocean Blue. Brightness: 50%.

What you're building

A floating, hand-controlled globe that teaches magnets, sensors and light.

The Floating Globe has three layers of magic. First, a commercial magnetic levitation module holds a lightweight globe in the air with no strings. Second, a small gesture sensor at the front of the base watches your hand and spots swipes and hovering. Third, a ring of LEDs hidden in the base shines up through the translucent globe, so the whole planet glows. When you swipe, the Arduino changes the colour or brightness. When your hand drifts close, the glow swells to meet you.

Magnetic Floating

A ready-made levitation module keeps the globe hovering steadily above the base.

Gesture Sensing

An APDS-9960 sensor sees swipes and how close your hand is, with no buttons.

Planet Mood Lighting

A 12-LED ring paints the globe with five colour moods that fade smoothly.

Swipe rightNext planet mood
Swipe leftPrevious mood
Swipe upBrighter glow
Swipe downSofter glow
Hover closeHalo swells

How can a globe float?

Magnets alone can't hold something still, so the module cheats with a fast brain.

  • A magnet rides with the globe. The module's floating part has a magnet that the electromagnet pulls on.
  • A sensor checks the height. In most modules a tiny sensor measures how far the floating magnet is from the module.
  • The electromagnet adjusts again and again. If the globe sinks, the pull gets stronger. If it rises, the pull gets weaker. This happens thousands of times every second, so the globe looks perfectly still.

That loop of "measure, decide, adjust" is called feedback control, and it is the same idea inside self-balancing robots and drones. Your Arduino has its own small feedback loop too: it measures your hand and adjusts the lights.

Materials list

The levitation module is the one special part. The rest is a standard Arduino kit.

Electronics

  • 1x commercial magnetic levitation module, with its own power adapter and floating magnet
  • 1x Arduino Uno
  • 1x APDS-9960 gesture sensor breakout
  • 1x 12-LED NeoPixel (WS2812B) ring
  • 1x 330-ohm resistor
  • 1x 1000 µF capacitor (6.3V or higher)
  • 1x 5V USB power adapter (2A) and cable for the Arduino
  • Jumper wires + breadboard

Build supplies

  • 1x lightweight, translucent hollow globe (well under the module's load limit)
  • Base made from wood, acrylic or thick foam board
  • Tracing paper or white tissue (to soften the LED glow)
  • Hot glue gun and double-sided tape
  • Craft knife (adult use only)
  • Plastic or wooden screws only, near the module

Circuit diagram

The levitation module runs on its own. The Arduino only handles the gesture sensor and the lights.

ARDUINO UNO 5V from USB adapter GESTURE SENSOR APDS-9960 VCC 3.3V, GND SDA → A4, SCL → A5 NEOPIXEL RING 12 LEDs, WS2812B DIN ← D6 via 330 ohm 5V and GND from Arduino 1000 µF across 5V and GND 5V USB ADAPTER 2A, powers the Arduino LEVITATION MODULE Plugs into its own adapter No wires to the Arduino

Tip: Place the 1000 µF capacitor close to the LED ring with its stripe (negative leg) on GND. Check your gesture sensor's product page: if it needs 3.3V logic only, add a small I2C level shifter between it and the Arduino.

Wiring reference table

ComponentComponent PinConnects To
APDS-9960 gesture sensorVCCArduino 3.3V
APDS-9960 gesture sensorGNDArduino GND
APDS-9960 gesture sensorSDAArduino A4
APDS-9960 gesture sensorSCLArduino A5
NeoPixel ringDIN330-ohm resistor, then Arduino D6
NeoPixel ring5VArduino 5V
NeoPixel ringGNDArduino GND
1000 µF capacitor+ and −Ring 5V and GND
Levitation modulePower inputIts own adapter (not connected to the Arduino)

Step-by-step build instructions

Get the globe floating first, then add the smart parts one at a time.

  1. Make the levitation module work on its own

    Follow the maker's manual to set up the module and float its supplied ball or magnet. Do this before adding any of your own parts, so you know it works.

  2. Prepare the globe

    Fix the module's floating magnet to the globe as the manual describes, keeping it centred. Check the total weight is under the module's load limit. Float it to confirm it holds steady.

  3. Wire and test the gesture sensor

    On a breadboard, connect the APDS-9960 to 3.3V, GND, A4 and A5. Install the Adafruit APDS9960 library and run its gesture example to see swipes printed in the Serial Monitor.

  4. Wire and test the LED ring

    Connect the ring's DIN to D6 through the 330-ohm resistor, add the capacitor across 5V and GND, then run the Adafruit NeoPixel "strandtest" example to check every LED lights.

  5. Build the base and mount the ring

    Fix the LED ring on the base so it faces up toward the floating globe, centred under it. Use plastic or wooden fixings only, and keep the module's own mounting exactly as the manual says. Cover the ring with a layer of tracing paper to soften the glow.

  6. Mount the gesture sensor at the front

    Fix the sensor at the front edge of the base, window facing up, so your hand can swipe 5 to 10 cm above it. Keep it a little away from the module's position sensor.

  7. Upload the code

    Upload the sketch below. The ring should start in Ocean Blue. Swipe your hand over the sensor and watch the mood change.

  8. Test with the globe floating

    Float the globe and run through every gesture. If the globe wobbles or drops when the lights or sensor are on, move them further from the module's sensor and try again.

Arduino code

Copy this into a new sketch in the Arduino IDE. Install the Adafruit APDS9960 and Adafruit NeoPixel libraries first from the Library Manager. Accept the extra libraries it offers to install.

#include <Wire.h>
#include <Adafruit_APDS9960.h>
#include <Adafruit_NeoPixel.h>

// ---- Pin and light settings ----
#define LED_PIN         6
#define NUM_LEDS        12
#define MIN_BRIGHTNESS  15
#define MAX_BRIGHTNESS  120   // keeps the ring safe on USB power

Adafruit_NeoPixel ring(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_APDS9960 apds;

// ---- Planet moods (name, red, green, blue) ----
struct Mood { const char* name; uint8_t r, g, b; };
const Mood moods[] = {
  {"Ocean Blue",      0, 120, 255},
  {"Forest Green",   30, 200,  70},
  {"Sunset Orange", 255, 110,  20},
  {"City Lights",   255, 200,  60},
  {"Aurora Purple", 150,  60, 255}
};
const int NUM_MOODS = sizeof(moods) / sizeof(moods[0]);

int moodIndex = 0;
int baseBrightness = 80;
float curR = moods[0].r, curG = moods[0].g, curB = moods[0].b;

void setup() {
  Serial.begin(9600);
  ring.begin();
  ring.show();

  if (!apds.begin()) {
    Serial.println(F("Gesture sensor not found. Check SDA/SCL wiring!"));
    fillRing(60, 0, 0);   // dim red means "sensor problem"
    while (true) { }
  }
  apds.enableProximity(true);
  apds.enableGesture(true);
}

void loop() {
  handleGesture();
  easeColor();
  drawGlow(readHandGlow());
  delay(15);
}

void handleGesture() {
  uint8_t gesture = apds.readGesture();
  if (gesture == 0) return;

  // If left/right feel backwards, swap +1 and -1 below
  switch (gesture) {
    case APDS9960_RIGHT: changeMood(+1); break;
    case APDS9960_LEFT:  changeMood(-1); break;
    case APDS9960_UP:    baseBrightness = min(baseBrightness + 20, MAX_BRIGHTNESS); break;
    case APDS9960_DOWN:  baseBrightness = max(baseBrightness - 20, MIN_BRIGHTNESS); break;
  }
}

void changeMood(int direction) {
  moodIndex = (moodIndex + direction + NUM_MOODS) % NUM_MOODS;
  Serial.print(F("Mood: "));
  Serial.println(moods[moodIndex].name);
}

// Fade smoothly toward the chosen mood colour
void easeColor() {
  curR += (moods[moodIndex].r - curR) * 0.08;
  curG += (moods[moodIndex].g - curG) * 0.08;
  curB += (moods[moodIndex].b - curB) * 0.08;
}

// The closer your hand, the more the halo swells
int readHandGlow() {
  uint8_t prox = apds.readProximity();   // 0 = far, 255 = very close
  return map(prox, 0, 255, 0, 70);
}

void drawGlow(int handBoost) {
  float t = millis() / 1000.0;
  float breathe = 0.8 + 0.2 * sin(t * 1.5);        // slow breathing
  for (int i = 0; i < NUM_LEDS; i++) {
    float wave = 0.65 + 0.35 * sin(t * 2.0 + i * TWO_PI / NUM_LEDS);  // light "spins" round the ring
    float level = (baseBrightness * breathe + handBoost) * wave;
    level = constrain(level, 0, MAX_BRIGHTNESS);
    ring.setPixelColor(i, ring.Color(curR * level / 255.0,
                                     curG * level / 255.0,
                                     curB * level / 255.0));
  }
  ring.show();
}

void fillRing(uint8_t r, uint8_t g, uint8_t b) {
  for (int i = 0; i < NUM_LEDS; i++) ring.setPixelColor(i, ring.Color(r, g, b));
  ring.show();
}

Beginner tip

The sensor likes slow, steady swipes about 5 to 10 cm above it, covering the whole window. Very fast flicks or tiny wiggles are often missed. Open the Serial Monitor at 9600 to see each mood change as it happens.

Safety notes for young makers

Strong magnets can pinch fingers. Keep them away from pacemakers and medical implants, phones, bank cards and watches, and keep small magnets away from young children and pets because they are dangerous if swallowed. Use only the power adapter supplied with the levitation module, ask an adult to help with wiring and any mains plugs, and never open the module or touch its coil, which can get warm. This is a learning project, so follow the module maker's own safety instructions too.

Why this project works so well for learning

The Floating Globe turns an invisible idea into something you can see. Kids meet magnetism and feedback control by watching the globe hold still, then add their own sensor-to-action loop on top. Turning a proximity number into a brightness with map() shows how raw sensor data becomes a smooth, useful effect. Using an index with the modulo operator to cycle moods, and easing colours toward a target instead of snapping, are small coding tricks that appear in games, apps and robots everywhere.

Frequently asked questions

Do I have to build the levitation part myself?

No. A ready-made magnetic levitation module does the floating on its own. The Arduino only reads your hand gestures and controls the LED lighting, so the two parts never need to be wired together.

Why are the LEDs in the base instead of inside the globe?

A floating globe has no wires attached to it. The LED ring sits in the base and shines up through a translucent globe, so the whole planet seems to glow.

The gesture sensor does not notice my swipes. What can I try?

Swipe slowly and steadily about 5 to 10 centimetres above the sensor, keep it out of strong direct sunlight, and make sure the sensor window is clean. Check the SDA and SCL wires if the Serial Monitor says the sensor was not found.

Will my hand or the LED lights make the globe fall?

Usually not, but some levitation modules use an optical position sensor that can be disturbed by bright lights or infrared. Test the globe floating on its own first, then again after adding the lights and gesture sensor. Keep steel screws and tools away from the module.

What age group is this project best for?

Ages 10 and up can build it with an adult helping with the magnets, power adapters and wiring.

Built for curious young engineers. Always build and power on electronics with adult supervision.

Comments

Product Cards
Buddy Bot eBook
⭐ New 2026 Release
Build Your
Own Robot!
3D design, wiring &
Arduino coding.
★★★★★ Young inventors love it!
🖨️
3D Print
All parts
⚡
Wire it
Circuit guide
💻
Code it
Arduino IDE
🤖
Watch it
Walk & react
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Website Offer
₹499 ₹300
🌍 International: $5 USD
One-time · Instant digital delivery
🔒 Secured by Razorpay · Your data is safe
📄 Download Free Sample Copy
🔒 Secured by Razorpay · Your data is safe
🍓
Raspberry Pi Pico Mastery
21 Projects
⚡ Launch Price — 80% OFF
Learn Pico
Build 21 Projects!
MicroPython · Wokwi
IoT · Certificate
★★★★★ Perfect for beginners!
🖥️
Wokwi
No hardware
🐍
MicroPy
From zero
🔨
21 Projects
IoT + sensors
📄
Certificate
Verified cert
📋 Your Details
Enter your name
Valid 10-digit no.
Enter a valid email
Special Launch Offer
₹999 ₹200 80% OFF
🌍 International: $5 USD
One-time · Lifetime access · No subscription
🔒 Secured by Razorpay · UPI · Cards · NetBanking
🎉

You're in!

Payment successful! Your Buddy Bot eBook is ready. Time to build!

📖 Access Your eBook Now
🎉

Enrolled!

Payment successful! Lifetime access to all 21 Pico Projects is yours!

🍓 Go to My Course