Manual for Vibrator-Control?

Ideas and instructions how you can make your own bondage toys.
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

Another program you can have fun with, is in the "basic" examples in the Arduino software.

It simply ramps the intensity of an LED up and down, up and down.

Feed that to the vibrator, and you have a very nice effect.
:mrgreen:
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
amity
**
Posts: 61
Joined: 14 Jan 2009, 14:15

Re: Manual for Vibrator-Control?

Post by amity »

you mean the "Fade"-program in Basics, right?
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

amity wrote:you mean the "Fade"-program in Basics, right?
Exactly!

Changing the maximum and minimum intensities, and how fast it ramps up and down can be very interesting.
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
amity
**
Posts: 61
Joined: 14 Jan 2009, 14:15

Re: Manual for Vibrator-Control?

Post by amity »

Good news for amity:
The MOSFET has finally arrived !!!
Great!
I did some soldering and hoped for a quick project.

Unfortunately the battery holder wasn`t in the mood (same type as in the picture on page 3).
For whatever reason the vibe didn`t get any power. Even tried it with a LED.
So I took the battery holder that came with the vibe - and it is now working.

BUT:
I have set the batterypack (with a poteniometer) to full power.
The vibe goes on immideately - on a some kind lower setting (and without that the arduino-program is running, so no connection to the computer) :evil:

When I connect to the computer and start the program, the vibe is defenitely reacting to the program an ups the intensity of the vibe as desired.
Only problem: the vibe never shuts down
???
Any idea what is wrong?
amity
**
Posts: 61
Joined: 14 Jan 2009, 14:15

Re: Manual for Vibrator-Control?

Post by amity »

I have tested it with the "Blink" program:
Same thing
The intensity goes up and down, but the vibe never stops completely...
amity
**
Posts: 61
Joined: 14 Jan 2009, 14:15

Re: Manual for Vibrator-Control?

Post by amity »

So sorry,

i got the cables from the battery to to the Mosfet wrong.

NOW, i can test my program :D
:D :D :D :D :D :D :D :D :D :D :D
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

amity wrote:So sorry,

i got the cables from the battery to to the Mosfet wrong.

NOW, i can test my program :D
:D :D :D :D :D :D :D :D :D :D :D
Don't be sorry. I think we have all done that (and still do it at regular intervals).
And you did not even ruin anything!
Sometimes the magic smoke is released from the components, but they do not cost that much. Considering what I've done to electronic components over the years, I'm very impressed how much abuse they can absorb!


I'm still happily surprised whenever something works the first time.
De-bugging will learn you a lot.
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
tkv
*
Posts: 32
Joined: 25 Jul 2009, 14:42
Location: Finland

Re: Manual for Vibrator-Control?

Post by tkv »

I had never really looked into Arduinos or other microcontrollers because I thought they'd be difficult to work with or program, but this thread got me intrigued. So I spent much of last night browsing various tutorials and eBay and well, color me surprised! The programming language is a high enough level that even I could do it, and the amount of peripherals is staggering. And all of it is pretty cheap. I could immediately think of a couple of things to do with it even outside the kinky realm.

So I hope you don't mind a couple more newbie questions. I'm reasonably good with electronics but haven't touched microcontrollers before.

Are these compatible enough that I could prototype and code on a bigger board, say the Uno, and then make the actual device out of a Nano board and it'd still work?

...okay maybe just one newbie question, but I'm sure there will be more.
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

tkv wrote:..
Are these compatible enough that I could prototype and code on a bigger board, say the Uno, and then make the actual device out of a Nano board and it'd still work?

...okay maybe just one newbie question, but I'm sure there will be more.
Certainly not a bad question!
Yes you can.
You just select another board in the Arduino software, and upload the code to the other board.
The great thing is, that it is the same IDE across the boards, you just tell the compiler, what board it is, and it takes care of the rest
(Or you can go even smaller, and upload the code to a small stand-alone chip like the Atmel Attiny (it is a little more complicated, but it works perfectly well))

I normally develop the code on an Uno (nice and big for my clumsy fat fingers, easy to change connections), and if I want to keep the result after playing and testing has finished, I make a permanent set-up with a Pro Mini and soldered connections (I get them from ebay, they are shockingly cheap).
The Pro Mini has no USB chip on it. It makes them cheaper, but you will need a separate USB-adapter to transfer the code.

A nano has the USB part, and you will see no difference.

The entire family is listed here:
http://arduino.cc/en/Products.Compare

For your first, you should buy an official version, to make sure that if something is not working, it is not the board's fault (and to support Arduino!)
Once you have the routine, all the knock offs can be both cheap and fun.
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

Edit:
The gizmo I use to program the Pro Mini is an "FDTI breakout board"

I'm even less sophisticated than on this foto:
Image
Picture from http://arduino.cc/en/Guide/ArduinoProMini

I just stick the 6 pins at the end of the FTDI board into the corresponding holes in the Pro Mini, apply a little leverage to make sure that there is contact and upload.


The Arduino Pro Mini is intended for advanced users who require flexibility, low-cost, and small size.
Oooooh! I be flattered!

It sounds a lot better than
The Arduino Pro Mini is intended for perverted nerds, that are cheap too!
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
Ace
*
Posts: 1
Joined: 24 Jun 2013, 16:07

Re: Manual for Vibrator-Control?

Post by Ace »

Update for the Code of Sir Cumference

Adafruit Motor Shield http://www.adafruit.com/product/81

Code: Select all

/*
    Random motorcontroller

    History:

    - Version 3.0  03 NOV 2014 (ACE)
        Code Cleanup
        easily expandable by level matrix
        for Adafruit Motor Shield (http://www.adafruit.com/product/81)
    - Version 2.0  17 SEP 2014  (and 2.1, which is actually working)
        A cycle counter and different values enanbled
    - Version 1.2        11 September 2014
        offTime defined as "long" to enable "off > 32676 ms"
    - Version 1.1        06 September 2014
        "Balance" Pause/Pulse has been added as a user parameter.


    From the infamous Sir Cumference to Amity.
    Welcome to the wonderful world of perverted programming!

    :-)
*/

/***********************************************
*   Setup Level's  (levelMatrix)
*
*   (minTime)       value in ms. Minimum length of pulse or pause (Default = 500)
*   (maxTime)       value in ms. Maximum length of pulse or pause (Default = 5000)
*   (minIntensity)  Minimum intensity value (0-255) MUST BE SMALLER THAN maxInt ! (Default = 50)
*   (maxIntensity)  Maximum intensity value (0-255) MUST BE LARGER THAN minInt !  (Default = 255)
*   (balance)       relative offset between off/on. large value = long pauses  (Default = 1)
*
*/
const int level = 4; // Max Level and Matrix Size

// { maxCount, minTime, maxTime, minIntensity, maxIntensity, balance },
unsigned int levelMatrix[level][6] = {
    {5, 1000, 2000, 50, 255, 1},
    {10, 200, 3000, 50, 255, 1},
    {15, 300, 4000, 50, 255, 1},
    {30, 500, 5000, 50, 255, 1},
};

/***********************************************/



#define MAXCOUNT 0
#define MINTIME 1
#define MAXTIME 2
#define MININTENSITY 3
#define MAXINTENSITY 4
#define BALANCE 5


//Adafruit MotorShield
#include <AFMotor.h>    
AF_DCMotor motor(1);    //Motor 1



// defining the other values the program needs:
unsigned int onTime; //how long to be on
unsigned int intensityVal; // with this intensity
unsigned int offTime; // how long to be off
unsigned int counter = 0; // for counting the number of cycles
unsigned int currentLevel = 0;


//****************SETUP***********
void setup() // runs once to get things ready
{
    //pinMode(signalPin, OUTPUT); //define signalPin as OUTPUT

    randomSeed(analogRead(0)); //listen to an unused pin, to generate (mostly) random values.
    Serial.begin(9600); // start serial monitor, to see in text what is happening
    // I'll use that, and write the values you gave above to the monitor:
    // No real use, just to show you how to send some text.


    Serial.println (" "); // empty line
    Serial.println ("Welcome to Amity's Random Vibrator Controller");
    Serial.println ("Remember to input your desired values in the code.");


    delay   (1000);   
    Serial.println (" "); // empty line
    Serial.println ("Let the fun begin!");
    Serial.println (" "); // empty line
}

// *************and this is where things happen!***************
// loop runs over and over and over and over.....
void loop() {

    currentLevel = getLevel(counter);

    onTime = random( levelMatrix[currentLevel][MINTIME], levelMatrix[currentLevel][MAXTIME] );
    offTime = random( levelMatrix[currentLevel][MINTIME], levelMatrix[currentLevel][MAXTIME] );
    offTime = offTime * levelMatrix[currentLevel][BALANCE];
    intensityVal = random( levelMatrix[currentLevel][MININTENSITY], levelMatrix[currentLevel][MAXINTENSITY] );

    printLevel();


    //turn Motor on
    runmotor(intensityVal);
    printData(true);
    delay (onTime);
    

    //turn Motor off
    runmotor(0);
    printData(false);
    delay (offTime); 


    counter ++; // add 1 to the value of "counter"
    Serial.print ("Elapsed number of cycles is:   ");
    Serial.println (counter);
    // That's it! Now it will go back to the start of the loop and run it again with fresh values
}


void printLevel()
{
    Serial.println (" "); // empty line
    if (currentLevel == 0)
        Serial.println("Startlevel");
    else
    {
        Serial.print("Level ");
        Serial.println(currentLevel);
    }
}

void printData(bool state)
{
    if (state)
    {
        Serial.print(" ON!   Intensity = ");      // and write it in the serial monitor
        Serial.print(intensityVal);
        Serial.print("   On-time = ");
        Serial.println(onTime);
    }
    else
    {
        Serial.print(" OFF!   Intensity = 0");      // ...and write that in the monitor
        Serial.print("   Off-time = ");
        Serial.println(offTime);
    }
}


int getLevel(int count)
{
    int lev = 0;
    while ( levelMatrix[lev][MAXCOUNT] <= count )
    {
        if ( lev >= (level - 1) )
            break;
        lev++;
    }
    return lev;
}



void runmotor(int value)
{
    //Adafruit Motor Shield
    if(value == 0)
    {
        motor.run(RELEASE);
    }
    else
    {
        motor.run(FORWARD);
        motor.setSpeed(value);  
    }


    //without Adafruit Motor Shield
    //analogWrite (signalPin, value);    
}
Last edited by qwerty212 on 03 Nov 2014, 20:52, edited 1 time in total.
Reason: I have deleted one of your posts as they were repeated. Welcome to the forum
amity
**
Posts: 61
Joined: 14 Jan 2009, 14:15

Re: Manual for Vibrator-Control?

Post by amity »

...back again.

I have tried and modified my program a couple of times now.
I was a great experience!

But now it is getting a little boring. Probably not the right word, because it still does what it is supposed to do :D
Maybe it used too much 8)
Nevertheless, I have to broaden my horizon and think of something else.

I will come back to this project in the future. 100%

Thanks for all your help.
It would not have been possible without you all.

Cheers
Amity
User avatar
Sir Cumference
Moderator
Posts: 1606
Joined: 29 Jan 2012, 22:00
Location: Scandinavia

Re: Manual for Vibrator-Control?

Post by Sir Cumference »

Great to hear that it is working!


Now that you master the basics, creativity can flourish!
~ Leatherworking, blacksmithing , woodworking and programming are the most pervertable skills you can learn! ~
o2l8
*
Posts: 4
Joined: 26 Sep 2011, 14:22

Re: Manual for Vibrator-Control?

Post by o2l8 »

we are onto something great here.Or I should say you are. I am trying to learn the coding required but I am not good at it at all.
A couple things i things i can contribute is:
1.http://www.dx.com/p/lson-l298n-stepper- ... G5l0vnF-SoGives you 4 independent motor control channels. you could have 4 different vibes or better yet, these are rated to 10 amps. A 12v computer power supply, a 12v gear motor (or a winschield wiper motor) for stroking, front and back :shock:
2. Another thing that caught my eye is this http://www.pololu.com/product/1696 to sense the "hardness" and make adjustments on the fly.( I got the Idea from a post over on Milovana forum "Arduino Edging machine" interesting, but there is a lot of room for improvement.
From Here http://www.milovana.com/forum/viewtopic ... 12&t=14250

3. Power. For bullet vibes and the Arduino these work AWSOME! http://www.amazon.com/Aduro-POWERUP-Por ... 6V3HXT3V29 Image

4. Bullet vibes are cheap http://www.amazon.com/Super-Charged-Dua ... ration+egg just cut and solder on some 3.5 mm jacks or buy them with the jacks on the end of the bullet already.

For Scenarios I think random of three types:
1. gradually longer vibes and longer breaks.
2.Using the sensor and establishing an edge, going slightly longer than the previous edge after X but longer breaks.
3. Shorter breaks up to an edge (determined by the sensor and a button press.)
4. Maybe a anal vibe that only works when the penis is off. on another channel from the controller.
tkv
*
Posts: 32
Joined: 25 Jul 2009, 14:42
Location: Finland

Re: Manual for Vibrator-Control?

Post by tkv »

I haven't got an Arduino yet, but I did find a Raspberry Pi B+ in a local computer store. Sooo... did some googling, got the wiringPi library (as shown here https://sites.google.com/site/semillero ... rials/gpio ) and breadboarded a simple transistor circuit to drive a vibrator.

Here's the "code" I used, for inspiration. It's just a shell script, how easy is that? 8)

Code: Select all

#!/bin/bash
while :;
do
TEHO=`shuf -i200-500 -n1`
if (( $TEHO > 250 ))
then
PAALLA=`shuf -i5-20 -n1`
else
PAALLA=`shuf -i10-30 -n1`
fi
echo On for $PAALLA seconds, power $TEHO
gpio pwm 1 $TEHO
sleep $PAALLA
POIS=`shuf -i5-30 -n1`
echo Off for $POIS seconds
gpio pwm 1 0
sleep $POIS
done
Post Reply