Detecting cum with voltammetry

After my little stint of research, I set about putting the theory into practice. Before I go into it, here is a video of detection working (warning, contains bodily fluids).

Warning, this video contains bodily fluids.

Fluids in order: water, lube, salt water, urine, semen.

My laptop keyboard still has suspicious fluids on it…

Please note the above video is a best case scenario and a lot of testing is still required!

My first attempt was to just pass 5v into various samples and see what they did. I used the #2 digital output pin on the Arduino to control whether or not any power was sent to the sample and a 10 kΩ shunt resistor so I could measure the current across the sample by reading the A0 analog in for the Arduino. I measured the current once every 10 ms for 2 seconds, then rested the sample for 2 seconds.

The results were encouraging.

The graph below shows one round of stimulation of a sample of water, the orange line represents voltage in (5v) and the blue line is the current measurement. You can see I rest the sample between trials for 2 seconds (important).

Change in current over time when sending 5v through water.

The following shows the change in current measured in a sample of cum.

Change in current over time when sending 5v through cum.

So, there’s definitely something happening, the current across the sample is changing for the duration of the stimulation (2 seconds), but how to get a more meaningful comparison? I knew that I needed at least 1.23 v to electrolise water into into oxygen and hydrogen, but I didn’t want to use much more than that. I used a simple voltage divider made from two 22 k Ω resistors, resulting in something close to 1.8 v across the sample, which seemed to work OK.

Apologies to electrical engineers who are offended by my poor diagram.

After taking many samples and calculating an average for each sample, I could say with confidence that on average, a 2 second stimulation of the various samples looks like this:

Average change in current over time for different samples.

Now, it looks pretty cut & dry: cum has on average a much much lower final current after 2 seconds. Why not just measure the current value after 2 seconds of stimulation and if it’s below a threshold (say 35 in the example above), then it’s cum? Well, the problem is that this is an average, the real data is a whole lot messier:

Change in current over time, just for the cum sample. There’s a wide variety of data points.
Change in current over time for the urine sample only.

The fact that cum has a very distinctive “shape” on the average graph gave me the encouragement to try harder to untangle signal from the noise.

To overcome the variability in the data I did two things: firstly I took a 5 point moving average for all points, to smooth them out a little. I then expressed every set of 5 points as a ratio of the first 5 points. So, to get the value for point 8, I would calculate Average(Points(8-12))/Average(Points(1-5)), which is actually the same as Sum(Points(8-12))/Sum(Points(1-5)).

This resulted in the following graph (once again, taken as an average):

Ratio of the 5 point moving average to the first 5 point moving average.

That’s all very well, but this is still an average, how do we handle the fact that each trial (each time I stimulate a sample) may have variability to it? Looking at the minimum and maximums rather than the averages, we get this:

Minimum and Maximum current ratios.

If you look carefully, you can see at about 10 or 15 (between 100 and 150 ms), there’s a promising gap between all other minimums and the maximum value for cum. I focused my attention on this ratio.

So, that’s it right? If the ratio between the first 5 points and points 10-15 is less than 0.8, we have cum! Well, yes and no. As I said before, by passing a current through the sample, we are actually changing it, so we need to consider how the nature of the sample changes over time. Also, I wanted to speed up the time taken to get a result, up until now, I was stimulating for 2 seconds and resting for 2 seconds, that was quite slow for the detection I wanted.

So, I sped it up, this time allowing the sample to rest only 100 ms and stimulating for only 200. I then recorded the ratio and plotted it over time. So, the graph below is showing many hundreds of trials (a cycle of stimulation and rest for the sample), where the x-axis is the trial number.

Fast sampling over time

Saliva appears to be quite unstable over time. All other samples I used appear to stabilise well above the ratio for cum. Saliva, however, comes dangerously close. To be fair, I don’t mind so much if I get false positives on saliva since I am not expecting saliva to find it’s way inside the masturbator toy.

I am still worried that the samples do change a fair bit over time, making stable readings difficult. I also note that my simple copper electrodes may not be good enough. The positive electrode slowly builds up a black layer of oxidation, probably from the electrolysis.

Simple code for the detector is here: voltammetry2.sdf.ino

Approaches for detecting cum

It’s been referred to as the “holy grail” of teledildonics, and in my hubris, I want to have a go at detecting male ejaculation. Why ejaculation? Well, this is specifically for uses where someone is playing with a male masturbator toy and they climax. Wouldn’t it be great if they got some kind of feedback for their effort? Maybe the game gives them a reward or the content changes somewhat. Without detecting their climax, there’s no way for the system to do so.

Such a detector would need to be:

  • Affordable (let’s say, less than $50 per sensor)
  • Safe (don’t want to give them a nasty shock or chemical burn as they cum)
  • No false negatives (would be disappointing even if it failed to work just once)
  • No false positives for other common fluids (lube, urine, pre-cum, saliva, water and sweat)
  • Nearly immediate – no point in recognising cum some minutes after the event!
  • Robust against environmental factors (like humidity or what they had for dinner)

I set about researching a number of techniques which I thought would bear fruit:

Florescence: The first thought one might have is to do what they do in the movies and use “black light” or UV. From reading this post on the florescence of semen, it turns out that you need Luminol to trigger semen’s fluorescence with UV, though it sill fluoresce under blue light. Besides all that, these fluorescence based tests only appear to work on dry semen, not liquid semen. This fails the “immediate” test.

pH: At between 7 and 8 on the pH scale, semen is slightly basic, but not enough that using a pH sensor is going to give you a distinguishing marker verus, say, tap water. Also, this pH would probably can vary from person to person. Finally, the pH sensors I have seen are rather bulky.

Spectral Analysis: From semen’s spectral response it looks like the 1650 cm-1 wave number range is good for detecting cum. Detection works this way because certain organic compounds in semen vibrate at a certain frequency. These compounds are found in many other organic samples. The problem with this approach is, this frequency is in the mid-range IR, which is very expensive to produce and detect since it’s so close to heat. It would require expensive specialised apparatus to do it this way and it would most likely both destroy the sample and possibly burn your penis in the process.

Resistance: I tried measuring the resistance of cum using various approaches, but just when I thought I understood how it related to other fluids, I got different readings. Besides which, urine (at approximately  70k ohms) is quite a good conductor compared to cum (about 700k ohms).

Electro-chemical: After reading this paper about detecting chemicals. It made sense to me that whatever technique is used to detect glucose in blood or specific ions in solution should be able to work with cum, because I knew cum contained some salts, in particular sodium and potassium ions (see Biochemistry of semen and the Wikipedia page for semen). We were finally getting somewhere!

Voltammetry: A technique known as Voltammetry, passes a known voltage through a sample and observes how the current through the sample changes over time. This recognises the fact that the act of passing a current through a solution will perform some kind of electrolysis on the solution.

Finally, the phenomenon where semen’s resistance changed over time made sense! You see, whenever you pass a current (no matter how small) through a sample such as semen, you are going to change its chemical composition somewhat. We can measure that change by measuring a change in current.

Next, I actually implement a voltammetric apparatus for detecting cum.