Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Nichsen
Published © GPL3+

Turntable for Presentation

A self-turning table to show off your products and projects.

IntermediateFull instructions provided786
Turntable for Presentation

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Servo Module (Generic)
360° !
×1
generic Material e.g. Cardboard
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Schematics

wiring diagram

short wiring diagram

Code

Turn Table Code

Arduino
Arduino standard functions only "Servo.h" needed
/* NICHSEN "DREHTELLER"
 * 
 * 06-2019
 */

#include <Servo.h>

Servo myservo;  // create servo object to control a servo

int potpin = A7;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin

void setup() {
  Serial.begin(9600); //Debuging
  myservo.attach(3);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  
  val = map(val, 0, 1023, 84 , 130);     // scale it to use it with the servo in my case Servo stops at 84 and max speed shall be 130 !
  Serial.println(val);                   //Debug info
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}

Credits

Nichsen
3 projects • 4 followers
Contact

Comments

Please log in or sign up to comment.