Skip to main content

DIY Motion Activated Tremolo Pedal!


Hello Everyone!

Guitar pedals and music effects are very interesting to experiment with, so I decided to come up with something new and original. Using minimum possible components I made a circuit that simply breaks and rejoins the connection between the guitar and the amp. But thats not the catch,
This pedal can be controlled without coming in contact with the pedal. 
Weird, right?
The setup uses an ultrasonic sensor (Popularly, used for obstacle avoidance in robots) to calculate the distance from the pedal, and activate the effect accordingly. Also the closer you move towards the pedal, the more shallower the effect gets. 
Well, if I've got your attention and your head is bubbling with ideas,  here is , how I made it!-

Step 1- Watch the video-

Step 2- Get the parts-

1. An Arduino ( Uno or Nano) ( a clone would also do the trick)
2. A single channel relay (an electro-mechanical switch)
3. (1/4 inch mono sockets) x2
4. Ultrasonic sensor module (HC SR04)
5. A toggle switch
6. A DC socket ( to use external power supplies between 6-12V)
7. Some wires (of-course)
8. An Enclosure( Preferably, not metal, to reduce noise)


Step 3- Wire it up!

























I've tried my best to make the diagram as clear as possible, however, if you face any problems, just leave a comment.

Step 4- Upload the code to the Arduino
If this is the first time you're using an Arduino, do some googling and get acquainted with basic Arduino programs.
Simply copy-paste this program onto your Arduino IDE, Here's the code-


const int trigpin =8; //this section is to tell the arduino what connects where
const int echopin=7;
int relay=10;
int distance;
long duration;

void setup() {
  // put your setup code here, to run once:
pinMode(trigpin,OUTPUT); //initializing OUTPUTS AND INPUTS
pinMode(10,OUTPUT);
pinMode(echopin,INPUT);
pinMode(6,OUTPUT);
pinMode(4,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(6,HIGH); //we'll use pin 6 as a 5V powersupply for the ultrasonic sensor
  digitalWrite(4,LOW); // to use pin 4 as ground
  digitalWrite(12,LOW);// to use pin 12 as ground

  if(calculatedistance()<60 && calculatedistance()>=30){ //to activate the switch when an obstruction is 30cm-60cm away from the sensor
  digitalWrite(10,HIGH);// to break the connection between the guitar and the amp
   digitalWrite(11,HIGH);// for the indication LED
  delay(120);// a small pause
  digitalWrite(10,LOW);//to rejoin the connection
  digitalWrite(11,LOW);// for the LED...
  delay(120);// and another pause

  }
  else if(calculatedistance()<30 && calculatedistance()>=20){
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  delay(90);
  digitalWrite(10,LOW);
   digitalWrite(11,LOW);
  delay(90);

}
  else if(calculatedistance()<20 && calculatedistance()>=5){
  digitalWrite(10,HIGH);
  digitalWrite(11,HIGH);
  delay(70);
  digitalWrite(10,LOW);
   digitalWrite(11,LOW);
  delay(70);
}
else{ digitalWrite(10,LOW);
digitalWrite(11,LOW);
}
}
int calculatedistance(){// to calculate the distance using the sensor
  digitalWrite(trigpin, LOW);
  delayMicroseconds(2);
  // Sets the trigPin on HIGH state for 10 micro seconds
  digitalWrite(trigpin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigpin, LOW);
  duration = pulseIn(echopin, HIGH); // Reads the echoPin, returns the sound wave travel time in microseconds
   distance= duration*0.034/2;
  return distance;
}



And that's it, it should work if you've done everything correctly.
Now that you've got it to work the way I designed it, you can use this as a base for a bigger and better project :). Let your creativity overWrite my code.
You would have realized that the relay is a bit (VERY VERY VERY NOISY) noisy.
For sure, using a relay for this purpose is not the best idea, but is definitely the easiest way to go about it. If you're interested in improving on this you could read about( or if you already know), using a transistor as a switch for this purpose. 

UPDATE: 04/06/2020
This was a fun project, I made 3 years back when I had no knowledge about analog electronics. Now that I'm equipped with some engineering background, I'm remaking this project, with a digital potentiometer and optocoupler IC which should be way more usable and practical. Also please ignore my over-enthusiastic explanation that I wrote as a kid :P

                                                                                         
                                                                                          
                                                                                          Cheers,
                                                                                          Siddharth
       


Comments

  1. distance= duration*0.034/2;
    I'm a beginner.. why these numbers?

    ReplyDelete
  2. That's because distance= speed x time. And speed of sound in air is about 340m/s. Also the distance measured is twice the actual distance as the ultrasonic signal reflects and comes back to the module. Apologies for the late reply.

    ReplyDelete

Post a comment

Popular posts from this blog

Distortion Pedal Electronics (Explained for beginners!)

If you are into DIY guitar pedals and want to start designing your own effects, this article might help you open a few doors. I write this article as an EE student who earlier struggled with understanding these circuits and would often simply copy schematics off the internet. 

This article is intended for-
1. Absolute beginners who like tinkering with electronics
2. Anyone who has been learning analog circuits and is looking for a jumpstart project.

Also before I start I'd like to mention, for anyone who wants to get a rock-solid foundation in Analog electronics, I highly recommend reading the book, 'Electronic Principles' by AP Malvino and David Bates.

Distortion Pedals come in all flavors and sizes, however, how the distortion effect is achieved in any of the pedals is more or less similar. Let's first see how the output of the pedal compares to its input.

The raw signal coming from the guitar is first amplified a little, and then the peaks of the amplified signal are clip…

5 Effective Online Tools that will Spice up your Arduino Projects!

Arduino has made electronics projects easier than ever. The question now is- Can we make the process of building projects faster and more enjoyable? Let's have a look at some of the interesting softwares/online tools developed for the Maker Community to make tinkering more effective and documenting projects easier!

1. TinkerCad

TinkerCAD's recently created circuit simulator allows you to arrange your Arduino/Attiny circuits in an easy 'drag and drop' environment and test them virtually without having to make them. This can be really helpful, for testing projects that use components which you are yet to buy. And after all, who doesn't like tinkering?


Try out Tinkercad-Circuits here!

But that's not what Tinkercad is famous for. It offers an amazingly easy to use 3D design tool for Makers, once again in a simple 'Drag and Drop' interface! You can directly download the CAD file, once you're done designing. If you've ever thought of making your own uniqu…

TV Remote Controlled Servo Motor-Using Arduino!

Greetings!
We use our TV remotes to control the functions of the TV's, but when the TV is not in use, they're absolutely useless. Today, we are going to learn how to add more functionality to ordinary IR based remotes, in this one we shall see how to control servo motors. There are so many (SO MANY) different applications of this project that one can think of. Using the following tutorial, you can make one yourself!

1. Watch the video tutorial-


2. Things you will need-

Note that you may use a different IR receiver other than TSOP1738, if it isn't available. Usually you can find this on websites like amazon and ebay.
3. The circuit diagram!

4. The IR Remote Library http://z3t0.github.io/Arduino-IRremote/
5. The Arduino Code- Just copy paste this code into your Arduino IDE

// Written by Siddharth Kothari, curiousmotor.com// Enjoy your journey Exploring Arduino!#include <IRremote.h>#include <IRremoteInt.h>#include <Servo.h>intRECV_PIN=11;//IR receiver pinintgndIR=10;/…