Posts Tagged ‘Potentiometer’

Removing Crackle from Guitar

guitar pot

Got a cheap fender-like guitar I’ve had a while and it doesn’t always work, I plug it and then it crackles and cuts out frequently and if I turn the dials it also crackles. A friend wanted to use it so I’ve got motivated and I’ve gotten round to fixing it.

These steps apply to most modern guitars – if it’s a vintage you may not want to follow the steps.

It’s very simple to fix the electrics for the average guitar nothing really that concerning and removing the crackle from the pots/ dials is as easy as just buying some cleaner. It really is that easy.

Testing the jack with a mini amp

To test the connections/ circuitry as well as a multimeter I found it really useful to use a mini amp and headphones so I could listen for changes and improvements as I reproduced the fault.

First things first start with the jack and remove this from the guitar to inspect the connections. Should be a couple of screws holding the jack plate in and you’ll need to remove this and then unscrew the jack from the plate – there should be a couple of nuts holding it in place.

Faulty jack - half the problem...

Next have a look for something obvious – in my case the joint just wasn’t soldered properly. I cut the wires, stripped the ends, then resoldered the connections after removing the previous solder (or lack of in this case).

Cut wires from jack and strip wire down

Repaired jack

Moving the jack with the amp and headphones connected, listening now I can see the connection is fixed but turning the pots/ dials I hear the crackling still. The jack is the first place to start for a loose connection but if the problem is not the jack or still persists with an intermittent connection  after you’ve fixed the jack then you have a loose connection elsewhere. Next obvious place to check is the grounding/ earth wire – normally attached in the back of the guitar, there is a plate to remove to access this and the truss rod. Basically you’re looking for a wire that is connected to the guitar itself by way of a plate or something similar.

Check all the connections

If that connection looks fine, next check the connections on each pickup, in cheap guitars these joints can be poorly soldered so check and repair. Lastly check the connections on the switches the wiring isn’t too tricky to check just be methodical.

Hopefully you’ve found your loose connection(s) and fixed them, if not you’ll need to go through each connection with the multimeter. If however you’re now left with a crackle/ static sound anytime you turn a dial or use the pickup selector switch read on.

Removing the crackle
So to remove the crackle when turning the dials etc… Just take the pickguard off, if you haven’t already, by removing the screws around the outside. You’ll need some electrical contact cleaner in a spray can with a straw. You need to have a cleaner that is solvent based but also include lubricant since potentiometers and switches should be greased and not left dry as that will make things worse. I found a can down in my local motor store and any decent electronics store should sell it. Again make sure the spray is a lubricant!

Spray contact cleaner into pots and switches

On each switch or pot spray the cleaner  between the back of the pickgaurd and the dial. Keep you face away as it’s likely to spray back a bit and you dont want this in your eyes! You don’t need much spray just a couple of squirts, when done turn the dials back and forth to work in the cleaner, you should feel an improvement and the dial should feel smoother to turn. Repeat for each pot/ dial. For the pickup selector switch spray into the top of the switch from the front of the pickguard and work the cleaner in by flicking the switch back and forth.

Testing electrics

So now plug in the amp and headphones and listen for the crackle – it should be gone now – good way to test as put a string on the guitar and play it.

Hopefully that’s fixed your issues.

Arduino – Control a DC motor with TIP120, potentiometer and multiple power supplies

arduino Pot motor side

A quick circuit showing how to control the speed of a DC motor with a potentiometer with your Arduino board. Also shows how to use a TIP120 transistor to allow the Arduino control a larger power supply.

Transistors are 3 pin devices, which via the 3rd pin (Base) allow it to control the current passing through the other 2 pins (Collector and Emitter). So for this tutorial I am using the power from the Arduino Digital PWM pin 9 (+5V) to control the flow of current to a DC motor which uses an additional power supply with a much larger current than the Arduino board can supply or control. Of course like most electrical components each transistor is designed for a specfic operating range or current.

Below you can see TIP120 the pins and how they appear in a schematic:

TIP120-transistor

1N4004-DiodeSo thats the transistor. Next up is the rectifier diode, I’m using this inbetween the power supply flowing from the motor. It acts like a one way valve to only allow the current to flow one way, so my circuit should be protected should the motor power supply cause a surge or if the motor draws too much current. The main thing to remember is that Diodes like LED’s have a correct orientation, shown to the left.

The other item is the potentiometer, which is basically a variable resistor. By turning it you control the flow of current by allowing more or less through. Potentiometers, like resistors have a resistance rating in Ohms and a power rating. For this I am using a pot with a 10K ohm rating.

Arduino TIP120 Circuit Components

1K Ohm resistor (Brown, Black, Red, Gold)
10k Potentiometer
TIP120 Transistor
1n4004 1A Diode
6V DC motor
Arduino Deumilanove w/ ATMEGA328
Breadboard / Prototyping board
Jumper/ Connector wires
4x AA battery holder
4x AA batteries
Optional 9V DCpower supply or use the USB power for the Arduino

TIP120 Arduino DC Motor Control Circuit

Pretty simple, but remember that the GND connection must be shared between the Arduino and the additional power supply and I’m using a 1k Ohm resistor between Arduino pin 9 and the Base pin of the transistor.

arduino-Pot-motor

TIP120 DC Motor Driver Sketch

[ad#Google Ad in content]

int potPin = 0;                           // Analog pin 0 connected to the potentiometer
int transistorPin = 9;                  // connected from digital pin 9 to the base of the transistor
int potValue = 0;                       // value returned from the potentiometer

void setup() {                          // set  the transistor pin as an output
  pinMode(transistorPin, OUTPUT);
}

void loop() {                           // read the potentiometer, convert it to between 0 - 255 for the value accepted by the digital pin.
  potValue = analogRead(potPin) / 4;    // potValue alters the supply from pin 9 which in turn controls the power running through the transistor
  analogWrite(9, potValue);
}

[ad#Google Ad in content]

I’m going to use the above and the work I’ve done with the Arduino and L293D chip so far to control the speed and direction to the motor with a potentiometer.

Controlling a Servo with Arduino

arduino

Very simple basics of building a circuit to control a servo using Arduino and PWM

For this you will need:

Arduino Board – I’m using a Duemilanova ATMEGA328
Arduino Sketch software – I’m using version 0015
Arduino Servo Library found here save it to lib/targets/libraries if you don’t already have it
A Servo that requires no more than a 5V supply I’m using a Futuba S3113
A Potentiometer (A dimmer switch)
Breadboard & Connector wires
Previously used Arduino, at least to do basic blinking LED

So we’re going to assume that you’ve already used the sketch software and uploaded at least your first sketch to the Arduino board.

First lets start with just connecting a servo to the board.

I’ve used some connecting wires to connect between the servo pins to the ardunio board. The red wire is positive, the black negative/ground and the white is what relays the feedback/instructions.

The red wire goes to the +5v pin, the black goes to the GND pin on the Arduino and I’m going to put the white wire to pin 9 PWM.

Thats it! So now you just need to upload the code below to the board. You can use this example sketch also provided with Arduino

[ad#Google Ad in content]

Arduino Servo Sketch

// Sweep
// by BARRAGAN

#include //include the servo libary

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position } for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
}

[ad#Google Ad in content]
So you should see the servo move!

If you got this far lets now add in a potentiometer to control the servo, so when you turn the potentiometer it will turn the servo.

The potentiometer, it has 3 pins like the servo, the outside pins are for the supply (+/-) and the middle pin is for the control/ feedback.

First lets setup the breadboard for the circuit, all red wires are positive, black are negative and the 2 white wires are the feedback to the Arduino chip.

Here’s the final setup I did below:

arduino-servo-potentiometer-final

Near the start of the circuit I’ll add the potentiometer and at the end of the cicuit I’ll put the servo.

arduino-potentiometer

arduino-servo

The white servo wire still goes to digital pin 9 PWM and the potentiometer white wire goes to the Analog 0 pin

So if you have all that setup then we just need to use the example sketch below to get it working:
[ad#Google Ad in content]

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott

#include

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

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

void setup()
{
myservo.attach(9); // 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, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

[ad#Google Ad in content]