Spinning Tales : Arduino Turntable Step-by-Step Tutorial (Part 2)

 

Completed Turntable with the control board

Welcome back to my deep dive into the creation of a low-cost DIY Arduino turntable designed for photogrammetry enthusiasts. In this continuation, I will share a detailed, step-by-step breakdown of the build process, highlighting the technical challenges and solutions, while providing comprehensive resources to empower you to replicate this project.

Components

The primary goal was to design a reliable and cost-effective turntable that can be easily assembled by hobbyists. The focus was on using readily available parts and open-source software to keep the project accessible. Below is a detailed component breakdown, including links, for each part needed, for the project:

1. NEMA 17 Stepper Motor
Quantity: 2-3
Why? Chosen for its balance between cost and performance. NEMA 17 offers sufficient torque for precise rotations necessary in photogrammetry without being overly robust for lightweight platform applications. Compared to larger steppers like the NEMA 23, which offers more power but at a higher cost and size, the NEMA 17 is more suited for desktop projects where space and budget are limited.

2. A4988 Stepper Motor Driver
Quantity: 2-3
Why? The A4988 is a reliable and widely used motor driver that offers easy interfacing with Arduino, making it ideal for beginners and intermediate users alike. It supports micro-stepping which is essential for smooth and accurate rotation. Other drivers like the DRV8825 could also be used but typically cost more and require additional adjustments, making the A4988 a more straightforward choice for this project.

3. 608 Bearing 8x22x7
Quantity: 4-6
Why? These standard skateboard bearings are cost-effective and easily available. They are durable and provide smooth rotation with minimal friction, which is crucial for the accuracy of the turntable. Alternative options like specialized robotics bearings offer higher precision but at a significantly higher cost, making them overkill for this application.

4. 12V Adapter with Female Adapter
Quantity: 1
Why? This adapter provides a reliable and stable power source for the project. 12V is typically needed for the stepper motors, and using a dedicated adapter ensures consistent performance. Alternatives like USB power sources do not generally offer sufficient current for larger motors and can lead to performance issues.

5. Male – Male Jumper Wires
Quantity: 1 pack
Why? Essential for making connections between the Arduino, motor driver, and other components. Chosen for their flexibility and ease of use, they can be quickly reconfigured as needed without soldering, making prototyping faster and simpler. Compared to other connectors, these are very cost-effective and work well in a breadboard setup.

6. Breadboard
Quantity: 1
Why? A breadboard is ideal for this type of project because it allows for easy adjustments and experimentation without permanent changes. This medium-sized breadboard was selected for its sufficient size to fit all components while remaining compact, offering a balance between workspace and portability. I do have plans for using a PCB board in future iterations. More details on it later.

7. Arduino Uno R3
Quantity: 1
Why? The Arduino Uno R3 is the standard for many DIY electronics projects due to its robust community support, extensive libraries, and compatibility with a wide range of shields and accessories. It strikes an ideal balance between functionality, price, and user-friendliness, making it preferable over more powerful boards like the Arduino Mega when simplicity and cost are considered.

8. Push Buttons
Quantity: 3

9. 330 Ohm Resistors
Quantity: 4

The control board

STL Files

For each part, I’ve created STL files that you can download and print. The files are designed to be printed with common filament materials like PLA or ABS, which offer a good balance between strength and ease of printing. You can download the .stl files from: https://github.com/tashrique/DIY-Turntable-Makerspace-Resources.

  • Base V2: This is the foundation of the turntable. It holds the stepper motor and the bearings.
  • Rotating Platform V2: This part is mounted on top of the bearings and is directly driven by the stepper motor. It is where the object to be scanned is placed.
  • Bearing Holders: These components are used to hold the 608 bearings in place. Print 3 pieces of these.

3D Printing Instructions

  • Material: PLA, PETG, ABS, or ASA
  • Layer Height: 0.2 mm for a good balance of speed and detail.
  • Infill: 15% is sufficient for structural integrity but can be increased for parts under more stress, like the motor mount and gear set.
  • Supports: All parts should print well without supports.
  • Bed Adhesion: Use a raft or brim if you experience issues with bed adhesion during printing.

Assembly Tips

Once the parts are printed, follow these tips for assembly:

  • Before the final assembly, test fit all parts together. This helps identify any print errors or adjustments needed.
  • If some parts don’t fit perfectly, you may need to sand or trim them slightly.
  • Use appropriate screws and adhesive to secure the parts firmly. This ensures the turntable remains stable during operation.

Completed assembly of the turntable

Assembly Process

Assembly Process for the Non-Electronic Components

Tools and Materials Needed

  • Super Glue (optional, for additional stability)
  • Sand Paper (optional, to make edges smooth)

Step 1: Preparing the Base Plate

  • Start by preparing the base plate, clear the base plate of any excess material from printing.

Step 2: Installing the Motor

  • Align the motor mount with the designated area on the base plate.
  • Slide the motor into the slot
  • Ensure the motor shaft protrudes through the mount to align with the gear system.

Step 3: Setting Up Bearings

Objective: Install the bearings that will support the rotating platform.

  • Position the bearing holders on the base plate as per the design.
  • Insert the 608 bearings into the holders. If the fit is tight, you may gently tap them into place using a rubber mallet. You might also want to use superglue to secure the holders in place.
  • Ensure the bearings spin freely without obstruction.

Step 4: Installing the Rotating Platform and Connecting the motor

  • Carefully align the rotating platform with the top of the bearings.
  • Slide and apply moderate pressure to put the motor shaft in the connector until it is stable and level.
  • Check that it rotates smoothly without catching or excessive play.

Step 5: Final Adjustments and Testing

  • Manually rotate the platform to check for smooth motion and correct gear alignment.
  • Make any necessary adjustments to the tightness of screws or alignment of gears.
  • Optionally, apply a small amount of lubricant to the gears and bearings for smoother operation.

Schematic diagram of the electronic components and pin connections

Electronic Assembly Guide

Tools and Materials Needed

  • Wire Cutters
  • Wire Strippers
  • Soldering Iron (optional, for a more permanent setup)
  • Multimeter (for checking connections)

Step 1: Setting Up the Arduino
Objective: Prepare the Arduino board for connection.

  • Place the Arduino on your workbench or mount it on the base plate.
  • Ensure that it is accessible for connections to both power and other components like the LCD and stepper motor driver.

Step 2: Connecting the Stepper Motor Driver
Objective: Install the A4988 stepper motor driver (Tip: stepper driver documentation).

  • Connect the motor driver to the Arduino using male-to-female jumper wires. Here’s a basic pin connection guide:
  • Connect the DIR (Direction) pin on the driver to a chosen digital pin on the Arduino (e.g., D2).
  • Connect the STEP pin on the driver to another digital pin on the Arduino (e.g., D3).
  • Ensure ENABLE pin is connected if your driver requires it, otherwise it can be left unconnected or tied to ground.
  • Connect the VDD on the A4988 to the Arduino’s 5V output, and GND to one of the Arduino’s ground pins.

Step 3: Wiring the Stepper Motor
Objective: Connect the NEMA 17 stepper motor to the A4988 driver (Tip: NEMA17 documentation).

  • Identify the wire pairs of the stepper motor using a multimeter or by referring to the motor’s datasheet.
  • Connect these wires to the respective A and B terminals on the motor driver. Ensure that the polarity matches the driver’s requirements.
  • Double-check the connections to prevent any potential damage due to incorrect wiring.

Step 4: Adding the LCD Display
Objective: Connect the 16×2 LCD to the Arduino to display status and control messages.

  • Use a breadboard or direct jumper wires to connect the LCD. Typical connections are:
  • RS (register select) to a digital pin (e.g., D4).
  • E (enable) to another digital pin (e.g., D5).
  • D4 to D7 data pins of the LCD to digital pins D6, D7, D8, D9 on the Arduino.
  • Connect the VSS pin of the LCD to the ground and VDD to 5V on the Arduino.
  • Connect a potentiometer to the VO (contrast adjust) pin for contrast control.

Step 5: Power Supply Connection
Objective: Ensure proper power supply connections.

  • Connect the 12V adapter to the VMOT and GND on the stepper motor driver to power the stepper motor.
  • Ensure the Arduino is powered either via USB or an external 9V adapter connected to the VIN pin.

Step 6: Testing and Debugging
Objective: Test the setup to ensure everything is working as expected.

  • Upload a simple test sketch to the Arduino to check motor movements and LCD functionality.
  • Adjust the potentiometer to get a clear display on the LCD.
  • Use the multimeter to troubleshoot any connectivity issues.

Step 7: Final Setup
Objective: Secure all electronic components and clean up the wiring.

  • Use zip ties or cable management clips to organize and secure wires.
  • Ensure all connections are stable and that there’s no risk of loose wires interfering with the moving parts.

Wiring Diagram

LCD Pin Mapping
Reset = 7;
Enable = 8;
D4 = 9;
D5 = 10;
D6 = 11;
D7 = 12;

Stepper Motor Pin Mapping
Step = 6
Direction = 5
(Type of driver: with 2 pins, STEP, DIR)

Programming the Turntable

#include <LiquidCrystal.h>
#include <AccelStepper.h>

void(* resetFunc) (void) = 0;

/*
LCD Pin Map
Reset = 7;
Enable = 8;
D4 = 9;
D5 = 10;
D6 = 11;
D7 = 12;

Stepper PIN Map
Step = 6
Direction = 5
(Type of driver: with 2 pins, STEP, DIR)

*/


AccelStepper stepper(1, 6, 5);

const int rs = 7, en = 8, d4 = 9, d5 = 10, d6 = 11, d7 = 12;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

int green = 2;
int red = 3;
int button = 4;
int controls = A1;
int speeds = A0;


String currentStat = "Reset";
String prevStat = "Reset";
int stepsTaken = 0;
bool buttonPressed = false;
bool actionTaken = false;
int buttonClicked = 0;
int currentSpeed = 0;


void setup() {
lcd.begin(16, 2);
pinMode(green, OUTPUT);
pinMode(red, OUTPUT);
pinMode(button, INPUT);

resetControls();
}


void loop() {
runProgram();
}

void runProgram() {
currentSpeed = readSpeed();
currentStat = getStatus();
buttonClicked = buttonClick();

digitalWrite(red, HIGH);

lcd.setCursor(0, 0);
lcd.print(": " + currentStat);

lcd.setCursor(8, 0);
lcd.print("-> " + String(currentSpeed) + "ms");


if (buttonClicked == 1) {
lcd.clear();

//Reset
if (currentStat == "Reset") {
lcd.setCursor(0, 0);
lcd.print("RESETTING...");
stepsTaken = 0;
prevStat = currentStat;
digitalWrite(green, LOW);
digitalWrite(red, HIGH);
resetFunc();
}

//Resume
else if (currentStat == "Start" && prevStat == "Pause") {
lcd.setCursor(0, 1);
lcd.print("RESUMED @" + String(currentSpeed));
prevStat = currentStat;
stepsTaken = commandStart(currentSpeed, stepsTaken);
}


//Start
else if (currentStat == "Start") {
lcd.setCursor(0, 1);
lcd.print("STARTED @" + String(currentSpeed));
prevStat = currentStat;
stepsTaken = commandStart(currentSpeed, 0);
}

else if (currentStat == "Pause" && prevStat == "Pause") {
lcd.setCursor(0, 1);
lcd.print("Already Paused");
}

//Undefined
else {
lcd.setCursor(0, 1);
lcd.print("Invalid Command");
}
}
}


/*--------------------------------------*/

int commandStart(int currentSpeed, int initial) {

lcd.clear();
int steps = 0;

digitalWrite(red, LOW);
digitalWrite(green, HIGH);

for (int i = initial; i <= 200; i++) {
stepper.moveTo(i);
stepper.runToPosition();
lcd.setCursor(0, 1);
lcd.print(i);

lcd.setCursor(4, 1);
lcd.print("/ 200 steps");
steps = i;
delay(currentSpeed);


//Check if any other button is pressed while started
String check = getStatus();
lcd.setCursor(0, 0);
lcd.print(check);

int clicked = buttonClick();
String clickedIndicator = clicked ? "*" : "";
lcd.setCursor(6, 0);
lcd.print(clickedIndicator);

if (clicked) {
if (check == "Reset") {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("RESETTING...");
delay(200);
stepsTaken = 0;
prevStat = "Reset";

digitalWrite(green, LOW);
digitalWrite(red, HIGH);

resetFunc();
}

else if (check == "Pause") {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Paused");
delay(200);
prevStat = "Pause";

digitalWrite(green, HIGH);
digitalWrite(red, HIGH);
return steps;
}
}
}

return steps;
}

/*--------------------------------------*/

int buttonClick()
{
int reading = digitalRead(button);
return reading;
}


void resetControls() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Turntable - Tash!");
digitalWrite(red, HIGH);
digitalWrite(green, HIGH);
delay(500);
digitalWrite(red, LOW);
digitalWrite(green, LOW);
delay(500);
digitalWrite(red, HIGH);
digitalWrite(green, HIGH);
delay(500);
digitalWrite(red, LOW);
digitalWrite(green, LOW);
lcd.clear();
}


String getStatus() {
int controlStatus = analogRead(controls);
int controlRange = map(controlStatus, 0, 1023, 1, 4);
String stat = "";

if (controlRange == 1)
stat = "Reset";

else if (controlRange == 2)
stat = "Pause";

else if (controlRange == 3 || controlRange == 4)
stat = "Start";

else
stat = "-----" ;
delay(100);

return stat;
}


int readSpeed() {
int sensorVal = analogRead(speeds);
int stepSpeed = map(sensorVal, 0, 1023, 250, 5000);
return stepSpeed;
}

The code for the turntable is structured to handle various functionalities: controlling the motor, updating the LCD display, and reading inputs from the rotary encoder. Access the full commented code my GitHub repository: https://github.com/tashrique/DIY-Turntable-Makerspace-Resources

Troubleshooting Common Issues

Motor Noise or Vibration

  • Check alignment of gears and ensure the stepper driver is correctly calibrated.

LCD Display Issues

  • Verify wiring connections and contrast settings; adjust the potentiometer if used or calibrate the voltage divider correctly for clear visibility.

Code Bugs

  • Use serial debugging to monitor outputs and verify that the logic in your sketches matches the intended functions.

Future Enhancements

Integration of IR Sensors

  • Automate the camera shutter operation in sync with the turntable’s rotation to facilitate overnight operations.

PCB Board

  • Integrate all the circuit in a PCB Board

Conclusion

If you have read this far, thank you and good luck! This guide aims to equip you with all the knowledge needed to create and customize your own turntable, fostering further exploration into the fascinating world of DIY electronics. Feel free to share your project progress and reach out with questions or suggestions. Your feedback helps improve and inspire future projects!

 

Spinning Tales: My Whimsical Adventure in Arduino Turntable Wonderland

Arduino turntable prototype (close up of gear)

Arduino turntable prototype (close up of gear)

I remember the day I first laid eyes on that clunky, awkward, yet fascinating automated burrito-making machine in the local toy store. It was love at first sight! I knew I had to make it mine, but alas, my piggy bank held only a handful of nickels and a couple of lint balls. Little did I know that my passion for robotics would lead me to a journey full of laughter, tears, and making the lives of hundreds of passionate photogrammetry hobbyists like me easier by creating an affordable DIY Arduino turntable.

Fast forward to 2023, where I found myself rotating an 80 thousand-year-old cave bear tooth by one degree increments and taking 600 pictures, all with just 2 hands (which took me 4 hours and gave me 2 days of back pain) in our college Makerspace. I found myself daydreaming about the kind of robot I would create if only I had the skills of Tony Stark. And then, soon afterward, while I was surfing the internet on how to make photogrammetry pictures better optimized for 3D scanning, I stumbled upon a YouTube photogrammetry tutorial and found out that there was a ”thing” called “turntables.” To my sadness, it cost $150. And that was my light-bulb moment. I thought, “Why not give it a try?” As I saw my Makerspace friends clumsily rotate a plastic hangman for 3D scanning, I had an epiphany – what if I built an AFFORDABLE automatic turntable to do the job for us?

Arduino turntable prototype (base, rotator, gear, spindle)

Arduino turntable prototype (base, rotator, gear, spindle)

With the enthusiasm of a mad scientist, I proposed the idea to David, our Makerspace Program Manager and he immediately approved the idea and sent me a couple of resources to start with (thanks, David, for being so supportive). I dove headfirst into the world of turntables that people had previously made. I found Adrian Glasser–a professional computer scientist and a consultant–who had already made an almost similar prototype I was planning to make. Although Adrian’s project was pretty cool, it needed fancy components which were relatively expensive. I also found Brian Brocken, a passionate maker and 3D printer, whose turntable project stood out and inspired me a lot in the design of my prototype. While these works were a great sense of inspiration, my mind was lingering around the question of “how to make the design and features more efficient while keeping the device affordable and easy to build.”

The journey was fraught with challenges and unexpected twists, but I was determined to build the most magnificent, borderline-overengineered turntable the world had ever seen (just kidding!). I worked iteratively, and my first draft was a very basic model so that I could feel it with my hands and think about the build process I 3D printed a PLA (a type of 3D printing filament) base, a rotating platform , and some gears and bearings. After researching different approaches, I ordered my first set of electronic components and kept the total cost below $60 for this first version.

Arduino circuit board and LCD screen

Arduino circuit board and LCD screen

I decided to go with Arduino Uno, a very easy-to-program and flexible microcontroller that will be  the brains of my device. “Easy to build for everyone” was lingering in my mind when I chose the components. I got a stepper motor – which provides incremental motion, compared to a DC motor that provides a continuous motion – coupled with a physical motor driver to enable precise and sequential one-degree rotations with a super-low margin of error. To make the turntable more user-friendly, I added a simple LCD display and a rotary encoder for adjusting the rotation speed. After two weeks of assembly and testing, I had a fully functional circuit. 

Now it’s time to code! The hardest part while coding was finding the library file on the internet that corresponded to my particular stepper motor. It took me 4 hours just to find the library and start coding! Phew…

I kept writing code for a week and then moved on to testing my code. Overcoming the challenges of building my robotic turntable was like conquering Mount Everest. I spent hours troubleshooting the Arduino code, sifting through lines of syntax until my eyes crossed. But, much like a robot phoenix, I rose from the ashes, armed with patience, persistence, and an endless supply of coffee. After a few weeks of tinkering and testing, I finally had a circuit and a working code that I marked as a BIG CHECKPOINT for the project.

The spring semester gradually came to an end, and the turntable project will take a summer vacation. But next semester, the first prototype of the turntable is going to see the bright light of the earth. 

Next Steps

  1. Using Fusion360 to design an easy-to-print downloadable 3D model (stl file) 
  2. Using Infra-Red (IR) sensors to automate the camera shutter click with each one-degree rotation of the turntable, so that our Makerspace friends can leave the automated turntable working (extra hours!) overnight **insert cruel laugh**
  3. Sharing the technical details and building process online to make it accessible to other Makerspace groups and hobbyists around the world. This can be done through posting a follow-up blog with all the technical details. For example, I hope to publish step-by-step instructions, along with the final list of parts (with URLs), my custom Arduino code, link to the software library that corresponds to my stepper motor, and post downloadable .stl files for printing my custom 3D models to complete this project.

Affordability

I hope to keep the project affordable and my goal is for all costs to be under $70.

Conclusion

During this journey, I learned the importance of patience, collaboration, and perseverance. Building a robotic turntable from scratch is not a one-person job, and I found myself relying on the support and expertise of my fellow Makerspace friends. Together, we shared our knowledge and skills, which not only allowed me to build a better turntable but also contributed to the overall growth and development of our Makerspace community. I enlisted the help of my fellow Makerspace comrades, who offered their own unique brand of wisdom, ranging from programming tips to advice on how to make the turntable levitate. (Note: do not try to make your turntable levitate. It’s a bad idea.)

The Arduino turntable project wasn’t just about creating a cool gadget – it was about embracing my love for robotics and the creative process. In the end, I learned that a healthy dose of humor, imagination, and the willingness to make things up as you go can lead to some truly spectacular results.

Today, my beloved half-constructed Arduino turntable takes pride of place on the little yellow Makerspace table, a constant reminder of progress, the power of imagination, and the beautiful chaos that comes with it. So, dear reader, I encourage you to explore your own interests, whether that’s robotics or any other field that sparks your curiosity. Be open to surprises, maintain a sense of humor when facing challenges, and always remember that amazing innovations often start with bold ideas.

Shall You 3D Print Without Supports?

Printing a glow-in-the-dark brain with supports

Printing a glow-in-the-dark brain with supports

Occasionally, I’ve had to print complex objects that require support constructions to hold the main print in place. In the process, I understood how crucial it is to understand the role of supports that 3D printers employ and how they affect the overall print quality.

What are supports in 3D printing?

Supports in 3D printing are the additional elements printed to support the weight of the main print while printing larger models. It offers room for the filament to work and enables the printer to print finer details and overhangs without making any errors.

What are the types of supports?

There are basically two types of supports that are commonly used in 3D printing:

  1. Linear Support 

Linear supports touch the entire ground directly beneath the prints where it overhangs. I found them pretty useful for flat and steep overhangs. But the problem with linear support is that they take a little bit more time and use more filament to print. 

  1. Tree-like Support

Tree-like support is a tree-like structure that supports the overhangs of the object. It only touches the overhang at certain points. I found it useful for printing arches and rounded overhangs. 

How do you print without supports?

Failed attempt to print a slanted complex object without support

Failed attempt to print a slanted complex object without support

If we are willing to give up having things printed in one go, almost anything can be printed without support. Printing items that usually require support is possible by using a slicer to reduce the size and angle of the object sections. Nevertheless, the printing process will become considerably time consuming.

What are the pros and cons of not having supports in 3D prints?

While working on a variety of projects, I have experimented with printing items without supports in an effort to determine whether or not doing so offers any advantages over printing with supports. During the course of the tests, I made the following list of advantages and disadvantages of using and not using supports for 3D prints:

Why not to use supports:

  • Less Filament: It can be difficult to justify using a whole support system for the entire print when filaments are expensive and I am using half of the roll on printing supports that I will eventually toss away (recycle).
  • Quick Cleanup: When printing using supports, a large amount of waste is produced that must be disposed of after printing is complete.
  • Faster Prints: If you have to print a large object that needs support, cutting it up into smaller parts can make the process go much more quickly.

    Waste produced from printing supports

    Waste produced from printing supports

Why to use supports:

  • Print Stability: A 3D print’s instability increases in proportion to its size. The 3D prints will be consistently stable if you provide them with enough support to keep them supported and attached to the printing bed.
  • More surface to print: More surface area can be used for printing if supports are used, as there will be more scopes to use a slicer to cut up an object and print it in smaller parts.
  • Strong prints: Due to the increased connectivity enabled by the support, the printed object is significantly more durable, and the time required for the layers to dry in order for another layer to print on top of it is also reduced. The objects achieve better durability by eliminating the chances of sagging and layer displacement during the print. The likelihood of overhanging or separating owing to weight is extremely low.

Printing without supports is possible, and most small projects can be performed quickly and easily. However, as the complexity and size of my projects have grown, I’ve had to educate myself on when and how to make use of supports while printing to get the best output.