Category: programming

Programming the body interaction 1 (BI) – part 1

Controlling the vibration motor

The vibration motor is an analog device. You can control the vibration on a scale between 0 and 255. If you set the vibration to 0 the motor is off, if you set the vibration to 255 the motor will be at full speed.

Good vibrations Tokyo by Kevin Dooley, CC BY 2.0

Good vibrations Tokyo by Kevin Dooley, CC BY 2.0

The motor is connected to a pin of the controller (“ATtiny84”), the heart of the BI. Every pin has a number and the motor is always connected to pin 3.

on off chartNow we can start with the first script (or program). The script will set the motor to full speed for one second. Then the motor will be off for 1 second. And this will be repeated infinite.

 

 

 

 

Here is the complete script:

int motor=3;
void setup() {
  pinMode(motor, OUTPUT);
}

void loop() {
  analogWrite(motor, 255); //motor on
  delay(1000);  // wait for 1 second
  analogWrite(motor, 0); //motor off
  delay(1000);
}

Now the script is explained line by line:

int motor=3;

First we declare a variable called “motor” and assign the value 3. The variable is of type int (integer) which is used to store a number. Now we could use “motor” instead of “3” whenever we want to control the vibration motor – this will help us to understand and debug our script.

void setup() {
  …
}

This is function which is part of every Arduino script. It is called setup and well be executed at first and only once.

pinMode(motor, OUTPUT);

Each pin can be in INPUT or OUTPUT mode. In input mode sensor data can read, in output mode a motor or a LED can be controlled. We set the motor pin to OUTPUT.

void loop() {
  …
}

In the function loop we put all the instructions which should be carried out. When all instructions are done the script doesn’t stop but starts again. Therefore the loop will be repeated infinite.

analogWrite(motor, 255);

The motor is set to full speed (255).

delay(1000);

The delay function stops all processing for 1000 milliseconds. 1000 millisecond are 1 second.

analogWrite(motor, 0);

Then motor is set off (0). In the second part of the tutorial uploading of the script to the body interaction 1 is explained.

More:

https://www.arduino.cc/en/Tutorial/Foundations

Read part 2: the accelerometer

Get started with Arduino 1.6.7 and Windows 10

Thanks to christmas I am the owner of a new Windows 10 notebook. So I experienced the trouble other user encounter when the use the ATtiny microcontroller the first time.

I wrote a new how-to for the installation of Arduino 1.6.7. Although it takes some time to configure all options, everything can be done within Arduino 1.6.7 (No replacing and moving of files is necessary.)

sucessful compiling

The how-to describes the necessary steps:

  1. Installation of an ATtiny core (thanks to the new core from Spence Konde installation is much easier)
  2. Installation of the JeeLib
  3. Configuration (programmer etc.)

Driver installation (Windows only)

Another frustating aspect is the installation of the driver for the USBtinyISP. The USBtinyISP is needed to connect your Windows computer and the body interaction development board. The connect your computer how-to is now improved. If you use Linux or a Mac there is no driver needed.

Review of vibrator development boards

Designing your own sex toys with advanced technology is becoming popular. Although the community is still very small the interest is rising. In this article we will introduce for open source vibrator development boards including our body interaction 1. We will see how the design of the development boards determines the design space – the possibilities of sex toys which can be realized.

Comingle may be the most successful open source sex toy company. They invented the Mod – an Arduino based vibrator with 3 vibration motors. They also offer the Dilduino – a development board based on the Atmel ATmega342U4 (similar to the Arduino Micro). The board can drive 3 vibration motors. They have developed a great library for programming vibration pattern (“OS sex“). You can use arbitrary function like sinus or cosinus to define pattern. You can upload programs via the USB connection, but there is no wireless radio or WiFi connection on board. The board lacks battery charging support, so you need external power. As the board is quite large it is only suitable for larger toys. Available at Tindie.
Pro: supports 3 motors, full Arduino compatible, great library, superb tutorials
Cons: no wireless connectivity, no battery charger, quite large for being part of a sex toy

pen15_smallPen 15 shield is a shield for the Arduino Uno.  So you need an Arduino Uno in addition to the shield. The shield must be connected to the Arduino board. It has one driver for a vibration motor. This pioneer work was announced in 2011, but it is probably not available any more. The price is quite low. There is no battery charging option and it is very large compared to the other boards.
Pro: full Arduino compatible
Cons: no wireless connectivity, no battery charger, too large to be part of a sex toy

Master Beta Kit from Orgasmatronic Inc. is another shield for the Arduino Uno. It can control two vibration motors. The power source for the vibration motors could be different though you may control motors with different input voltages. Easy assembling and support with online tutorials.

Pro: full Arduino compatible, different motor input voltage
Cons: no wireless connectivity, no battery charger, too large to be part of a sex toy

Assembled boardThe body interaction development board can drive one motor. It has a LiPo battery charging option. It can be controlled by motion – a 3-axis accelerometer is build in. Using motion you can control the vibrator – no need for further peripherals like switches or slider for controlling the vibration speed. The main advantage is the wireless radio especially if you like to use more than one sex toy at once. You can transmit data between your toys, control your toys or even synchronize them. The form factor is very small, though it can be part of a small toy. As the board is only 20x36mm there is not much space for further functionalities: It has no serial interface. To upload a program you need an ISP programmer (eg USBtinyISP). And it uses a microcontroller from the ATMEL ATtiny series. Although the tiny microcontrollers are getting more and more popular they have some disadvantage compared to the standard ATmega328p: There is not much memory on the chip (8K instead 32K), some libraries may not work, less I/O ports. Available at Tindie.
Pro: small form factor, LiPo battery charger included, wireless radio, motion tracking
Cons: some libraries don’t work, programmer needed for uploading programs

263867448_047fe6a73f_m

From Gideon, Paris, City of Love, https://flic.kr/p/pjoAL License: CC BY 2.0 https://creativecommons.org/licenses/by/2.0/

Most probably we will see more boards arrive and we hope that there are Open Source, too. But for a breakthrough for open source DIY sex toys an open standard would be helpful like the Arduino helped physical computing becoming popular for nerds, SIGs,  artists, scientists, hobbyist, industry!
But open source sex toys are not only a technical endeavour. It is about our relation to love, sex, partnership, about taking responsibility. Open sex toys are about getting a deep and well-founded understanding of our personal sexuality and the sexuality of our loved ones.

 

Visualize and publish sex toy activity – part 2

In the first how-to we explained how-to upload the data of the body interaction vibrator development board to a database.

Now we want to show you how easy it is to visualize the motion data of one or more body interaction boards. And in the last part of the how-to we set up a webserver. So you can share your activity data with other.

BI activity 3+ HTML

Web form for ploting your sex toy data

What could we learn from this data:

  • how often people use sex toys
  • how long is a typical session
  • motion frequency analysis for orgasm detection

There are manifold application areas for this data:

  • compare (and compete) with others
  • quantify yourself
  • learn more about the quality of sex
  • share benefitable sex toy usage pattern

You could also combine the sex toy data with other fitness data and learn how sex eg. influences your health.

That’s the end of the “record and share sex toy data” series. We would like to know what you think about this. Does it make sense? To complex? Should we develop a body interaction “base station” with a web server? Or would you prefer an app for your smartphone?

Figure: Activity of 3 BI boards over time. Each color represents one BI which has a distinct node ID.

Figure: Activity of 3 BI boards over time. Each color represents one BI which has a distinct node ID.

How a program for the body interaction 1 works

The P5_fin script (program) is the basic Arduino script which demonstrates all functions available:

  • The speed of the vibration motor is controlled by movements.
  • Movement data are sent to other body interaction boards.
  • Vibration strength is adjusted when near by body interaction boards have different speed

BI1 interaction pattern

How it works:

The P5_fin script reads data from the accelerometer. Depending of the measured motion the vibration motor is speed up or slowed down. (Slow motion = reduce vibration motor speed, fast motion = speed up).

When the measured motion changes the motion data are sent out and can be received by other BI1. At the same time this script listen to other body interaction boards which send their motion data to all listening nodes.

CodebenderWithBI script and parametersWhen the measured motion of other body interaction board are different from the motion measured by this script, the vibration motor is adjusted (speed up or slowed down). So two or more body interaction boards can influence each other and synchronize after some time. The documented script is available in codebender. In this how-to the uploading of the script is explained.

 

Record and share sex toy activity

John Millward showed in his recent study that there is not much knowledge about sex toy usage. By analysing buying behaviour in UK biggest online store he learned a lot about who is interested in which kind of toy (men/woman, single/attached). But who will use the toy which one has bought for what and for how long is still unknown.

Activity of 3 BI boards over time. Each color represents one BI which has a distinct node ID.

Activity of 3 body interaction (BI) vibration development boards over time. Each color represents one BI.

The body interaction vibrator development board recognizes activity (motion) data and sends the data to other boards or to a server. So it is possible to upload the usage data of one or multiple vibrators to a (internet) database.

What could we learn from this data:

  • how often people use sex toys
  • how long is a typical session
  • usage pattern: on your own or with your partner
  • handling of the vibrator
  • motion frequency analysis for orgasm detection

There are manifold application areas for this data:

  • compare (and compete) with others
  • quantify yourself
  • learn more about the quality of sex
  • share benefitable sex toy usage pattern

You could also combine the sex toy data with other fitness data and learn how sex eg. influences your health.

With the body interaction vibrator development board it is easy to upload the data. In this how-to we explain how it is done. In the next blog post we will explain the presentation of sex toy activity plots in the web.

Programming with Codebender

CodebenderWithBI script and parametersCodebender is a great browser-based programming tool. Especially their support for non-standard Arduino platforms like the popular ATtiny microcontrollers is impressive. Before codebender you had to install the actual Arduino software plus the ATtiny core plus compiler updates…

With codebender you select the Arduino core and that’s it. In the new how-to we show you how-to upload a Arduino script to the body interaction 1 (BI1) board. And we present you a script for controlling the  BI1 and how BI1 communicate wireless with one another.

%d bloggers like this: