# Stepper Motor Turntable

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/134/555/medium800thumb/3d_printing_guide-thumb.jpg?1737479410)

https://youtu.be/w7RCZIHGNE4

Put a spin on your videos with this motorized turntable. Turn the IKEA Snudda lazy susan into a motorized table top using CircuitPython and electronics from Adafruit.

Use a stepper motor and the silent TMC2209 driver to give the tabletop a twirl. This project allows you to achieving smooth motion for filming your projects. With an OLED screen and rotary encoder, you can change the direction, adjust speed and have start and stop control.

## OLED Menu

The on-screen menu on the OLED uses custom fonts and icons to display if the motor is on, the direction, and the speed. Using the rotary encoder, you can push to select, and turn to change and adjust the direction, speed and on/off.

![3d_printing_demo-menu.gif](https://cdn-learn.adafruit.com/assets/assets/000/134/551/medium640thumb/3d_printing_demo-menu.jpg?1737478145)

## Speed Control

Using the TMC2209 stepper driver, you can choose up to three different speeds. Low, medium, and fast are shown on the OLED as icons with text.&nbsp;

![3d_printing_demo-speed.gif](https://cdn-learn.adafruit.com/assets/assets/000/134/554/medium640thumb/3d_printing_demo-speed.jpg?1737479313)

# Parts
### Adafruit TMC2209 Stepper Motor Driver Breakout Board

[Adafruit TMC2209 Stepper Motor Driver Breakout Board](https://www.adafruit.com/product/6121)
Stepper motors are used for CNC machines, 3D printers, and whenever else one needs precise, powerful motion. But to get good behavior from steppers you need a motor driver chip that can provide high bursts of current, and for smooth motion, be able to PWM that current for microstepping...

Out of Stock
[Buy Now](https://www.adafruit.com/product/6121)
[Related Guides to the Product](https://learn.adafruit.com/products/6121/guides)
![Video of a motor stepper driver board driving a stepper motor connected to a microcontroller.](https://cdn-shop.adafruit.com/product-videos/640x480/6121-07.jpg)

### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

In Stock
[Buy Now](https://www.adafruit.com/product/5302)
[Related Guides to the Product](https://learn.adafruit.com/products/5302/guides)
![Angled shot of short black microcontroller.](https://cdn-shop.adafruit.com/640x480/5302-07.jpg)

### MPM3610 5V Buck Converter Breakout - 21V In 5V Out at 1.2A

[MPM3610 5V Buck Converter Breakout - 21V In 5V Out at 1.2A](https://www.adafruit.com/product/4739)
This little buck converter based on the MPM3610 is a marvel, taking up to 21V input and providing a 5V output with up to 1.2A current. It's great for supplying power to popular 5V voltage circuits from a range of battery or power options. &nbsp;This chip provides up to 1.2 Amp load current...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4739)
[Related Guides to the Product](https://learn.adafruit.com/products/4739/guides)
![MPM3610 5V Buck Converter Breakout Board](https://cdn-shop.adafruit.com/640x480/4739-04.jpg)

### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

Out of Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
![Monochrome 1.3" OLED module with Adafruit logos falling like snow](https://cdn-shop.adafruit.com/product-videos/640x480/938-05.jpg)

### Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder

[Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder](https://www.adafruit.com/product/5880)
Rotary encoders are soooo much fun! Twist em this way, then twist them that way. Unlike potentiometers, they go all the way around and often have little detents for tactile feedback. But, if you've ever tried to add encoders to your project you know that they're a real challenge to...

In Stock
[Buy Now](https://www.adafruit.com/product/5880)
[Related Guides to the Product](https://learn.adafruit.com/products/5880/guides)
![Angled Shot of the I2C Stemma QT Rotary Encoder Breakout with Encoder.](https://cdn-shop.adafruit.com/640x480/5880-00.jpg)

### Part: SNUDDA Lazy Susan
quantity: 1
IKEA 15" Table Top
[SNUDDA Lazy Susan](https://www.ikea.com/us/en/p/snudda-lazy-susan-rubberwood-80543263/)

### Part: Adjustable Power Supply w/ 2.1mm / 5.5mm DC
quantity: 1
3V to 24V at 2 Amp
[Adjustable Power Supply w/ 2.1mm / 5.5mm DC](https://www.adafruit.com/product/5130)

### Part: NEMA 17 Stepper Motor
quantity: 1
Short Body Bipolar Stepper Motor 12V 1A 
[NEMA 17 Stepper Motor](https://www.amazon.com/gp/product/B00PNEQ79Q/)

### Part: 200mm STEMMA QT Cable
quantity: 1
200mm STEMMA QT Cable
[200mm STEMMA QT Cable](https://www.adafruit.com/product/4401)

### Part: 50mm STEMMA QT Cable
quantity: 1
50mm STEMMA QT Cable
[50mm STEMMA QT Cable](https://www.adafruit.com/product/4399)

### Part: 2.1mm DC Jack
quantity: 1
Panel Mount 2.1mm DC barrel jack
[2.1mm DC Jack](https://www.adafruit.com/product/610)

### Part: Rubber Bumper Feet 
quantity: 2
Pack of 4
[Rubber Bumper Feet ](https://www.adafruit.com/product/550)

### Part: 26AWG Wires – Red
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – Red](https://www.adafruit.com/product/2513)

### Part: 26AWG Wires – Blue
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – Blue](https://www.adafruit.com/product/2514)

### Part: 26AWG Wires – Green
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – Green](https://www.adafruit.com/product/2516)

### Part: 26AWG Wires – Black
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – Black](https://www.adafruit.com/product/2517)

### Part: 26AWG Wires – White
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – White](https://www.adafruit.com/product/2518)

### Part: 26AWG Wires – Orange
quantity: 1
Silicone Cover Wire - 25ft
[26AWG Wires – Orange](https://www.adafruit.com/product/2520)

### Part: M2.5 Hardware Kit
quantity: 1
Black Nylon Machine Screw and Stand-off Set – M2.5 Thread
[M2.5 Hardware Kit](https://www.adafruit.com/product/3299)

# Stepper Motor Turntable

## Circuit Diagram

The diagram below provides a general visual reference for wiring of the components once you get to the **Assembly** page. This diagram was created using the software package [Fritzing](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Adafruit uses the Adafruit's Fritzing parts library to create circuit diagrams for projects. You can download the library or just grab individual parts. Get the library and parts from [GitHub - Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts).

![](https://cdn-learn.adafruit.com/assets/assets/000/134/496/medium800/3d_printing_Circuit_Diagram_%281%29_bb.png?1737033998)

## Wired Connections

- **VDD p** in&nbsp;from TMC2209 to **3V** pin&nbsp;on KB2040
- **G** pin from TMC2209 to **GND** pin on KB2040
- **DIR** pin from TMC2209 to **D5** pin on KB2040
- **STEP** pin from TMC2209 to **D6** pin on KB2040
- **MS1** pin from TMC2209 to **D2** pin on KB2040
- **MS2** pin from TMC2209 **D3** pin on KB2040
- **EN** pin from TMC2209 to **D4** pin on KB2040
- Rotary STEMMA QT to KB2040
- 1.3in OLED to Rotary STEMMA QT
- **B-** (blue wire) from stepper motor to **2B** pin on TMC2209
- **B+** (red wire) from stepper motor to **2A** pin on TMC2209
- **A+** (black wire) from stepper motor to **1A** pin on TMC2209
- **A-** (green wire) from stepper motor to **1B** pin on TMC2209
- **GND** pin from MPM3610 to **GND** pin on KB2040
- **5V** pin from MPM3610 to **RAW** pin on KB2040
- **+DC** Jack to **VIN** pin on MPM3610
- **+DC** Jack to **+** on TMC2209
- **-DC** Jack to **-** on TMC2209&nbsp;
- **-DC** Jack to **GND** pin on KB2040&nbsp;

The KB2040 and Stepper Motor are powered by a 12V 2A power supply.

# Stepper Motor Turntable

## CAD Files

## 3D Printed Parts

Individual 3MF files for 3D printing will need to be oriented in slicing software to print on FDM machines without any support material using PLA filament. Original design source may be downloaded using the links below.

![3d_printing_CAD.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/809/medium640/3d_printing_CAD.jpg?1737990837)

## All Parts

Use the **All Parts.3MF** file to import all of the models into your slicer. This file includes multiple plates with the models pre-oriented for ready-to-print parts.

![3d_printing_slice-all-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/816/medium640/3d_printing_slice-all-parts.jpg?1737995170)

[3MF.zip](https://cdn-learn.adafruit.com/assets/assets/000/134/960/original/3MF.zip?1738357590)
[Download CAD Source](https://cdn-learn.adafruit.com/assets/assets/000/134/959/original/CAD.zip?1738357415)
## Build Volume

The parts require a 3D printer with a minimum build volume of:

- 220mm (X) x 220mm (Y) x 40mm (Z)

![3d_printing_cad-slice.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/546/medium640/3d_printing_cad-slice.jpg?1737470254)

## Design Source Files

The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more.

Electronic components like Adafruit's boards, displays, connectors and more can be downloaded from the&nbsp;[Adafruit CAD parts GitHub Repo](https://github.com/adafruit/Adafruit_CAD_Parts/).

![3d_printing_6121-TMC2209-Driver.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/547/medium640/3d_printing_6121-TMC2209-Driver.jpg?1737470357)

# Stepper Motor Turntable

## Install CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## CircuitPython Quickstart

Follow this step-by-step to quickly get CircuitPython running on your board.

[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/adafruit_kb2040/)
 **Click the link above to download the latest CircuitPython UF2 file.**

Save it wherever is convenient for you.

![install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/655/medium640/install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg?1618943202)

![](https://cdn-learn.adafruit.com/assets/assets/000/108/852/medium800/adafruit_products_KeeBoar_boot_reset.jpg?1644515196)

To enter the bootloader, hold down the **BOOT/**** BOOTSEL button**(highlighted in red above), and while continuing to hold it (don't let go!), press and release the**reset button**(highlighted in red or blue above).&nbsp;**Continue to hold the BOOT/BOOTSEL button until the RPI-RP2 drive appears!**

If the drive does not appear, release all the buttons, and then repeat the process above.

You can also start with your board unplugged from USB, press and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.

A lot of people end up using charge-only USB cables and it is very frustrating! **Make sure you have a USB cable you know is good for data sync.**

You will see a new disk drive appear called **RPI-RP2**.

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **RPI-RP2.**

![install_circuitpython_on_rp2040_RP2040_bootloader_drive.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/656/medium640/install_circuitpython_on_rp2040_RP2040_bootloader_drive.jpg?1618943666)

![install_circuitpython_on_rp2040_RP2040_drag_UF2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/657/medium640/install_circuitpython_on_rp2040_RP2040_drag_UF2.jpg?1618943674)

The **RPI-RP2** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![install_circuitpython_on_rp2040_RP2040_CIRCUITPY.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/658/medium640/install_circuitpython_on_rp2040_RP2040_CIRCUITPY.jpg?1618943864)

## Safe Mode

You want to edit your **code.py** or modify the files on your **CIRCUITPY** drive, but find that you can't. Perhaps your board has gotten into a state where **CIRCUITPY** is read-only. You may have turned off the **CIRCUITPY** drive altogether. Whatever the reason, safe mode can help.

Safe mode in CircuitPython does not run any user code on startup, and disables auto-reload. This means a few things. First, safe mode _bypasses any code in_ **boot.py** (where you can set **CIRCUITPY** read-only or turn it off completely). Second, _it does not run the code in_ **code.py**. And finally, _it does not automatically soft-reload when data is written to the_ **CIRCUITPY** _drive_.

Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the **CIRCUITPY** drive.

### Entering Safe Mode
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)

### In Safe Mode

If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.

If you connect to the serial console, you'll find the following message.

```terminal
Auto-reload is off.
Running in safe mode! Not running saved code.

CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.
```

You can now edit the contents of the **CIRCUITPY** drive. Remember, _your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode._

## Flash Resetting UF2

If your board ever gets into a really _weird_ state and CIRCUITPY doesn't show up as a disk drive after installing CircuitPython, try loading this 'nuke' UF2 to RPI-RP2. which will do a 'deep clean' on your Flash Memory. **You will lose all the files on the board** , but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.

[Download flash erasing "nuke" UF2](https://cdn-learn.adafruit.com/assets/assets/000/101/659/original/flash_nuke.uf2?1618945856)
# Stepper Motor Turntable

## Code the Turntable

Once you've finished setting up your KB2040 with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.

To do this, click on the **Download Project Bundle** button in the window below. It will download to your computer as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/TMC2209_Motorized_Turntable/code.py

## Upload the Code, Assets and Libraries to the KB2040

After downloading the Project Bundle, plug your KB2040 into the computer's USB port with a known good USB data+power cable. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called **CIRCUITPY**. Unzip the folder and copy the following items to the KB2040's **CIRCUITPY** drive.

- **lib** folder
- **code.py**
- **Arial-14.bdf**
- **icons.bmp**

Your KB2040 **CIRCUITPY** drive should look like this after copying the **lib** folder, font file, bitmap file and the **code.py** file.

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/TMC2209_Motorized_Turntable.png )

## How the CircuitPython Code Works

The code begins by instantiating the rotary encoder and button over I2C with the **adafruit\_seesaw** library.

```python
# rotary encoder
i2c = board.STEMMA_I2C()
seesaw = seesaw.Seesaw(i2c, addr=0x36)
encoder = rotaryio.IncrementalEncoder(seesaw)
pos = -encoder.position
last_pos = pos
seesaw.pin_mode(24, seesaw.INPUT_PULLUP)
button = digitalio.DigitalIO(seesaw, 24)
button_state = False
```

## Graphics

The OLED is instantiated over I2C. A bitmap sprite sheet is used for the icons and one bitmap label is used for the text at the top of the display.

```python
#display setup
displayio.release_displays()

# oled
oled_reset = board.D9
display_bus = i2cdisplaybus.I2CDisplayBus(i2c, device_address=0x3D, reset=oled_reset)
WIDTH = 128
HEIGHT = 64
display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=WIDTH, height=HEIGHT)
# icon sprite sheet
bitmap, palette = adafruit_imageload.load("/icons.bmp",
                                          bitmap=displayio.Bitmap,
                                          palette=displayio.Palette)

icons_grid = displayio.TileGrid(bitmap, pixel_shader=palette,
                                 tile_height=38, tile_width=38,
                                 x=int((display.width / 2)-(38/2)), y=display.height-38)
# text at top of screen
font = bitmap_font.load_font('/Arial-14.bdf')
main_area = label.Label(
    font, text=" ", color=0xFFFFFF)
main_area.anchor_point = (0.5, 0.0)
main_area.anchored_position = (display.width / 2, 0)

splash = displayio.Group()
splash.append(icons_grid)
splash.append(main_area)
display.root_group = splash
```

## TMC2209 Pins

The direction, step, enable, MS1 and MS2 pins are connected to output pins on the KB2040. All of them affect how the stepper motor is controlled:

- Direction - direction that the motor rotates
- Step - toggled to move the motor
- Enable - enables/disables the motor
- MS1 and MS2 - address pins that set the step division

```python
# direction and step pins
DIR = DigitalInOut(board.D5)
DIR.direction = Direction.OUTPUT
STEP = DigitalInOut(board.D6)
STEP.direction = Direction.OUTPUT

# enable pin, default off
EN = DigitalInOut(board.D4)
EN.direction = Direction.OUTPUT
EN.value = True

# stepper pins, default 32
MS2 = DigitalInOut(board.D3)
MS2.direction = Direction.OUTPUT
MS2.value = True
MS1 = DigitalInOut(board.D2)
MS1.direction = Direction.OUTPUT
MS1.value = False
```

## Dictionaries for Menus

Each setting option for the turntable has a few different parameters; usually graphics and pin values. To handle this, dictionaries are used to store all of the settings together. The first set of dictionaries control the speed of the turntable by changing the MS1 and MS2 pin values. A function called `change_speed()` sets the pin values and updates the graphics on the OLED.

```python
# speed dictionaries
speed1 = {
    "micro" : 16,
    "ms1" : True,
    "ms2" : True,
    "icon" : 2,
    "label" : "FAST"
  }
speed2 = {
    "micro" : 32,
    "ms1" : True,
    "ms2" : False,
    "icon" : 1,
    "label" : "MEDIUM"
  }
speed3 = {
    "micro" : 64,
    "ms1" : False,
    "ms2" : True,
    "icon" : 0,
    "label" : "SLOW"
  }
speeds = [speed3, speed2, speed1]

def change_speed(speed):
    MS1.value = speeds[speed]["ms1"]
    MS2.value = speeds[speed]["ms2"]
    icons_grid[0] = speeds[speed]["icon"]
    main_area.text = speeds[speed]["label"]
```

The same dictionary and function pairing is used for turning the motor on and off and setting the direction of the motor.

```python
# enable dictionaries
on = {
    "en" : False,
    "icon" : 6,
    "label" : "ON"
  }

off = {
    "en" : True,
    "icon" : 5,
    "label" : "OFF"
  }

onDict = [on, off]

def onOff(go):
    EN.value = onDict[go]["en"]
    icons_grid[0] = onDict[go]["icon"]
    main_area.text = onDict[go]["label"]

# direction dictionaries
clock = {
    "dir" : True,
    "icon" : 3,
    "label" : "CLOCK"
  }
counter = {
    "dir" : False,
    "icon" : 4,
    "label" : "COUNTER"
  }

directions = [clock, counter]

def changeDirection(direct):
    DIR.value = directions[direct]["dir"]
    icons_grid[0] = directions[direct]["icon"]
    main_area.text = directions[direct]["label"]
```

There is an array of menu states that tracks whether you are scrolling through the menu options (`"scroll"`) or actively changing a setting.

```python
# menu states
states = ["SPEED", "ON/OFF", "DIRECTION", "scroll"]
state_icons = [2, 6, 3]
```

## asyncio Class

Since this code utilizes a lot of multitasking, with menu scrolling and toggling the step pin to move the motor, [asyncio](https://docs.circuitpython.org/projects/asyncio/en/latest/api.html) is used. To track states of things across the different tasks in an asyncio program, you need to create a `class`. The `class` for this program is called `GUI_Attributes` and has items for tracking the state of the menu and the `current_speed` of the turntable.

```python
class GUI_Attributes:
    def __init__(self):
        self.menu = 0
        self.index = 0
        self.state = states[3]
        self.current_speed = 1
```

## asyncio Tasks

Three tasks are used in the code. The first is called `step()` and it toggles the step pin on the motor driver to move the turntable.

```python
async def step():
    while True:
        if EN.value is False:
            STEP.value = not STEP.value
        await asyncio.sleep(0)
```

The next function is called `read_encoder()` and it handles the rotary encoder and scrolling through the various menus. When `self.states` is set to `scroll`, the encoder scrolls through the three menu options. When `self.states` is set to one of the three menus (`SPEED`,&nbsp;`ON/OFF` or&nbsp;`DIRECTION`), then the rotary encoder scrolls through the options associated with those menus and runs the function to change the associated pin value and icon on the OLED.

```python
async def read_encoder(p, last_p, choice):
    while True:
        p = encoder.position
        if p != last_p:
            if p &gt; last_p:
                if choice.state is states[0]:
                    choice.index = (choice.index + 1) % 3
                    change_speed(choice.index)
                    choice.current_speed = choice.index
                if choice.state is states[1]:
                    choice.index = (choice.index + 1) % 2
                    onOff(choice.index)
                if choice.state is states[2]:
                    choice.index = (choice.index + 1) % 2
                    changeDirection(choice.index)
                if choice.state is states[3]:
                    choice.menu = (choice.menu + 1) % 3
                    main_area.text = states[choice.menu]
                    icons_grid[0] = state_icons[choice.menu]
            else:
                if choice.state is states[0]:
                    choice.index = (choice.index - 1) % 3
                    change_speed(choice.index)
                    choice.current_speed = choice.index
                if choice.state is states[1]:
                    choice.index = (choice.index - 1) % 2
                    onOff(choice.index)
                if choice.state is states[2]:
                    choice.index = (choice.index - 1) % 2
                    changeDirection(choice.index)
                if choice.state is states[3]:
                    choice.menu = (choice.menu - 1) % 3
                    main_area.text = states[choice.menu]
                    icons_grid[0] = state_icons[choice.menu]
            print(choice.menu)
            last_p = p
        await asyncio.sleep(0.1)
```

The final task is `read_button()`. This task handles the button input on the rotary encoder and changes the value of `self.state`&nbsp;from the `GUI_Attributes` `class`. If the value of `self.state` is scroll and the button is pressed, then you will enter the menu for the selected option (`SPEED`,&nbsp;`ON/OFF`&nbsp;or&nbsp;`DIRECTION`). If `self.state` is one of these selected menus and the button is pressed, then `self.state` is set back to scroll and you are able to scroll through the menu options without changing any settings.

```python
async def read_button(choice, b_state):
    while True:
        if not button.value and not b_state:
            if choice.state == states[3]:
                choice.state = states[choice.menu]
                if choice.state == states[0]:
                    choice.index = choice.current_speed
                    change_speed(choice.index)
                if choice.state == states[1]:
                    choice.index = EN.value
                    onOff(choice.index)
                if choice.state == states[2]:
                    choice.index = DIR.value
                    changeDirection(choice.index)
            else:
                choice.state = states[3]
                main_area.text = states[choice.menu]
            b_state = True
        if button.value and b_state:
            b_state = False
        await asyncio.sleep(0.1)
```

## asyncio main()

The class and tasks are packed into an asyncio program called `main()`. Each task is instantiated with the `create_task()` function and then put into the program with the `gather()` function. `main()` runs as a loop with the `run()` function.

```python
async def main():
    choice = GUI_Attributes()
    step_task = asyncio.create_task(step())
    enc_task = asyncio.create_task(read_encoder(pos, last_pos, choice))
    button_task = asyncio.create_task(read_button(choice, button_state))
    main_area.text = states[choice.menu]
    icons_grid[0] = state_icons[choice.menu]
    await asyncio.gather(step_task, enc_task, button_task)

asyncio.run(main())
```

If you want to learn more about asyncio in CircuitPython check out the [Learn Guide](https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio).

### Cooperative Multitasking in CircuitPython with asyncio - Overview

[Cooperative Multitasking in CircuitPython with asyncio](https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio)
[Overview](https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio/overview)
# Stepper Motor Turntable

## Lazy Susan

## SNUDDA Disassembly

Place the turntable with the bottom base facing up and locate the hex nut in the center.

![3d_printing_snudda-bottom.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/685/medium640/3d_printing_snudda-bottom.jpg?1737745881)

## Remove Base

Use a 13mm metric socket to unfasten the hex nut. Remove the wooden base to revel the swivel plate underneath.&nbsp;

![3d_printing_snudda-unscrew.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/686/medium640/3d_printing_snudda-unscrew.jpg?1737745997)

![3d_printing_snudda-base-removed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/687/medium640/3d_printing_snudda-base-removed.jpg?1737746006)

## Remove Swivel Plate

Use a Phillips head screwdriver to unfasten the three wood screw from the swivel plate.

Move the swivel plate and center bolt off the tabletop and save them.

The swivel plate, hex nut, bolt, and three wood screws will be repurposed later in the build.

![3d_printing_snudda-susan-unscrew.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/688/medium640/3d_printing_snudda-susan-unscrew.jpg?1737746035)

![3d_printing_snudda-hardware-removed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/689/medium640/3d_printing_snudda-hardware-removed.jpg?1737746051)

# Stepper Motor Turntable

## Wiring

## Shorten Stepper Wires

Use wire cutters to reduce the length of the four wires from the stepper motor to be 7in (18cm) in length.

Use wire strippers to remove a bit of insulation from each of the wires. Then, apply a bit of solder to tin the tips of the exposed strands of wire.

![3d_printing_stepper-wire-short.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/692/medium640/3d_printing_stepper-wire-short.jpg?1737746166)

## Current Limit on TMC2209

Use a small flat head screw driver to adjust the potentiometer on the TMC2209 stepper driver.

Rotate the potentiometer counter-clockwise so the position matches the photo.

This will limit current to the stepper motor which will reduce the overall heat of the motor while it's operating.

![3d_printing_tmc2209-pot.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/690/medium640/3d_printing_tmc2209-pot.jpg?1737746120)

## Wires for TMC2209

Use the 26AWG wires to create seven different connections for the TMC2209 stepper driver. Use different colored wires and make them approximently 4.5in (11.5cm) in length.

Use wire strippers to remove a bit of insulation from both ends of each wires. Then, apply a bit of solder to tin the tips of the exposed strands of wire.

![3d_printing_tmc2209-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/691/medium640/3d_printing_tmc2209-wires.jpg?1737746148)

## Connect Wires to TMC2209

Solder the wires to the following pins on the stepper motor driver.

- VDD
- GND
- DIR
- STEP
- MS1
- MS2
- EN

![3d_printing_tmc2209-solder-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/693/medium640/3d_printing_tmc2209-solder-wires.jpg?1737746188)

## Connect Wires to KB2040

Solder the wires from the TMC2209 driver to the following pins on the KB2040 dev board.

- VDD to 3V
- GND to G
- DIR to 5
- STEP to 6
- MS1 to 2
- MS2 to 3
- EN to 4

![3d_printing_kb2040-solder-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/694/medium640/3d_printing_kb2040-solder-wires.jpg?1737746465)

## Wires for MPM3601 and DC Jack

Prep six more wires for the DC barrel jack and MPM3601 buck converter. These can be 4.5in (11.5cm) in length.

Use wire strippers to remove a bit of insulation from both ends of each wires. Then, apply a bit of solder to tin the tips of the exposed strands of wire.

![3d_printing_dc-buck-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/695/medium640/3d_printing_dc-buck-wires.jpg?1737746723)

## Solder Wires to MPM3601

Solder the wires to the following pins on the MPM3601 buck converter.

- GND
- 5V
- VIN

![3d_printing_buck-solder-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/696/medium640/3d_printing_buck-solder-wires.jpg?1737746783)

## Solder MPM3601 to KB2040

Solder the following wire connections to the KB2040 dev board.

- GND to GND
- 5V to RAW

![3d_printing_buck-kb2040-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/701/medium640/3d_printing_buck-kb2040-solder.jpg?1737747383)

## Mount DC Jack

Secure the DC jack to the 3D printed mount before making any wired connections.

Use the included hex nut to secure the DC jack to the 3D printed mount.

![3d_printing_dc-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/698/medium640/3d_printing_dc-mount.jpg?1737747308)

![3d_printing_dc-mount-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/699/medium640/3d_printing_dc-mount-secure.jpg?1737747341)

## Solder Wires to DC Jack

Solder two black wires to the ground terminal (pin on the far side) on the DC jack.

Solder two of the red wires to the voltage terminal (the large pin in the center) on the DC Jack.

![3d_printing_dc-gnd-solder-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/702/medium640/3d_printing_dc-gnd-solder-wires.jpg?1737747401)

![3d_printing_dc-vcc-solder-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/703/medium640/3d_printing_dc-vcc-solder-wires.jpg?1737747418)

## Solder DC Jack to KB2040

Solder the following wires on the DC jack to the KB2040 dev board.

- GND to GND

The remaining wires on the DC jack will be connected to the TMC2209 stepper motor driver.

![3d_printing_dc-kb2040-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/705/medium640/3d_printing_dc-kb2040-solder.jpg?1737748253)

## Wire Checks

Double check all of the wires have been connected to the appropriate pins.&nbsp;

![3d_printing_circuit-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/706/medium640/3d_printing_circuit-wired.jpg?1737748319)

# Stepper Motor Turntable

## Assembly

## Secure TMC2209

Use M2.5 x 6mm long machine screws to secure the TMC2209 to the 3D printed PCB mount.

Place the TMC2209 over the four standoffs on the 3D printed PCB mount with the mounting holes lined up.

Insert and fasten two M2.5 x 6mm long to secure the TMC2209 to the 3D printed PCB mount.

![3d_printing_pcb-mount-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/707/medium640/3d_printing_pcb-mount-screws.jpg?1737748395)

![3d_printing_tmc2209-secure-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/708/medium640/3d_printing_tmc2209-secure-mount.jpg?1737748409)

## Secure MPM3601

Place the MPM3601 over the remaining standoff on the 3D printed PCB mount with the mounting hole lined up.

Insert and fasten a single M2.5 x 6mm long machine screw to secure the MPM3601 buck converter to the 3D printed PCB mount.

![3d_printing_buck-secure-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/709/medium640/3d_printing_buck-secure-mount.jpg?1737748472)

![3d_printing_pcb-mount-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/710/medium640/3d_printing_pcb-mount-secured.jpg?1737748528)

## Secure KB2040

Orient the KB2040 dev board with the 3D printed KB2040 mount.

Insert the KB2040 dev board into the 3D printed KB2040 mount so the edges of the PCB are fitted underneath the corner clips.

&nbsp;

![3d_printing_kb2040-mount.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/711/medium640/3d_printing_kb2040-mount.jpg?1737748546)

![3d_printing_kb2040-mount-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/712/medium640/3d_printing_kb2040-mount-installed.jpg?1737748561)

## Mounted Components

Double check the KB2040, TMC2209, MPM3601 and DC jack have been properly secured to their 3D printed mounts.

![3d_printing_circuit-mounts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/713/medium640/3d_printing_circuit-mounts.jpg?1737748588)

## Stepper Mount

Orient the stepper motor mount with the 3D printed motor mount.

Use 4x M3 x 6mm long machine screws to secure the stepper motor to the 3D printed motor mount.

![3d_printing_motor-mount-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/714/medium640/3d_printing_motor-mount-screws.jpg?1737748628)

![3d_printing_motor-mount-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/715/medium640/3d_printing_motor-mount-secure.jpg?1737748658)

![3d_printing_motor-mount-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/716/medium640/3d_printing_motor-mount-secured.jpg?1737748684)

## Connect Stepper Motor and DC Jack

Use the screw-block terminals on the TMC2209 driver to secure the four wires from the stepper motor and the two wires from the DC jack.

- Blue Wire (B-) - 2B
- Red Wire (B+) - 2A
- Black Wire (A+) - 1A
- Green Wire (A-) - 1B

![3d_printing_motor-mount-circuit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/717/medium640/3d_printing_motor-mount-circuit.jpg?1737748735)

## Connect STEMMA QT Cables

Use the short STEMMA QT cable to connect the 1.3in OLED to the rotary encoder.

Connect the long STEMMA QT cable to the other end of the 1.3in OLED.

![3d_printing_oled-rotary-stemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/718/medium640/3d_printing_oled-rotary-stemma.jpg?1737748793)

## Connect STEMMA QT to KB2040

Connect the long STEMMA QT cable to the STEMMA QT port on KB2040 dev board.

![3d_printing_kb2040-stemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/719/medium640/3d_printing_kb2040-stemma.jpg?1737749153)

## Circuit Power Test

Connect the adjustable power supply to a wall outlet with the output **NOT** plugged into the circuit. Turn the voltage knob to set it to 12V.&nbsp;

Connect the DC plug from the power supply to the DC jack connected to the circuit.

The OLED should display text and icons. Use the rotary encoder to turn on the stepper motor and test the various settings.

Unplug the DC plug when testing is complete.

![3d_printing_circuit-power-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/720/medium640/3d_printing_circuit-power-test.jpg?1737749198)

## Install Gear to Stepper Motor

Align the 3D printed gear with the shaft of the stepper motor. The flat surface of the gear should be facing up.

Press the gear into the shaft of the stepper motor so it matches the assembly photo.

![3d_printing_motor-gear.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/721/medium640/3d_printing_motor-gear.jpg?1737749371)

![3d_printing_motor-gear-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/722/medium640/3d_printing_motor-gear-install.jpg?1737749386)

## Controller Case

Use 4x M2.5 x 10mm long machine screws and hex nuts to secure the OLED to the 3D printed controller case.

Line up the OLED with the mounting holes on the 3D printed controller case.

![3d_printing_oled-rotary-case-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/723/medium640/3d_printing_oled-rotary-case-screws.jpg?1737749417)

![3d_printing_oled-case-orient.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/724/medium640/3d_printing_oled-case-orient.jpg?1737749437)

## Secure the OLED Display to the Controller Case

Place the OLED into the controller case with the mount holes lined up.

Insert and fasten the four M2.5 x 10mm long screws through the controller case and OLED mounting tabs.

Use the M2.5 hex nuts to secure the OLED to the 3D printed controller case.

![3d_printing_oled-case-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/729/medium640/3d_printing_oled-case-install.jpg?1737749558)

![3d_printing_oled-case-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/730/medium640/3d_printing_oled-case-fasten.jpg?1737749567)

![3d_printing_oled-case-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/731/medium640/3d_printing_oled-case-secured.jpg?1737749591)

## Secure Rotary Encoder to Controller Case

Insert the knob of the rotary encoder through the hole from the inside of the 3D printed controller case.

Use the included hex nut to secure the rotary encoder to the 3D printed controller case.

![3d_printing_rotary-case-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/732/medium640/3d_printing_rotary-case-install.jpg?1737749621)

![3d_printing_rotary-case-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/733/medium640/3d_printing_rotary-case-secured.jpg?1737749638)

## Secure Frame to Bottom Plate

Orient the 3D printed case frame with the bottom plate.

Place the case frame over the bottom plate with the four mounting tabs lined up.

Use four M3 x 6mm long machine screws to secure the two parts together.

Add the rubber feet to corners of the 3D printed bottom plate.

![3d_printing_bottom-case-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/734/medium640/3d_printing_bottom-case-fit.jpg?1737749921)

![3d_printing_bottom-case-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/735/medium640/3d_printing_bottom-case-fasten.jpg?1737749951)

![3d_printing_bottom-case-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/736/medium640/3d_printing_bottom-case-secured.jpg?1737749990)

## Attach Controller Case to Bottom Plate

Use two M3 x 8mm long machine screws and hex nuts to secure the 3D printed controller case to the bottom plate.

![3d_printing_oled-case-bottom-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/737/medium640/3d_printing_oled-case-bottom-screws.jpg?1737750017)

## Secure Controller Case to Bottom Plate

Slide the 3D printed controller case into the designated spot on the bottom plate with the two mounting holes lined up.

Insert and fasten the M3 x 8mm long machine screws through the two parts. Use two M3 hex nuts to secure the two parts together.

![3d_printing_oled-case-bottom-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/738/medium640/3d_printing_oled-case-bottom-fit.jpg?1737750057)

![3d_printing_oled-case-bottom-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/739/medium640/3d_printing_oled-case-bottom-fasten.jpg?1737750069)

![3d_printing_oled-case-bottom-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/740/medium640/3d_printing_oled-case-bottom-secured.jpg?1737750079)

## Secure Motor Mount to Bottom Plate

Place the 3D printed motor mount into the bottom plate with the designated mounting holes lined up.

Insert and fasten four M3 x 6mm long machine screws through the motor mount and bottom plate.

![3d_printing_motor-mount-bottom-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/741/medium640/3d_printing_motor-mount-bottom-fit.jpg?1737750111)

![3d_printing_motor-mount-bottom-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/742/medium640/3d_printing_motor-mount-bottom-fasten.jpg?1737750118)

![3d_printing_motor-mount-bottom-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/743/medium640/3d_printing_motor-mount-bottom-secured.jpg?1737750125)

## Secure KB2040 Mount to Bottom Plate

Place the 3D printed KB2040 mount onto the designated mounting holes on the bottom plate.

Insert two M3 x 10mm long machine screw through the KB2040 mounting tabs and bottom plate. Use two hex nuts to secure the parts together.

![3d_printing_kb2040-mount-bottom-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/744/medium640/3d_printing_kb2040-mount-bottom-fit.jpg?1737750155)

![3d_printing_kb2040-mount-bottom-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/745/medium640/3d_printing_kb2040-mount-bottom-fasten.jpg?1737750176)

![3d_printing_kb2040-mount-bottom-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/746/medium640/3d_printing_kb2040-mount-bottom-secured.jpg?1737750184)

## Secure DC Mount to Bottom Plate

Place the 3D printed DC mount onto the designated mounting holes on the bottom plate.

Insert two M3 x 8mm long machine secures through the DC mounting holes and bottom plate.

![3d_printing_dc-mount-bottom-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/747/medium640/3d_printing_dc-mount-bottom-fit.jpg?1737750202)

![3d_printing_dc-mount-bottom-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/748/medium640/3d_printing_dc-mount-bottom-fasten.jpg?1737750269)

![3d_printing_dc-mount-bottom-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/749/medium640/3d_printing_dc-mount-bottom-secured.jpg?1737750277)

## Secure PCB Mount to Bottom Plate

Place the 3D printed PCB mount onto the designated mounting holes on the bottom plate.

Insert two M3 x 6mm long machine secures through the PCB mount and the bottom plate.

![3d_printing_pcb-mount-bottom-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/750/medium640/3d_printing_pcb-mount-bottom-fasten.jpg?1737750455)

![3d_printing_pcb-mount-bottom-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/751/medium640/3d_printing_pcb-mount-bottom-secured.jpg?1737750463)

## Connect STEMMA QT to KB2040

Double check the STEMMA QT cable is connecting the OLED to the KB2040 dev board.

![3d_printing_kb2040-bottom-stemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/752/medium640/3d_printing_kb2040-bottom-stemma.jpg?1737750490)

## Power Test

Insert the DC plug from the power supply to the DC jack. Test the circuit using the rotary encoder knob to adjust the various settings to turn on the stepper motor.

The green LEDs should light up on the 1.3in OLED and rotary encoder.

![3d_printing_bottom-power-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/753/medium640/3d_printing_bottom-power-test.jpg?1737750553)

![3d_printing_bottom-stemma-check.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/754/medium640/3d_printing_bottom-stemma-check.jpg?1737750567)

## Lazy Susan Swivel Plate

You have the option to use the wooden tabletop or the 3D printed tabletop in your build.

Get the Lazy Susan swivel plate ready to install onto your preferred tabletop.

&nbsp;

![3d_printing_susan-bolt-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/755/medium640/3d_printing_susan-bolt-install.jpg?1737750581)

![3d_printing_susan-bolt-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/756/medium640/3d_printing_susan-bolt-installed.jpg?1737750588)

# Stepper Motor Turntable

## IKEA Top

Use the instructions on this page if you would like to use the Ikea wooden lazy susan top. If you would like to use the 3D printed top, skip to the next page.

## Install Gear & Susan

Place the 3D printed internal gear over the center of the wooden tabletop with the three mounting holes lined up.

Place the Lazy Susan swivel plate with the bolt over the 3D printed internal gear with the mounting holes lined up.

![3d_printing_tabletop-ikea-gear-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/785/medium640/3d_printing_tabletop-ikea-gear-fit.jpg?1737835469)

![3d_printing_tabletop-ikea-susan-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/786/medium640/3d_printing_tabletop-ikea-susan-fit.jpg?1737835478)

## Secure Susan

Insert and fasten the three wood screws through the mounting holes to secure the three parts together.

![3d_printing_tabletop-ikea-susan-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/787/medium640/3d_printing_tabletop-ikea-susan-secured.jpg?1737835500)

## Install Susan Mount

Place the Lazy Susan Mount over the swivel plate with the bolt going through the center hole.

Insert the hex nut onto the thread of the bolt.

![3d_printing_susan-ikea-mount-top-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/788/medium640/3d_printing_susan-ikea-mount-top-fit.jpg?1737835512)

![3d_printing_susan-ikea-mount-top-nut.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/789/medium640/3d_printing_susan-ikea-mount-top-nut.jpg?1737835538)

## Secure Susan Mount

Use a 13mm metric socket to fasten the nut to the bolt. The Lazy Susan mount should spin freely.

![3d_printing_susan-ikea-mount-top-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/790/medium640/3d_printing_susan-ikea-mount-top-fasten.jpg?1737835584)

![3d_printing_susan-ikea-mount-top-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/792/medium640/3d_printing_susan-ikea-mount-top-secured.jpg?1737835614)

## Align Mount and Bottom Plate

Begin joining the Susan Mount to the bottom plate.

Orient the Susan mount with the stepper motor so the side with the large opening allows the parts to fit together.&nbsp;

The various wires should pass through the wall openings in the Susan mount.&nbsp;

![3d_printing_top-ikea-case-align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/793/medium640/3d_printing_top-ikea-case-align.jpg?1737835633)

## Secure Susan Mount to Bottom Plate

Turn over the tabletop so the bottom plate is facing up.

Position the bottom plate so the four corresponding mounting holes are lined up with the mounting holes on the Susan mount.

Insert and fasten four M3 x 6mm long machine screws to secure the Susan mount to the bottom plate.

![3d_printing_top-ikea-case-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/794/medium640/3d_printing_top-ikea-case-fasten.jpg?1737835645)

![3d_printing_top-ikea-case-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/795/medium640/3d_printing_top-ikea-case-secure.jpg?1737835657)

## Install Knob

Line up the 3D printed knob with the shaft of the rotary encoder.

Press the 3D printed knob into the shaft of the rotary encoder.

Plug the power supply to the DC jack on the back of the turntable.

![3d_printing_ikea-rotary-knob-inserted.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/800/medium640/3d_printing_ikea-rotary-knob-inserted.jpg?1737835870)

![](https://cdn-learn.adafruit.com/assets/assets/000/134/799/medium800/3d_printing_top-ikea-final.jpg?1737835842)

## Final Build

Congratulations on your build! Use the rotary encoder to adjust the various settings on the OLED.

# Stepper Motor Turntable

## 3DP Top

## 3D Printed Top Assembly

Orient the 3D printed tabletop with the three standoffs facing up.

Place the internal gear over the tabletop with the three mounting holes lined up.

![3d_printing_tabletop-print.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/757/medium640/3d_printing_tabletop-print.jpg?1737750619)

![3d_printing_tabletop-gear-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/758/medium640/3d_printing_tabletop-gear-fit.jpg?1737750630)

## Secure Lazy Susan

Place the Lazy Susan swivel plate over the internal gear with the mounting holes lined up.

Use three M5 x 6mm long machine screws to secure the swivel plate to the internal gear and tabletop.

![3d_printing_tabletop-susan-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/759/medium640/3d_printing_tabletop-susan-fit.jpg?1737750664)

![3d_printing_tabletop-susan-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/760/medium640/3d_printing_tabletop-susan-fasten.jpg?1737750677)

![3d_printing_tabletop-suan-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/761/medium640/3d_printing_tabletop-suan-secured.jpg?1737750687)

## Secure Lazy Susan Mount

Place the Susan mount over the swivel plate with the bolt going through the center hole.

Use a 13mm metric socket to secure the nut to the bolt.

The Susan mount is spin freely.

![3d_printing_susan-mount-top-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/763/medium640/3d_printing_susan-mount-top-fit.jpg?1737750746)

![3d_printing_susan-mount-top-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/764/medium640/3d_printing_susan-mount-top-fasten.jpg?1737750754)

![3d_printing_susan-mount-top-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/765/medium640/3d_printing_susan-mount-top-secured.jpg?1737750772)

## Align Susan Mount and Bottom Plate

Begin joining the Susan Mount to the bottom plate.

Orient the Susan mount with the stepper motor so the side with the large opening allows the parts to fit together.&nbsp;

The various wires should pass through the wall openings in the Susan mount.&nbsp;

![3d_printing_top-case-align.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/766/medium640/3d_printing_top-case-align.jpg?1737750810)

## Secure Susan Mount to Bottom Plate

Turn over the tabletop so the bottom plate is facing up.

Position the bottom plate so the four corresponding mounting holes are lined up with the mounting holes on the Susan mount.

Insert and fasten four M3 x 6mm long machine screws to secure the Susan mount to the bottom plate.

![3d_printing_top-case-fit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/767/medium640/3d_printing_top-case-fit.jpg?1737750847)

![3d_printing_top-case-fasten.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/768/medium640/3d_printing_top-case-fasten.jpg?1737750866)

## Install Knob

Line up the 3D printed knob with the shaft of the rotary encoder.

Press the 3D printed knob into the shaft of the rotary encoder.

Plug the power supply to the DC jack on the back of the turntable.

![3d_printing_rotary-knob-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/769/medium640/3d_printing_rotary-knob-install.jpg?1737750882)

![3d_printing_rotary-knob-inserted.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/770/medium640/3d_printing_rotary-knob-inserted.jpg?1737750906)

## Final Build

Congratulations on your build! Use the rotary encoder to adjust the various settings on the OLED.

![3d_printing_final-build-poweron.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/771/medium640/3d_printing_final-build-poweron.jpg?1737750925)

# Stepper Motor Turntable

## Usage

## Using the Display Menu

Turn the knob to switch menu screens between **On/Off** , **Direction** , and **Speed**.

Press knob to select a menu item.

Turn the knob to select a setting.

Press the knob to enable the on-screen setting and return to the main menu.

![3d_printing_demo-menu.gif](https://cdn-learn.adafruit.com/assets/assets/000/134/810/medium640thumb/3d_printing_demo-menu.jpg?1737991231)

## Adjust Motor Speed

Press the knob to select the speed setting. Turn the knob to change speed, choose from three options, slow, medium and fast.

Press know to select the on-screen speed setting.

![3d_printing_demo-speed.gif](https://cdn-learn.adafruit.com/assets/assets/000/134/811/medium640thumb/3d_printing_demo-speed.jpg?1737991359)


## Featured Products

### Adafruit TMC2209 Stepper Motor Driver Breakout Board

[Adafruit TMC2209 Stepper Motor Driver Breakout Board](https://www.adafruit.com/product/6121)
Stepper motors are used for CNC machines, 3D printers, and whenever else one needs precise, powerful motion. But to get good behavior from steppers you need a motor driver chip that can provide high bursts of current, and for smooth motion, be able to PWM that current for microstepping...

Out of Stock
[Buy Now](https://www.adafruit.com/product/6121)
[Related Guides to the Product](https://learn.adafruit.com/products/6121/guides)
### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

In Stock
[Buy Now](https://www.adafruit.com/product/5302)
[Related Guides to the Product](https://learn.adafruit.com/products/5302/guides)
### MPM3610 5V Buck Converter Breakout - 21V In 5V Out at 1.2A

[MPM3610 5V Buck Converter Breakout - 21V In 5V Out at 1.2A](https://www.adafruit.com/product/4739)
This little buck converter based on the MPM3610 is a marvel, taking up to 21V input and providing a 5V output with up to 1.2A current. It's great for supplying power to popular 5V voltage circuits from a range of battery or power options. &nbsp;This chip provides up to 1.2 Amp load current...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4739)
[Related Guides to the Product](https://learn.adafruit.com/products/4739/guides)
### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

Out of Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
### Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder

[Adafruit I2C Stemma QT Rotary Encoder Breakout with Encoder](https://www.adafruit.com/product/5880)
Rotary encoders are soooo much fun! Twist em this way, then twist them that way. Unlike potentiometers, they go all the way around and often have little detents for tactile feedback. But, if you've ever tried to add encoders to your project you know that they're a real challenge to...

In Stock
[Buy Now](https://www.adafruit.com/product/5880)
[Related Guides to the Product](https://learn.adafruit.com/products/5880/guides)
### Adjustable Power Supply w/ 2.1mm / 5.5mm DC - 3V to 24V at 2 Amp

[Adjustable Power Supply w/ 2.1mm / 5.5mm DC - 3V to 24V at 2 Amp](https://www.adafruit.com/product/5130)
[Put your Snap! cassette on and sing along to "I got the power!"](https://www.youtube.com/watch?v=j1BNcSBApOU) with this super useful power supply adapter where you can easily change the voltage with a snap of your fingers. On the front are a potentiometer knob and a LED...

In Stock
[Buy Now](https://www.adafruit.com/product/5130)
[Related Guides to the Product](https://learn.adafruit.com/products/5130/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 200mm Long](https://www.adafruit.com/product/4401)
This 4-wire cable is a little over 200mm / 7.8" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4401)
[Related Guides to the Product](https://learn.adafruit.com/products/4401/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)

## Related Guides

- [Adafruit I2C QT Rotary Encoder](https://learn.adafruit.com/adafruit-i2c-qt-rotary-encoder.md)
- [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040.md)
- [Adafruit TMC2209 Stepper Motor Driver Breakout Board](https://learn.adafruit.com/adafruit-tmc2209-stepper-motor-driver-breakout-board.md)
- [Robotic AI Bear using ChatGPT](https://learn.adafruit.com/robotic-ai-bear-using-chatgpt.md)
- [ESP32-S3 BLE RS-232 Controller](https://learn.adafruit.com/esp32-s3-ble-rs232-controller.md)
- [Pip-Boy 2040 Wrist-Mounted Prop](https://learn.adafruit.com/pip-boy-2040.md)
- [Super Nintendo USB Controller](https://learn.adafruit.com/super-nintendo-usb-controller.md)
- [Arcade Bonnet Controller](https://learn.adafruit.com/arcade-bonnet-controller.md)
- [Monitor Your Greenhouse with a No-Code Environmental Sensor](https://learn.adafruit.com/monitor-your-greenhouse-with-a-no-code-environmental-sensor.md)
- [Steampunk Cameo Necklace with OLED Display](https://learn.adafruit.com/steampunk-cameo-necklace.md)
- [Programmable Wireless BLE Gesture Mouse](https://learn.adafruit.com/ble-wireless-gesture-mouse.md)
- [Kitty Toe Bean Keypad with Color TFT](https://learn.adafruit.com/kitty-toe-bean-paw-keypad-color-tct.md)
- [Holiday Tree with Feather RP2040 Scorpio](https://learn.adafruit.com/holiday-tree-with-scorpio.md)
- [Ambient Sound Machine](https://learn.adafruit.com/ambient-machine.md)
- [USB to Eurorack Power Supply](https://learn.adafruit.com/usb-to-eurorack-power-supply.md)
- [Stand for Feather ESP32 with Reverse TFT](https://learn.adafruit.com/stand-for-feather-esp32-with-reverse-tft.md)
- [Feather RP2350 Audio Reactive Video Synth](https://learn.adafruit.com/feather-rp2350-audio-reactive-video-synth.md)
- [LED Protest Sign](https://learn.adafruit.com/led-protest-sign.md)
