You’re a budding webcam star, and you want to give your viewers some way of controlling your fucking machine or magic wand, remotely over the internet. Or you just want to give your long distance partner access to your hardcore toys. But you don’t want to spend silly money on a brand new web-connected device! What can you do? For less than $20, you can add a web control interface to your regular old AC-powered sex toys, like a Hitachi Magic Wand, F-Machine Pro, Sybian, or anything else that can be instantly turned on from a wall switch.
Here’s a demo:
Here’s what you need:
- A set of cheap RF controlled sockets on the 433MHz band. I’ve provided code for the type which have a rotary switch on the back to change channel and device ID. In the UK, these can be sourced at Maplin as a set of 3 for £15, but I don’t have a specific link for the US (let me know in the comments if you know one on Amazon or something, and I’ll update here). Look at the back of the pack and it should say “433MHz” somewhere. You’ll be able to see some rotary switches such as the picture below. If they have DIP switches instead, you’ll need to modify the code slightly.
- 433mHz transmitter. Buy on eBay UK / eBay US (comes as a set with a receiver too – no more than $3 including shipping!). You’ll need some jumper wires too – female to female.
- NodeMCU v2 or v3 board. This is an Arduino-compatible micro-controller with built-in WiFi (~$5).
- CH430 serial drivers for Windows or Mac.
- Arduino IDE v1.6.5 for Windows or Mac installed.
- RCSwitch library added to your Arduino/libraries folder.
- My code.
- A free account at noip.com, which gets you a free domain for people to access your toys. Once you’re signed up, and assuming you chose a domain at sign up time, there’s nothing more for you to do – it’ll automatically be associated with your IP address. Just make sure you check in again if your IP changes for some reason (such as restarting your router, or after an internet outage in your area).
Here’s an overview of the steps to make this work, but I’ll break them down in detail next.
- Install Arduino IDE and add the ESP8266 board to your Arduino install.
- Download and modify my code with your WiFi details.
- Change the toy definitions to match yours.
- Set switches to channel 2, with IDs 1,2,3,4 (you can change this in code if you need)
- Upload the code and test locally at the URL http://sextoydb.local/
- Setup port forwarding and IP reservation.
- Register a free noip.com domain so people outside your home network can access the control panel.
Set Up Arduino / NodeMCU
Open up Preferences, and add the following where it says Additional Boards Manager URLs:
Then go to Tools -> Board -> Boards Manager:
and search for ESP8266. Select the latest version from the drop down and hit install:
Once installed, connect the NodeMCU board with a micro USB cable. From Tools -> Board, select NodeMCU 1.0. Then from Tools -> Port, select whichever mentions “wchusb” – this will vary on Windows and Mac. If you only have Bluetooth or nothing listed there, you forgot to install the CH430 drivers. Do that first, then restart and try again.
Wire Up The Transmitter
There are 3 pins coming out of the radio transmitter. From left to right, when looking at the device from the front where the components are:
- Data, connect this to D4 on the NodeMCU
- + Power (VCC), connect this to pin labelled VIN on the NodeMCU
- Ground, connect this to GND on the NodeMCU
Load The Code
Download my code if you haven’t already, then unzip and open up the .ino file. The Arduino software will prompt you to move it somewhere and put it in a subfolder, so go ahead and accept that.
Right at the start you’ll find the only bits you need to modify. Replace WIFINAME with the name of your WiFi network, and WIFIPASSWORD… with your password.
const char* ssid = "WIFINAME"; const char* password = "WIFIPASSWORD";
Below that is up to 4 toy definitions. The first variable is true or false for whether you want the device to be enabled or not – I’ve left only two devices on by default, so set the others to true if you want more (and remember to leave the semi-colon ; at the end, or you’ll get errors). Next you have a name of the device, and finally a small image representation. You can use the images hosted here for a Magic Wand and F-Machine, or link directly to your own uploaded images somewhere (just don’t steal the URL from some random website, or they may get pissed off that you’re stealing bandwidth).
bool d1_enable = true; //set to false to deactivate this device (up to 4 possible!) String d1_name = "Magic Wand"; //name the device String d1_image = "https://sextoydb.com/wp-content/uploads/2016/08/magicwand-300x184.jpg"; // a magic wand bool d2_enable = true; String d2_name = "F-Machine"; String d2_image = "https://sextoydb.com/wp-content/uploads/2016/08/fmachine-300x201.jpg"; bool d3_enable = false; String d3_name = "Sybian"; String d3_image = "https://sextoydb.com/wp-content/uploads/2016/08/fmachine-300x201.jpg"; bool d4_enable = false; String d4_name = "F-Machine"; String d4_image = "https://sextoydb.com/wp-content/uploads/2016/08/fmachine-300x201.jpg";
Then, upload the code and wait for it to connect to your WiFi.
At this point, you’re ready to test locally. Assuming you’ve set up your WiFi details correctly, it should be accessible by visiting http://sextoydb.local/ in your browser. The buttons should be self-explanatory.
Although you’ve accessed the interface through a web browser and everything works, that .local URL will only work inside of your home – so you can’t give that out to someone to control over the internet. Which brings us to …
Setup Port Forwarding and Reserving an IP
Unfortunately, if you turn off your little sex toy web server between sessions, it’ll likely get a different IP address the next time you turn it on. To solve this, we need to use the IP address reservation function of your router, to say “every time this device turns on, give it this same IP”. Open up your router interface – you’ll probably need to Google your model number to find out exactly how to do this, since every router is different. Find the section relating to”address reservation”. On my Netgear router, it’s under Advanced -> Setup -> LAN Setup, and I need to click on Add. This displays a list of every device currently on the network. Find the one that starts ESP, and select it. Name it something you’ll recognise if you like, otherwise click Add. Now whenever it reconnects to the network, it’ll be given the same address.
Next, we need to tell your home router what to do when someone on the outside tries to visit your sex toy website. By default, web requests are blocked, as running a web server at home is a bit of security risk and not the kind of thing the average user needs to do. To open up ports, go back to your router config and look for the section on port forwarding. I found this under Advanced Setup -> Port Forwarding.
Add a new rule for HTTP service, and set the destination IP address as the one you just noted down as being reserved for the sex toy server. Set the port range as 80 – 80. Done, and you’ll probably be prompted to restart your router.
Finally, log into your NOIP.com account, or make register if you haven’t already. You should have chosen a hostname (that’s the URL you’ll use to access the toys) at sign up, already. If you signed up recently, it should just work – just go ahead and type in that URL, and you should see the same control interface pop up again, but this it’s accessible to anyone in the world that knows the address.
That’s all! Enjoy your new remote control toys, but be careful who you give the address to!
If nothing’s working, it’s possible your web provider is blocking web requests, and there’s not much you can do about that until I write some better code that bypasses all this fiddly stuff with IP addresses. Wait for that!
Since we’re really only adding a remote power switch, you can’t do anything complex like adjusting speed, or pressing an electronic switch that activates a toy after power is enabled. This will only work with toys that have a physical switch that can be left in the on position, then switched at the plug. Doing otherwise would involve manipulating AC currents, which isn’t safe.
That said, if you do know how to play with other electronics and have some hackable dildos, you should be able to modify the code to easy add remote control of them into the mix.
Since we’re essentially running a mini web server inside your home, this approach reveals your home IP address. Before you panic, understand that literally everything you do on the web reveals your home IP too. Just by visiting this website, your IP was logged by our webhost, somewhere. You can even ask Google what your IP is – it knows too. Ordinarily, this is not a security risk: at most it reveals your rough area, and your ISP. See what your IP reveals about you here.
However, if you live in an area where what you’re doing online is illegal, it is possible that local authorities would attempt to get your home address from the ISP. This requires a court order, and if you’re broadcasting yourself online, they could probably obtain the same details from your cam provider anyway. I’ve read reports of Comcast also being quite terrible at revealing customer information to anyone through social engineering, so be very careful if that’s your ISP.
Right now, the device runs a mini web server, which isn’t ideal. I’d like to add a layer of abstraction to that – a bridge that could be hosted here, simplifying the setup process for both those with toys and those controlling them. This would eliminate the need to setup port forwarding, and everything could be done through this website instead.