DIY el cheapo vactrol -perfect for cheesy electronics experiments. It is a current-controlled variable resistor, which works by combining an LED and an LDR photoresistor.
Dimensions are customizable, so that you can get a tight fit for your choice of components. This is important, since it is supposed to be dark inside the box, when the LED is off. I used a 5 mm LED and a 5 by 4 by (almost) 2 mm photoresistor. The attached STL file and also the initial dimensions when opening the Customizer are for these components. A bit of tolerance is added.
Components are fitted like in the picture below, with the LED cathode towards the top of the picture. There is a pin-1 marker on the lid of the enclosure, by which the cathode is identified. The resistor has no polarity so it doesn't matter which lead goes where.
and, yeah, it makes sense to test the LED before sealing the lid with glue ;-)
These are the characteristics I got when using a GL5516 LDR photo resistor marked 5-10 kohm and a 13000 mcd white LED.
- More or less an open circuit when no current flowing through the LED. Spec says 50 Mohm, my multimeter goes to 20 Mohm.
- Minimum resistance somewhere 50-80 ohm at about 6-8 mA (some component variation).
Below is a plot of current and transconductance (1/R). 1 mmho = 0.001 mho, which corresponds to a resistance of 1 kohm.