A tiny cardboard Earth that spins forever — with a real touchscreen you tap to explore it
This version upgrades the spinning globe with a small HDMI touchscreen sitting in the base. A motor keeps the cardboard Earth turning non-stop, while tapping the screen cycles through four live modes — Weather, Countries, Time, and Night Lights — right on the display itself. Here's exactly how to build it, with the full circuit and code.
Why a touchscreen instead of a separate button
In this version, the display and the button become one part: a small HDMI touchscreen connected to a Raspberry Pi. Instead of wiring a separate touch pad and a separate OLED screen, you tap directly on the picture you're already looking at, and a tiny computer program instantly redraws it with the next mode's information.
One slow motor
A small geared DC motor turns continuously through an axle, so the cardboard globe never stops rotating.
Touch = next mode
Tapping anywhere on the touchscreen cycles through Weather → Countries → Time → Night Lights → back to Weather.
Raspberry Pi runs it all
A Raspberry Pi drives the HDMI touchscreen and the motor at the same time, using a simple Python program.
What you'll need
Mostly cardboard and craft supplies, plus a small Raspberry Pi electronics kit. Ask a grown-up to help with ordering and assembly.
Raspberry Pi (Zero 2 W or Pi 4)
Runs the touchscreen program and controls the motor and lights through its GPIO pins.
3.5"–5" HDMI capacitive touchscreen
Connects over HDMI for video and USB for touch — one screen that shows and controls everything.
Small 5V geared DC motor
Turns the axle slowly and steadily so the globe spins forever without wobbling.
Motor driver (L298N or MOSFET)
Lets the Pi safely run the motor without overloading its GPIO pins.
8-LED WS2812 ring
Glows warm and twinkly under the globe for Night Lights mode, and different colors for other modes.
5V/3A USB-C power supply + separate battery pack
Powers the Raspberry Pi and touchscreen, while the motor gets its own battery through the driver.
MicroSD card (8GB+)
Holds the Raspberry Pi's operating system and your Python program.
Cardboard, foam ball, paper world map, glue
Builds the spinning globe and the base stand around the electronics.
How the circuit works
The touchscreen plugs straight into the Raspberry Pi over HDMI (for the picture) and USB (for touch) — no extra wiring needed there. The motor and LED ring connect to the Pi's GPIO pins, with the motor drawing its power through a separate driver so it never overloads the Pi.
Raspberry Pi (Zero 2 W / Pi 4)
HDMI port ------------------> HDMI Touchscreen (video in)
USB port ------------------> HDMI Touchscreen (touch data in)
GPIO18 (PWM) -----------------> Motor Driver IN (speed control)
GPIO12 -----------------> WS2812 LED ring DIN
GND -----------------> Shared GND (driver + LED ring)
Motor Driver (L298N / MOSFET)
OUT ---------------------------> 5V Geared DC Motor ---> Axle ---> Cardboard Globe
VMOTOR -------------------------> Separate battery pack +
GND ----------------------------> Shared GND with Pi
Step-by-step build
Follow these in order — the base electronics get set up and tested before the globe is attached on top.
Set up the Raspberry Pi
Flash the Raspberry Pi OS onto the microSD card, boot the Pi, and connect it to Wi-Fi with a grown-up's help.
Build the base stand
Cut a sturdy cardboard box to hold the Raspberry Pi, touchscreen (facing up or forward), and battery packs, with a hole in the top-center for the motor shaft.
Connect the touchscreen
Plug the HDMI touchscreen's HDMI and USB cables into the Raspberry Pi, following the screen manufacturer's quick-start guide.
Mount the motor and LED ring
Glue the geared motor upright with its shaft pointing up through the base's center hole, and place the WS2812 ring around the shaft.
Wire the motor driver and LED ring
Connect them to the Pi's GPIO pins and separate battery pack, following the circuit map above.
Install libraries and run the code
Install the needed Python libraries, paste in the program below, and run it — confirm the motor spins and tapping the screen changes modes.
Build the cardboard globe
Wrap a foam ball with a printed world map, push a cardboard tube through its center, and slide it onto the motor shaft.
Decorate and finish
Set the program to auto-start on boot (see the FAQ), add labels, and trim any visible wires.
The Raspberry Pi code
This Python program shows a full-screen touch interface, keeps the motor spinning at a steady speed the whole time, and redraws the screen and LED ring every time you tap.
import tkinter as tk import RPi.GPIO as GPIO import random from datetime import datetime from rpi_ws281x import PixelStrip, Color # ---- pins ---- MOTOR_PIN = 18 LED_PIN = 12 NUM_LEDS = 8 # ---- motor setup: spins forever at a steady speed ---- GPIO.setmode(GPIO.BCM) GPIO.setup(MOTOR_PIN, GPIO.OUT) motor_pwm = GPIO.PWM(MOTOR_PIN, 100) motor_pwm.start(60) # ---- LED ring setup ---- strip = PixelStrip(NUM_LEDS, LED_PIN) strip.begin() modes = ["Weather", "Countries", "Time", "Night Lights"] mode_index = 0 countries = ["Japan", "Brazil", "Kenya", "Norway"] weather_icons = ["Sunny", "Rainy", "Cloudy", "Snowy"] def set_ring(color): for i in range(NUM_LEDS): strip.setPixelColor(i, Color(*color)) strip.show() def update_display(): mode = modes[mode_index] if mode == "Weather": label.config(text=f"WEATHER\n{random.choice(weather_icons)}") set_ring((80, 180, 255)) elif mode == "Countries": label.config(text=f"COUNTRIES\n{random.choice(countries)}") set_ring((80, 220, 150)) elif mode == "Time": now = datetime.now().strftime("%H:%M") label.config(text=f"TIME\n{now}") set_ring((255, 255, 255)) else: label.config(text="NIGHT LIGHTS") for i in range(NUM_LEDS): c = (255, 210, 120) if random.random() < 0.4 else (0, 0, 0) strip.setPixelColor(i, Color(*c)) strip.show() def on_touch(event): global mode_index mode_index = (mode_index + 1) % len(modes) update_display() # ---- full-screen touch window ---- root = tk.Tk() root.attributes("-fullscreen", True) root.configure(bg="black") label = tk.Label(root, text="", font=("Helvetica", 44), fg="white", bg="black") label.pack(expand=True) root.bind("<Button-1>", on_touch) # any tap on the touchscreen counts as a click update_display() def refresh_loop(): if modes[mode_index] == "Time": update_display() # keep the clock ticking root.after(1000, refresh_loop) refresh_loop() root.mainloop()
60 in motor_pwm.start(60) to spin faster or slower, or add a real weather lookup using Python's requests library and a free weather API for live data.Frequently asked questions
Do I need to know Python already?
No. The program above is ready to run as-is. Learning happens by changing small pieces — like the country list or the LED colors — and seeing what changes on screen.
How do I make the program start automatically when the Pi turns on?
You can add the script to the Raspberry Pi's autostart settings (found in its desktop configuration or a startup script), so it launches full-screen every time it boots — a grown-up or an online Raspberry Pi guide can help with this one-time setup.
Why does the motor need its own battery pack?
Motors can briefly pull a lot of current when starting or under load, which can cause voltage dips strong enough to reboot a Raspberry Pi. A separate battery through the motor driver keeps the Pi's power steady.
Can Weather mode show real weather?
Yes — since the Raspberry Pi has Wi-Fi, you can extend the code to fetch real weather from an online weather service instead of picking a random icon.

Comments
Post a Comment