Projects / Model carousel

Model carousel

Beginner2.2 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. PICO

    Wire the driver

    IN1 to IN4 to GP10 to GP13.

  2. PICO

    Power the driver

    Plus to VBUS pin 40, minus to GND.

  3. PICO

    Wire the knob

    Ends to 3V3(OUT) and GND, middle to GP26.

  4. PICO

    Wire the button

    GP14 to GND.

  5. PICO

    Run the program

    Turn the knob up from the bottom.

  6. PICO

    Watch the shaft

    It turns slowly and speeds up.

  7. PICO

    Press the button

    It reverses.

  8. PICO

    Fix the carousel to the shaft

    A card disc with small figures.

In short

How do you build a model carousel?

A 28BYJ-48 stepper turns a cardboard carousel at a speed set by a knob, with a button for the direction. A gentle model for a craft project, powered over USB. You need Raspberry Pi Pico H, 28BYJ-48 Stepper Motor, ULN2003 driver board, Potentiometer 10 kΩ, Tactile push button 6 mm and Breadboard 830 Tie Points. It takes 8 steps and about 130 minutes.

Level
Beginner
Time
About 130 min
Parts
6

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Driver board IN1Pico GP10 pin 14Coil A
Driver board IN2Pico GP11 pin 15Coil B
Driver board IN3Pico GP12 pin 16Coil C
Driver board IN4Pico GP13 pin 17Coil D
Driver board +Pico VBUS pin 405 V from USB for the motor
Driver board -Pico GND pin 38Common ground
Speed knob endsPico 3V3(OUT) pin 36 and GND pin 33Knob across 3.3 V
Speed knob middlePico GP26 pin 31ADC0 input
Direction buttonPico GP14 pin 19 and GNDChanges direction

Code

The 28BYJ-48 is a small geared stepper motor, common in toys and cheap kits. A stepper turns in small fixed steps when its four coils are switched on in the right order, and it has a gearbox inside that makes it strong and slow, with about 4096 half-steps for one turn of the shaft. The four pins of the Pico are not strong enough for the coils, so a ULN2003 driver board sits between them and switches the current for each coil. The program steps through eight patterns for a smooth turn, and the time between steps sets the speed, from about one turn in a minute up to about one turn in eight seconds, which is a good carousel pace. The knob sets the speed, with a stop zone at the bottom where the coils are switched off, so the motor does not heat up when it is not moving. A button reverses it. Make the carousel from light card, no heavier than the motor can turn gently, and keep fingers, hair and loose clothing clear. Small parts can be a choking hazard for small children. Run it from a USB port and not from a battery.

from machine import Pin, ADC
import time

coils = [Pin(10, Pin.OUT), Pin(11, Pin.OUT), Pin(12, Pin.OUT), Pin(13, Pin.OUT)]
knob = ADC(26)
button = Pin(14, Pin.IN, Pin.PULL_UP)

# Half-step pattern: eight steps make a smooth turn
SEQUENCE = [
    (1, 0, 0, 0), (1, 1, 0, 0), (0, 1, 0, 0), (0, 1, 1, 0),
    (0, 0, 1, 0), (0, 0, 1, 1), (0, 0, 0, 1), (1, 0, 0, 1),
]

def release():
    for c in coils:
        c.value(0)                                  # coils off, so the motor stays cool when stopped

step = 0
direction = 1
last_press = 0

while True:
    if button.value() == 0 and time.ticks_diff(time.ticks_ms(), last_press) > 300:
        direction = -direction
        last_press = time.ticks_ms()
        print("Direction", "forward" if direction == 1 else "backward")

    reading = knob.read_u16()
    if reading < 4000:                              # knob fully down: stop
        release()
        time.sleep_ms(50)
        continue

    delay_ms = 14 - reading * 12 // 65535           # 14 ms (slow) down to 2 ms (fast) per half step
    step = (step + direction) % 8
    pattern = SEQUENCE[step]
    for i in range(4):
        coils[i].value(pattern[i])
    time.sleep_ms(max(2, delay_ms))

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Knob at the bottomMotor stopped and cool
Knob a quarter upSlow turn
Knob fully upFaster, but still smooth
Press the buttonReverses
Run for ten minutesThe motor is only warm

If it does not work

Motor only buzzes

Check the wire order IN1 to IN4 matches the pins.

Moves jerkily

Increase the delay by turning the knob down a little.

Does not move

Check the driver board has 5 V and GND.

Direction wrong

Press the button or swap the pin order.

Skips under load

Make the carousel lighter or slower.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the model carousel?

Raspberry Pi Pico H, 28BYJ-48 Stepper Motor, ULN2003 driver board, Potentiometer 10 kΩ, Tactile push button 6 mm and Breadboard 830 Tie Points.

How long does the model carousel take to build?

About 130 minutes for a beginner maker, in 8 steps.

How do I know the model carousel works?

Knob at the bottom: Motor stopped and cool. Knob a quarter up: Slow turn. Knob fully up: Faster, but still smooth.

Motor only buzzes: what should I check?

Check the wire order IN1 to IN4 matches the pins.

Moves jerkily: what should I check?

Increase the delay by turning the knob down a little.

Does not move: what should I check?

Check the driver board has 5 V and GND.

Direction wrong: what should I check?

Press the button or swap the pin order.