<a href="http://casperelectronics.com/wp-content/uploads/Interfacing/ArduinoInterfacing2.jpg"><img src="http://casperelectronics.com/wp-content/uploads/Interfacing/ArduinoInterfacing2-282x300.jpg" alt="" title="ArduinoInterfacing" width="390" height="400" class="alignnone size-medium wp-image-858" /></a>
Here are 3 ways of interfacing the Arduino with various electronics, especially bent circuits and analog audio circuits. The circuits are actually pretty non-specific and can be used for interfacing with pretty much any micro controller, but we'll just talk about the Arduino to keep it simple. 
The circuits above allow the Arduino to control physical electronics in three ways: 
-digitally controlled variable resistor
-digital switch
-variable voltage (using a digital to analog convertor).
I'll talk about each one in detail below.
<hr>
<h3>VARIABLE RESISTOR</h3>
A simple, brute force way of using one of the PWM (pulse width modulation) outputs of the Arduino to create variable effects in other circuits.
<h1>HOW IT WORKS:</h1>
This simple circuit uses PWM to modulate the brightness of an LED. The LED is mechanically connected to an LDR which is a light sensitive resistor. As the brightness of the LED modulates, the resistance of the LDR changes as well. Read at the bottom of the page for more info on PWM.<p>
<h1>HOW TO BUILD:</h1>
<strong>Making a vactrol</strong>
For this circuit you first need to make a <em>vactrol</em>. There's lots of tutorials for how to do this online if you want more info. 
-Connect an LED to a light dependent resistor face to face. I found that high brightness LEDs are TOO bright. Average red LEDs will work fine.  You'll also need a 220ohm current limiting resistor in there to keep the LED from getting too bright and burning out. 
-The LED is polarized and the LDR is NOT. Mark the negative leg of the LED with a marker or piece of tape.
-Make sure the face of the LED and the LDR are touching and wrap a piece of electrical tape or heat shrink tubing around them, something that will ensure that no light gets in. 
*If you want to be organized about it you can bend all of the legs in the same direction and solder them to a piece of perf board. This is a good way to do it if you want to make several vactrols for one system. Make sure the material you use to connect and insulate the LED/LDR is secure and wont let ANY light in. 
<p>
Now you can connect the vactrol to your system.
<strong>Connecting the vactrol to the Arduino. </strong>
-Connect the negative leg of the LED to the ground terminal of the Arduino.
-Connect the positive leg of the LED to one of the PWM output pins of the Arduino.
-Assigning a number value to the chosen output terminal will set the pulse width of a square wave at that terminal.
<p>
<strong>Connecting the vactrol to your circuit. </strong>
First you have to find a feature that you want to alter and CAN be alter by varying a resistance in your circuit. A good example of this is pitch. Most audio circuits have a pitch resistor. Altering the value of this resistor changes the pitch. For more info on this check out my <a href="http://casperelectronics.com/finished-pieces/circuit-bending-tutorial/pitch-adjustment/">pitch adjustment tutorial</a>(If you follow that tutorial you will be using the vactrol in the "attenuator method").
-Find a resistor in your circuit that you want to control with the vactrol. 
-Remove that resistor. You may want to install a switch that lets you switch between vactrol control and a preset resistance.
-Connect the two legs from the LDR in your vactrol to the two points on your board where the original resistor used to be. 
-Done. 
<p>
I strongly recommend installing a limiting resistor, especially if you are controlling pitch. Lowering the resistor too much can fry the circuit. a limiter resistor will guarantee that even if the LDR resistor drops to zero there will still be some resistance in the circuit. 
I've illustrated a few other configurations below which I have found useful in tuning in the Vactrol resistance range.
<a href="http://casperelectronics.com/wp-content/uploads/Interfacing/VactrolWiring.jpg"><img src="http://casperelectronics.com/wp-content/uploads/Interfacing/VactrolWiring-150x150.jpg" alt="" title="VactrolWiring" width="150" height="150" class="alignnone size-thumbnail wp-image-863" /></a>
<strong>A NOTE ON LDRs</strong>
LDRs come in many different ranges of resistance. I've found that the most common is around 100ohms - 500k. This range is from bright light to complete darkness. Make sure the LDR in your vactrol is completely insulated from environmental light. ANY light that gets in, even in a dim room, can drastically alter the range of the LDR.
 It is important that you use the LDR to replace a resistor of a similar value. For instance replacing a 1k resistor with a 500k LDR wont do much. It is possible to place a resistor in parallel with the LDR to tighten its range but this can drastically change its resistance curve. 

<hr>
<h3>DIGITAL SWITCH</h3>
<hr>
<h3>DIGITAL TO ANALOG CONVERTOR</h3>
This design is pretty crude. It's somewhat noisy and vulnerable to loading effects from low load resistance. There are lots of other schematics online which mostly use op amps instead of transistors. I wanted something cheap and small so went with this design. It's clean enough for what I'm doing works fine if you are using it to drive an op amp input like most CV inputs of an analog synth. I've found that signal noise can be decreased by changing the .1uF cap to a .2uF. I'm sure it . 
<hr>
<h3>PWM - PULSE WIDTH MODULATION </h3>
PWM is a way of creating a varying signal using a digital output. Digital outs either generate 5 volts or 0 volts. That's 2 states. If you want to generate a varying signal you have to get clever. That's where PWM comes in. The Arduino has several PWM output pins. These output a high frequency square wave and the duty cycle of the wave is variable. Duty cycle is the ratio of time the wave is high vs low. Lets say 1 cycle of the wave is 100 micro seconds. A 50% duty cycle means the wave will be high for 50mS and low for 50mS. a 20% duty cycle will be high 80mS and low 20mS. 