Yash MutnalkarTushar Magar
Published

Turret

A budget turret that makes sure enemies are kept at bay with its accurate barrage of rubber bands

BeginnerFull instructions provided1,073
Turret

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
2 10k Ohm potentiometers
×2
Gears
×1
Metal Shaft
×1
Screw piece
Used to fire ammunition
×1
Battery, 9 V
Battery, 9 V
×1
Push button
×1
360 Degree Servos
×1
Knob, 0.25 "
Knob, 0.25 "
×2
Laser pointer
×1
Rubber Bands
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor
MIT App Inventor

Hand tools and fabrication machines

Woodcutting Machine
Soldering iron (generic)
Soldering iron (generic)
Balsa Wood
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Schematics

Schematic created using TinkerCad

Code

Knob code to control the Servos

Arduino
#include <Servo.h>  // add servo library
 
Servo myservo;  // create servo object to control a servo
Servo myservo2;
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin
int val1;
 
void setup() {
  myservo.attach(9); 
  myservo2.attach(11);// 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, 0, 180); 
  val1 = analogRead(potpin);
  val1 = map(val1, 0,1023, 0, 180);// scale it to use it with the servo (value between 0 and 180)
  myservo.write(val); 
  myservo2.write(val1);                  // sets the servo position according to the scaled value
}

Credits

Yash Mutnalkar
1 project • 1 follower
Engineering Student
Tushar Magar
4 projects • 8 followers
Currently pursuing a bachelors degree in electronics and communication.

Comments