Arduino Vibrator
Posted: 06 Oct 2012, 11:31
For those who are interested in or have an Arduino, I've been developing the software for a vibrator that has basically every single mode or setting I think you could want.
The software is in it's final stages, although I am happy to take suggestions from the community, as well as give instructions on how to connect and set the vibrator up.
The source code is available here: http://pastebin.com/qnA5ib1C
The hardware includes an Arduino ( http://www.freetronics.com/products/eleven#.UGm18_lrapM ), an LCD shield ( http://www.freetronics.com/collections/ ... HATfvlrapN ), and a vibrator that you can plug into the Arduino board. (this involves having access to the leads that enter into the vibrator)
It took some ingenuity to put the thing together. Personally I used an xbox controller vibrator, and a film canister for the container; using some super glue to make sure the seals are water tight, and filing down the notches on the cap to make it comfortable to insert. Although you could plug in a store bought vibrator if you'd prefer, I'm just working with what I've got.
I'm approaching the physical limit of features that I can give it (The Arduino is basically full on the software side of things). It has 4 main settings; constant, wave, wave of waves (I'll explain further down), and random (my favourite).
It outputs a voltage (0 to 5v at a maximum of 1.8amps (usb max) ) through one of the pins (digital pin 10) on the board to ground. (I can give further instructions to how this all works and is constructed if anyone would like)
Now for the settings:
-Constant: I believe this is fairly self explanatory. You can select a level from 0 -> 255 (0 being 0volts, 255 being 5volts) and that will continue indefinitely.
-Wave: I spent a long time coming up with different wave settings. There are 4 wave settings; the standard sine wave; triangle wave; square wave; and sawtooth wave. You can also select the minimum and maximum levels, as well as the amount of time it takes the wave to oscillate (this can be from 1 -> 9999 seconds, roughly 3 hours).
-Wave of Waves: Because I'm rather mathematically inclined, I wanted a way to make the waves increase in frequency, and then decrease in frequency, as if it were breathing. (for those who are also mathematically inclined, I used the following function as my basis: y = cos( tan( x ) ), with some modification to make it work for my purpose. (for those who really want to know, you can always look through the source code.)
Again, this setting allows you to chose the minimum and maximum levels, the period between cycles, and a constant term that changes how many waves there are per cycle (if you put a constant before tan(x), you'll understand what I'm talking about http://www.wolframalpha.com/input/?i=y+ ... %28x%29%29 )
-Random: Finally, my favourite setting. This setting will randomly choose what it will do, it will select a random wave setting with random maximum and minimum values as well as a random period with a random amount of time that it will spend on that setting, or it will choose a constant setting for a random amount of time, or turn off for a period of time. The maximum and minimum values that the random program can choose from can be set, as well as the maximum period, and the maximum and minimum amount of time it can spend on a single setting.
In all modes, you can choose to have the vibrator remain off for a period of time before it begins it's cycle. This was added so users could set the vibrator up, tie themselves up and not have the vibrator get themselves off ahead of time, or possibly to frustrate the user. This time can again be up to 3 hours.
The software is in it's final stages, although I am happy to take suggestions from the community, as well as give instructions on how to connect and set the vibrator up.
The source code is available here: http://pastebin.com/qnA5ib1C
The hardware includes an Arduino ( http://www.freetronics.com/products/eleven#.UGm18_lrapM ), an LCD shield ( http://www.freetronics.com/collections/ ... HATfvlrapN ), and a vibrator that you can plug into the Arduino board. (this involves having access to the leads that enter into the vibrator)
It took some ingenuity to put the thing together. Personally I used an xbox controller vibrator, and a film canister for the container; using some super glue to make sure the seals are water tight, and filing down the notches on the cap to make it comfortable to insert. Although you could plug in a store bought vibrator if you'd prefer, I'm just working with what I've got.
I'm approaching the physical limit of features that I can give it (The Arduino is basically full on the software side of things). It has 4 main settings; constant, wave, wave of waves (I'll explain further down), and random (my favourite).
It outputs a voltage (0 to 5v at a maximum of 1.8amps (usb max) ) through one of the pins (digital pin 10) on the board to ground. (I can give further instructions to how this all works and is constructed if anyone would like)
Now for the settings:
-Constant: I believe this is fairly self explanatory. You can select a level from 0 -> 255 (0 being 0volts, 255 being 5volts) and that will continue indefinitely.
-Wave: I spent a long time coming up with different wave settings. There are 4 wave settings; the standard sine wave; triangle wave; square wave; and sawtooth wave. You can also select the minimum and maximum levels, as well as the amount of time it takes the wave to oscillate (this can be from 1 -> 9999 seconds, roughly 3 hours).
-Wave of Waves: Because I'm rather mathematically inclined, I wanted a way to make the waves increase in frequency, and then decrease in frequency, as if it were breathing. (for those who are also mathematically inclined, I used the following function as my basis: y = cos( tan( x ) ), with some modification to make it work for my purpose. (for those who really want to know, you can always look through the source code.)
Again, this setting allows you to chose the minimum and maximum levels, the period between cycles, and a constant term that changes how many waves there are per cycle (if you put a constant before tan(x), you'll understand what I'm talking about http://www.wolframalpha.com/input/?i=y+ ... %28x%29%29 )
-Random: Finally, my favourite setting. This setting will randomly choose what it will do, it will select a random wave setting with random maximum and minimum values as well as a random period with a random amount of time that it will spend on that setting, or it will choose a constant setting for a random amount of time, or turn off for a period of time. The maximum and minimum values that the random program can choose from can be set, as well as the maximum period, and the maximum and minimum amount of time it can spend on a single setting.
In all modes, you can choose to have the vibrator remain off for a period of time before it begins it's cycle. This was added so users could set the vibrator up, tie themselves up and not have the vibrator get themselves off ahead of time, or possibly to frustrate the user. This time can again be up to 3 hours.