What I want to do
Ben Gamari had implemented an ingenious version of the Riffle hardware that measured the conductivity of water (aside: for a great tutorial on conductivity in a water quality context, pointed out to me by Jeff Walker, check out this Fondriest guide) by exploiting the properties of an old chestnut of an integrated circuit: the '555 timer'. I'm looking to breadboard a similar circuit myself, in order to understand the basics of how this setup works.
When a 555 chip -- which costs $2 at RadioShack, but is available widely online for much cheaper -- is placed in a particular circuit configuration (dubbed the 'astable' configuration) that involves a capacitor, C, and two resistors, RA and RB, all wired up a certain way, the 555 produces an output voltage (on its 'output' pin) that oscillates between high and low voltage values (where high = the input voltage, 'VCC', and low=0 Volts), with the following frequency:
where: - f is in Hertz (cycles per second) - R_A and R_B are in Ohms - C is in Farads.
Note that if you're wiring up a 555 on a breadboard and following Figure A above, the 555 pin numbers are actually arranged counter-clockwise, starting at the 'top left' of the 555, as in Figure B below:
Fig B: The typical pinout on a 555 IC.
My attempt and results
For example, I just now breadboarded this arrangement, and used the following values:
- R_A=21000 Ohms (i.e., a 21 kilo-Ohm resistor);
- R_B=2300 Ohms (a 2.25 kilo-Ohm resistor);
- C = 0.000047 Farads (a 47 uF capacitor)
Plugging these values into the above equation for the frequency, 'f', we get f = 1.2 seconds -- which is about the frequency I observed when I connected an LED on the 'output' pin.
Why I'm interested
The motivation for this exercise is the following: due to the straightforward relationship between the resistor and capacitor values in this 555 circuit and the oscillation frequency of the 555 output, we can use this circuit to measure the resistivity (and, thus, the conductivity) of water. The idea is: set up the above circuit with known values of R_A and C, but connect wires ('probes') from the circuit through a water sample so that the water is the 'resistor' R_B. By measuring the frequency of oscillation of the 555 output, we can back out what the effective resistance, R_B, must be between the probes.
In lieu of using a water sample, I tried out this idea with a 10 kOhm photodiode, and took a video of the result:
- Find a nice way of measuring the frequency of this oscillation using simple Arduino code
- Try this out with a water sample, using appropriate values for the R_A and C, such that we end up with an oscillation over around 1 kHz (the frequency range above which the effects of our cicruit on the water electro-chemistry -- e.g. shifting ions around in the water -- will be sufficiently minimized)