Log in

No account? Create an account

Previous Entry | Next Entry

More on the Mathematics of Sex Toys

I've been posting a bit about the Tormentor, a sex toy I'm designing for the sole and nefarious purpose of not letting the user get off. Quick recap in case you haven't seen the project so far: it's a vibrator connected to a programmable microcontroller that's programmed to run the vibrator in random patterns for random lengths of time with random pauses in between, to keep the wearer sexually aroused but without being q-u-i-t-e enough to allow the wearer to come.

Because, yeah, I'm kind of a bastard.

My sweetie lapis_lazuli beta tested the first standalone prototype, the Tormentor version 0.2, and the biggest problem that arose was that the deice was just too damn bulky.

Part of this was the fault of using a 9V battery to run the microcontroller, but part of t was the fact that the Arduino Uno board I'm using is just plain big.

I mentioned this problem to roadknight last time I was in San Francisco, seeing how he's also a micorocontroller hacker and general mad scientist. He suggested that I use a Teensy USB board in place of the Arduino, and even gave me a spare that he happened to have handy.

The name doesn't lie.

Size comparison, top to bottom: 9-week-old Tonkinese kitten, Arduino Uno, Teensy USB

The Teensy is certainly that; it was the second-smallest programmable microcontroller in his collection. (The first was an obscure Chinese something something on a flexible board, about the height of a grain of rice and three times that long.)

I've started looking into building the Tormentor version 0.3 around a Teensy. It'll take a bit of work; the Teensy lacks an on-board voltage regulator, for instance. I'm thinking of using a 6.3v lithium battery to drive both the Teensy and the sex toy; I'll have to cobble together a recharge/regulator circuit of some sort, but it should let me get the finished gadget very, very small indeed.

The Teensy people don't understand something that Apple does: User experience matters. The Teensy board is unlikely ever to knock over the Arduino as the reigning champ of DIY microcontrollers, even though the Teensy is smaller and has better technical specifications, because the user experience when it comes to programming a Teensy is, to put it bluntly, abysmal.

You don't get no Arduino-style all-in-one IDE and device programmer, where you can type code into a window and press a button and bam! The device is working! Oh, no. The Teensy requires you to install a gcc compiler, then type your code in a text editor, run it through gcc with make, and then load the resulting hex file onto the board with a loader program. It's archaic and barbaric, and it brings back memories of my Programming 101 class in college, in which I wrote 8080 assembly on a CDC Cyber 760 mainframe, compiled it to a hax hex file, copied it onto a floppy disk, then ran it on a CP/M machine using a hex loader.

Someone, please kill me now.

There is, though, an Arduino IDE plugin for the Teensy, and though it's a bit weird and doesn't run all Arduino code, it looks like it should work for me.


( 24 comments — Leave a comment )
Aug. 19th, 2011 02:52 am (UTC)
The Arduino Pro Mini appears to be about the same size as the Teensy USB. It can be programmed with the standard Arduino library. The downside is that it doesn't have a USB port for programming, you'd have to solder on a connector of some sort and then use a USB to serial converter when programming it. On the plus side, it does have an on-board voltage regulator.
Aug. 19th, 2011 08:48 pm (UTC)
Ugh! Hacking together a USB interface sunds a lot more painful than hacking together a voltage regulator.

The Teensy can be powered at 3 volts, as it turns out, which is making me lean toward just using a couple of AA batteries to power it and the vibrator. I had planned to use a pair of 3.6v lithium-ion batteries, using one of the pair to run the sex toy and both of the pair (with a voltage regulator) to run the Teensy. As it turns out, connecting multiple Li-Ion batteries and then discharging them at different rates is a Very Very Bad Thing To Do, and can destroy the batteries, so that's not so good.
Aug. 20th, 2011 12:43 am (UTC)
Yep, if you're connecting batteries in series you don't want to drain them unevenly. That's true of any battery, not just lithium, but lithium cells require a lot more coddling than most other battery chemistry.

You could probably get away with using a single Li-Ion or LiPoly cell to power both the Teensy USB and the vibrator. If the vibrator is designed to run off of two AA batteries, 3.6V shouldn't be too much for it. You'll still want to get the version of the Teensy with the 3.3V regulator, since a fully charged Lithium cell can produce up to 4V which is too much for the Teensy without a regulator. You'll also want to put some hefty electrolytic or tantalum caps on the power into and out of the regulator to deal with all the electrical noise that the vibrator motor is putting out.

With two AA cells, you might run into issues with not having enough voltage for the Teensy USB. From what I can tell from the datasheet, it's rated to run down to 2.7V. Two AA batteries driving a motor can easily drop down that low - typical AA cells have pretty high internal resistance. If you used a MintyBoost or similar switcher to generate 5V from the low AA voltage, you'd be able to keep the device running until the voltage dropped too low for the motor to run. That would help with electrical noise issues too.
Aug. 19th, 2011 04:16 am (UTC)
Killing me with the kittens. Want fuzzy cuteness now!
Aug. 19th, 2011 07:16 am (UTC)
the expression on the cat's face is priceless.

He's like "..what the fuck?"
Aug. 19th, 2011 07:23 am (UTC)
Thank you!
It's like a kitty photobomb.
(Deleted comment)
Aug. 19th, 2011 08:54 pm (UTC)
Using the vibrator with the EEG is actually a different project. I'll probably be using the Arduino for that; the size is less relevant because of the size of the EEG itself. The goal with the Tormentor is to make the gadget as small as possible, so it can be worn for extended periods of time while, say, shopping. Or going out to dinner.

Yeah, I'm kind of a bastard.

I used to do almost all my programming in assembly. I learned Z-80 assembly on my first computer (a Radio Shack TRS-80 Model I, does that date me?) and at one time I could code in Z-80 assembly as fast as I could type.

And believe me, I've used UV-erasable EPROMs. I can still remember what a radical breakthrough EEPROMS were--no pulling the chip out of its socket to erase it! How cool!(I built a gadget for my TRS-80 that had a bunch of 7-segment LEDs and would show the PC of the computer on the LEDs all the time. Used EEPROMS to make the binary-to-7-segment decoders.

Can't say I've ever used an Overo, though.
Aug. 20th, 2011 05:02 pm (UTC)
Nah, using a TRS-80 Model I doesn't really date you. My first computer of my own was a Model III with 16K and a cassette deck.

Using PC in a computer context to mean Program Counter and not Personal Computer, though..
Aug. 19th, 2011 12:31 pm (UTC)
"compiled it to a hax file"....
I have heard of computer hacks, and hex files, but 'hax'?

I find it interesting that most of the folks who used to 'play' with transistors, resistors, op amps, making their own circuit boards, etc are now, it seems, programming these microcontrollers....
Aug. 19th, 2011 08:56 pm (UTC)
Ack! Fixed now.

For me, the programmable microcontrollers appeal to the same mad-scientist bits living within me that love hardware hacking, but can do *so* much more than what I could do by cobbling my own circuits together. I wish I'd known about the Arduino when I was developing an Internet-controlled sex toy!
Aug. 19th, 2011 02:20 pm (UTC)
That picture is fabulous.
Aug. 19th, 2011 02:30 pm (UTC)
Was the obscure thing a Seeed Studios Film?

The flex board seems like it would make it nice and easy to integrate with clothing, although the lilypad arduinos also do that well. Hmm. I am inspired, which is never a good thing.
Aug. 19th, 2011 07:42 pm (UTC)
Nope! It was even smaller, and made entirely on a brown flex board of the kind you see sometimes in cell phones.
Aug. 26th, 2011 04:18 am (UTC)
I'm actually working on a programmable controller with a motor driver on it. The PCB will be about an inch by two inches, and the programming environment will be standard Arduino. More info here: http://gizmosmith.com/?p=212

If you want a board, I'm expecting 10 of them in a couple of weeks (shipping via slow boat from China).
Aug. 28th, 2011 08:10 pm (UTC)
Wow, what a cool project! I'm currently using a TIP120 transistor as my motor driver because as it turns out, small sex toys use about 6 watts of power (3v at 2 amps nominal, found that out the hard way when I let the magic blue smoke out of a very early prototype Symphony unit). Will the device you're working on be able to cope with motors that draw that much current?
Aug. 29th, 2011 02:47 am (UTC)
I think it will. The driver chip is a quad half-H-bridge that can drive one amp per bridge. Stacking two of the chips (one on top of the other) gets you two amps per bridge. Since there are two full bridges, you can also wire the outputs in parallel to combine them into one bridge, so two stacked chips could theoretically drive one motor with 4A.

However, I'm dropping a lot of qualifiers in there because there might be some aspect of this that I've overlooked, like miss-matched switching voltages on the H-bridge transistors causing one transistor to take all the load and catch fire. I'm going to test that configuration before I go around enthusiastically endorsing it as a technique.

If nothing else, if you hook the two H-bridges in parallel, and then set them to have opposed outputs, you will get a merry little fire when they directly connect V+ to ground.
Aug. 30th, 2011 05:00 am (UTC)
Well, I'm down with giving it a shot. After all, other than letting loose a puff of magic blue smoke, what's the worst that could happen?
Aug. 30th, 2011 02:18 pm (UTC)
Keen, I'll send one when I have the prototypes together. I'm going to want bug reports, though, as this is beta hardware.
Dec. 8th, 2011 04:21 pm (UTC)
So, when I say "beta hardware" I mean "I messed up every connector that could have been done wrong". I'll be ordering the V2 PCBs soon, will let you know when I have one together.

My plan for the V1s is to get them working enough to build some demo objects and try to get crowd-funding for the V2 builds.

The device that isn't making it into the crowd-funding demo video is going to be a vibrator that hooks up to a multi-protocol instant messaging program and reacts appropriately when "/harder" and "/faster" (and obviously "/slower" and "/softer") are sent in the IM conversation. Good for hot chat and the like.

I suppose for BDSM purposes, I could add a /taze_sensitive_bits command... Bwah ha ha ha ha.
Aug. 19th, 2011 04:37 pm (UTC)
That picture is delightful in every day :D

And you're killing me with the kitten-cuteness, too!!

-- A (suffering from kitten-lust!)

P.S. And all the sex-toy and programming nerdery is good stuff, too. But KITTEN!!!
Aug. 19th, 2011 08:56 pm (UTC)
Teh teensy kittehs are SO cute OMG!
Oct. 20th, 2011 04:14 pm (UTC)
Sounds good. MOSFET output transistors are a good way to drive things (good old IRF510) as driven digitally they loose less power due to the lack of the 0.7V forward drop (and are more efficient and green too)

Also i have tried running vibrators off the same supply as the control electronics and the voltage drop from the motor starting usually causes a brown out. you need one hell of a decoupling cap to stop this or you need to have a diode or DC/DC converter between the power to the motor and the tank cap on the electronics.
Peter Black
Oct. 20th, 2011 04:32 pm (UTC)
Sounds good. MOSFET output transistors are a good way to drive things (good old IRF510) as driven digitally they loose less power due to the lack of the 0.7V forward drop (and are more efficient and green too)

Also i have tried running vibrators off the same supply as the control electronics and the voltage drop from the motor starting usually causes a brown out. you need one hell of a decoupling cap to stop this or you need to have a diode or DC/DC converter between the power to the motor and the tank cap on the electronics.
Feb. 10th, 2014 12:22 am (UTC)
With the current software "teensyduino" that integrates easily into the Arduino software, the Teensy, (Teensy2 and Teensy3.x) from www.pjrc.com are IMHO, just as easy to use software-wise as an official Arduino. The designer has contributed truly amazing amounts of code to Arduino libraries, and is generally a good guy. I have no affiliation, except as a happy customer and kickstarter backer (for the Teensy3.)
( 24 comments — Leave a comment )