Complete Arduino novice, looking for advice for a project

Selfbondage software and other kinky developments

Moderators: Riddle, Shannon SteelSlave

Post Reply
zer0life
*
Posts: 4
Joined: 03 Apr 2012, 01:46

Complete Arduino novice, looking for advice for a project

Post by zer0life »

Hey guys, long-time lurker to the forums but this is one of my few posts here. Basically, I've been on a little bit of a BDSM DIY kick lately. I've got something in mind for my next project, but it involves some electronics work, which is something I've never attempted before. I know you guys are kind of the go-to experts in the field, so I figured I'd post here and ask.

The project is simple enough - I want to power a pillory or stocks for self-bondage purposes, using an electromagnet and an Arduino board. From a non-kinky perspective, I've been meaning to get into Arduino projects for a while, but I think something like this'll be a good motivation to finally take the plunge and buy a board. I've already got some C++ experience (which, as I've been told, is similar to the language the boards use), so I don't think coding for it will be a huge challenge, however, I've got a ton of hardware-related questions.

Here's the basic build rundown: Building the stocks themselves will be a cakewalk, so I'm not gonna bother with the details of that. What I want them to do, however, is to latch using an electromagnet on one side, which will be powered by a wall outlet. On the back side of the stocks, I want to have a LCD screen + buttons that will allow me to set the timer prior to closing them, and the Arduino will take that information and shut off the electromagnet at the set time. If possible, I'd also like to set up something similar to the Pen15 board, so I can also have a vibrator starting and stopping at random or through a set pattern during the duration. And, if electricity is interrupted, say by a power surge, power outage, or emergency "Oh shit pull the plug!" moment, the magnet will shut off due to lack of power.

Of course, I'll make sure there'll be proper testing and safety checks prior to use.

So, as a complete novice to Arduino, where do you suggest I go from here? What boards do I buy? How do I go about wiring the power from the outlet through the Arduino to the magnet? Is such a build even possible? Do I really even need an Arduino for this?

Looking forward to your advice!
OrgasmAlley
****
Posts: 515
Joined: 18 Nov 2012, 17:43

Re: Complete Arduino novice, looking for advice for a projec

Post by OrgasmAlley »

First, a note about your electromagnet setup. A standard door lock magnet -- which I assume you'll be using -- should be installed in a way that momentarily turning off power not only releases the steel bar but causes it to leave proximity of the magnet face. The steel bar typically has a spring-loaded button, but this won't lift enough to prevent re-engagement if the magnet gets power again if the bar sits atop the magnet.

On the Arduino, everything you need to know is on the Arduino site. You'll use a relay to operate the electromagnet... I put it in the 12 VDC positive lead after the transformer in my system, but you could also control 120 VAC from the outlet, pre-transformer. Arduino pins have a recommended power level of 20 mA with an upper limit of 40 mA. They'll sink more power if you try, but this WILL damage the board. There are small relays you can run directly, but in general you want to use a transistor as shown here: http://www.arduino.cc/playground/upload ... relays.pdf

You should set things up so the electromagnet is "positive fail," it's off when the relay is not powered through the transistor. Note the most common problem with this circuit... the relay power ground and Arduino ground MUST be tied together.

Buttons are simple: http://www.arduino.cc/en/Tutorial/button

Here's a good launch point for LCDs: http://www.arduino.cc/playground/Code/LCD

You'll probably want to print to the LCD over a serial connection. The Sparkfun serial enabled LCDs are an easy way to go, near the bottom of this page: https://www.sparkfun.com/categories/148
zer0life
*
Posts: 4
Joined: 03 Apr 2012, 01:46

Re: Complete Arduino novice, looking for advice for a projec

Post by zer0life »

You, good sir, are a saint. Thanks for the advice! I'll post back here eventually and let you know how it goes.
PiJoy
**
Posts: 89
Joined: 07 Sep 2011, 18:26
Location: Boston Metro Area, Massachusetts, USA

Re: Complete Arduino novice, looking for advice for a projec

Post by PiJoy »

OrgasmAlley wrote:
<snip>

You'll use a relay to operate the electromagnet...
I think you'll be better off using a Solid State Relay (SSR) instead of an old-fashioned electro-mechanical relay. SSRs have essentially infinite switching life (if you design within their specs.) And the great majority of them are optically isolated from the output (often house current or higher.) This isolation makes the overall system safer, it also protects you Arduino and related circuitry from damage due to electrical coupling to the output circuit. Some are suitable for rapid (fractions of an AC cycle) switching, where others (AKA zero-crossing) are more suited to switching in integer numbers of AC half-cycles.

Here are links to a couple SSRs:

I've used this one for modest (60 W or below) projects; it's a fast-switching, suitable for phase-control SSR:
Sharp p/n PR3BMF51NSKF, http://www.digikey.com/product-search/e ... -2562-5-ND

For handling more power, here's another from Digikey, rated 8 amps @240 VAC:
http://www.digikey.com/product-detail/e ... -ND/720462

Another thing about optically-isolated SSRs is that the input is non-inductive (unlike a relay's input), and often can be driven directly by an Arduino pin. The above two have low enough input current specs that you can drive them directly from an Arduino pin.

Hope this helps!
User avatar
qwerty212
Moderator
Posts: 1064
Joined: 23 Mar 2010, 20:24

Re: Complete Arduino novice, looking for advice for a projec

Post by qwerty212 »

As usual another master class from you Pijoy.

You don't imagine how much it is going to help me for my non-slefbondage projects.

Greets from Barcelona.
Post Reply