Tart Robotics
Published © GPL3+

A DIY Zipline Robot with Arduino, Lego, and 3D Printed Parts

Hang your robot from a zipline across the hall. Then, control your robot by clapping using an Arduino and a microphone sensor.

BeginnerFull instructions provided2 hours3,488

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Microphone Amplifier Breakout
Adafruit Microphone Amplifier Breakout
×1
SparkFun Motor Driver - Dual TB6612FNG (with Headers)
SparkFun Motor Driver - Dual TB6612FNG (with Headers)
×1
TT DC 1:120 gear-motor
×1
Screw M3 30mm
×1
Screw M3 16mm
×2
Lock nut m3
×3
mini breadboard
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Toggle Switch, (On)-Off-(On)
Toggle Switch, (On)-Off-(On)
×1
DC POWER JACK 2.1MM BARREL-TYPE PCB MOUNT
TaydaElectronics DC POWER JACK 2.1MM BARREL-TYPE PCB MOUNT
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Electrical Circuit Assembly

Zipline robot circuit configuration.

Code

Zipline Robot Clap-Control Arduino Code

C/C++
Upload this code to your robot and control its motion by clapping. Your robot starts moving as you clap.
/*
   Clap Contorled Zipliner Robot

   The idea:
   In this project, the robot's motor activates shortly right after a clap
   is heard from the microphone module. The idea is that you need to clap
   constantly  in order to move the robot across the zipline so that the
   faster you clap the faster it goes.

   The circuit:
   - In this circuit, an Arduino nano is used. Any other types of Arduino
   can be used of course but do not forget to change the pin configurations
   if you want to change the circuit on your preference.
   Visit Tart Robotics blog for more:
   https://www.tartrobotics.com/blog
*/

#define micPin A0 //Microphone module's output pin to A0
#define motorB1 10  //Driver motor's input IN3 to 10
#define motorB2 11  //Driver motor's input IN4 to 11

int micThreshold = 800; //Sets the microphone sensitivity
int clappingInterval = 200; //Sets the claping speed
uint16_t clapTime = 0;

void setup() {
  pinMode(micPin, INPUT_PULLUP);
  pinMode(motorB1, OUTPUT);
  pinMode(motorB2, OUTPUT);
}

void loop() {
  uint16_t t = millis();
  int micMin = 255, micMax = 0;
  while (millis() - t < 5) { //Sample microphone output for a period of 5 msecs
    int mic = analogRead(micPin);
    if (mic > micMax) micMax = mic;
    else if (mic < micMin) micMin = mic;
  }
  int micAmp = micMax - micMin; //Read the microphone pick-to-pick value
  if (micAmp > micThreshold) clapTime = millis();
  // Run the motor if a clap is detected recently. Stop otherwise
  if (millis() - clapTime < clappingInterval) runTheMotor();
  else stopTheMotor();
}

void runTheMotor() {
  digitalWrite(motorB1, HIGH);
  digitalWrite(motorB2, LOW);
}

void stopTheMotor() {
  digitalWrite(motorB1, HIGH);
  digitalWrite(motorB2, HIGH);
}

Credits

Tart Robotics

Tart Robotics

7 projects • 20 followers
Our mission is to provide children with novel robotic tools, to inspire them to become future innovators.

Comments