alfiosky4
Published © CC BY-NC

DIY Photogrammetry Turntable

A low cost turntable for photogrammetry acquisitions. Used by Department of Biology at University of Pisa to acquire 3D models of bones.

IntermediateShowcase (no instructions)3,759
DIY Photogrammetry Turntable

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
LED (generic)
LED (generic)
For "turn status bar" led, used 2 Red, 2 yellow and 1 green led. 1 green used for single status led.
×6
DS04-NFC Servo Motor
×1
On/Off Power Switch
×1
Slide Switch
Slide Switch
3 Way Side Switch
×1
Big Red Dome Button
SparkFun Big Red Dome Button
Not so big :)
×2

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Prototipook kcnmsyjkfg

Code

servo-fgramme1.2.ino

C/C++
#include <Servo.h>

Servo myservo;  

const int pinBottone = 2;
const int pinFine = 3; //pin input switch for "Fine" mode
const int pinLed = 4;
const int pin20 = 13;
const int pin40 = 12;
const int pin60 = 11;
const int pin80 = 10;
const int pin100 = 8;


int presBottone = 0;
int fineOn = 0; //flag "Fine" On/Off
int pos = 0;

//SETTABLE STEPS INTERVALS FOR FINE AND COARSE//    
int dCoarse = 5000;                          //
int dFine = 1000;                           //
/////////////////////////////////////////////

void setup() {
  pinMode(pinLed, OUTPUT);
  pinMode(pin20, OUTPUT);
  pinMode(pin40, OUTPUT);
  pinMode(pin60, OUTPUT);
  pinMode(pin80, OUTPUT);
  pinMode(pin100, OUTPUT);
  pinMode(pinBottone, INPUT_PULLUP);
  pinMode(pinFine, INPUT_PULLUP);
  myservo.attach(9);  
  digitalWrite(presBottone, HIGH);
  digitalWrite(fineOn, HIGH);
  delay(200);
  digitalWrite(pin20, HIGH);
  delay(200);
  digitalWrite(pin40, HIGH);
  delay(200);
  digitalWrite(pin60, HIGH);
  delay(200);
  digitalWrite(pin80, HIGH);
  delay(200);
  digitalWrite(pin100, HIGH);
  delay(200);
  digitalWrite(pin20, LOW);
  delay(200);
  digitalWrite(pin40, LOW);
  delay(200);
  digitalWrite(pin60, LOW);
  delay(200);
  digitalWrite(pin80, LOW);
  delay(200);
  digitalWrite(pin100, LOW);
}

void loop() {
  presBottone = digitalRead(pinBottone);
  fineOn = digitalRead(pinFine);
  if (presBottone == LOW)  {
  digitalWrite(pinLed, HIGH);
    if (fineOn == LOW)  {
      for (pos = 0; pos <= 60; pos += 1) { // Fine Mode
      presBottone = digitalRead(pinBottone);
      while (presBottone == LOW) {      
            presBottone = digitalRead(pinBottone);              
      }
      digitalWrite(pin20, LOW);
      digitalWrite(pin40, LOW);
      digitalWrite(pin60, LOW);
      digitalWrite(pin80, LOW);
      digitalWrite(pin100, LOW);
      if (((pos<=12)&&(pos>0))){} 
      if (((pos<=24)&&(pos>12))){digitalWrite(pin20,HIGH);}
      if (((pos<=36)&&(pos>24))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);;}
      if (((pos<=48)&&(pos>36))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);}
      if (((pos<=59)&&(pos>48))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);digitalWrite(pin80,HIGH);}
      if (pos==60){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);digitalWrite(pin80,HIGH);digitalWrite(pin100,HIGH);}
      myservo.writeMicroseconds(1760);  
      delay(20);
      myservo.writeMicroseconds(1500);        
      delay(dFine); 
      presBottone = LOW;
      } 
    } else {
      for (pos = 0; pos <= 24; pos += 1) { // Coarse Mode
      presBottone = digitalRead(pinBottone);
      while (presBottone == LOW) {      
            presBottone = digitalRead(pinBottone);               
      }
      digitalWrite(pin20, LOW);
      digitalWrite(pin40, LOW);
      digitalWrite(pin60, LOW);
      digitalWrite(pin80, LOW);
      digitalWrite(pin100, LOW);
      if (((pos<=3)&&(pos>0))){}
      if (((pos<=7)&&(pos>3))){digitalWrite(pin20,HIGH);}
      if (((pos<=12)&&(pos>7))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);;}
      if (((pos<=17)&&(pos>12))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);}
      if (((pos<=23)&&(pos>17))){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);digitalWrite(pin80,HIGH);}
      if (pos==24){digitalWrite(pin20,HIGH);digitalWrite(pin40,HIGH);digitalWrite(pin60,HIGH);digitalWrite(pin80,HIGH);digitalWrite(pin100,HIGH);}
      myservo.writeMicroseconds(2060);  
      delay(60);
      myservo.writeMicroseconds(1500);              
      delay(dCoarse); 
      presBottone = LOW;
      }                                    
    }
      
  }
  else {
         digitalWrite(pinLed, HIGH);
         delay (500);
         digitalWrite(pinLed, LOW);
         delay (500);
        }
}
 

Credits

alfiosky4

alfiosky4

0 projects • 1 follower
Contact

Comments