Project tutorial
3D-Printed Prank Vibrating Cup

3D-Printed Prank Vibrating Cup © GPL3+

The instant your prankee lifts up this 3D-printed cup it starts violently vibrating! The electronics separate from the cup for easy washing.

  • 20 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
09507 01
Soldering iron (generic)

Apps and online services

About this project

April Fools' may be over, but hilarious pranks can happen at any time.

Picture the following: you have an nice white cup in front of you. It's filled to the brim with sparkling, cool, and refreshing H20. Your fingers curl around the nicely curved handle, and you bring the cup to your lips. Suddenly, a strong vibration assaults the nerves in your hand, causing you to drop the cup and spill water all over every surrounding surface, including yourself. This might not sound too fun for the participant, but I can personally guarantee you that it will elicit much more than a chuckle from any bystanders. Let's get started making it!

Step One: Print it!

In the attachments section of this build are two .stl files: base.stl and cup.stl. You're going to have to print both of these out on some type of 3D printer. I have had success with higher infills and small layer heights to maintain the waterproofness of the mug, but you can experiment. Infills around 50% or above give the cup a nice solid feel as well. To print it out really quickly but have some leaks you can use about 20% infill and a layer height of 0.3mm. Don't use any supports!

Note the orientation of the parts in the screenshot above - this is how they should be printed. The attached files may not default to this.

The reason the mug is in two pieces is so that the electronics can be removed, allowing you to wash it.

Step Two: The Circuit Board

Now you're going to need to construct the circuit that makes this whole thing fun. It's actually pretty simple! The way the cup detects if it's picked up is by measuring ambient light. When there's a sudden spike in light, it's safe to assume that the mug has been lifted, and the motors should start vibrating! This light measuring is done through a phototransistor. The motors are driven using small transistors as switches. They are pretty small, so there's not really any need for a dedicated motor driver chip or circuit; the transistors will do quite nicely. Just don't connect the motors directly to the pins on your microcontroller!

I personally like perma-proto boards from Adafruit, but if you like building things on perf boards you can do that too. Just make sure that your perf board can fit in the cylindrical cutout in the base of the cup! The circuit above shouldn't take more than an hour and a half to build if you have some experience with electronics. Replace the 3xAA power pack in the breadboard layout shown above with any 3.7V LiPoly battery, and the motors shown should be of the small DC vibrating motor variety. If you want, you can also add in a switch to turn the circuit off and on.

If you're using a quarter-size perma-proto board with default sizing on the 3D files the corners of the board will need to be snipped off to make it fit.

Step Three: Programming the ATtiny85

Before you put the ATtiny85 in the socket you can program it. Instructions can be found here: If you need to reprogram the ATtiny just make sure you're careful when you pull it out of the socket.

The code may need some slight modifications in order to get it to work. All photoresistors are slightly different, as are ambient light levels. Try adjusting the threshold variable in my sketch to experiment with different results.

Step Three: Putting It All Together!

My video at the top describes how you can go about putting the whole thing together. It's important that the base fits really snugly with the rest of the cup, and that the vibration motors are securely attached to the base. Otherwise, the vibrations won't be able to travel throughout the cup.

Whenever you want to wash the cup, simply slide off the base and give it a wash. It might initially seem like having a cup full of liquid with electronics under it might not be the smartest plan. However, I've noticed that the electronics actually stay remarkably dry even if the cup gets tipped over.

Step Four: Going Further!

I have included a Fusion archive of my design, so if you have Fusion you can open it up and modify my design to suit your needs. A fun change might be extruding some text out of the bottom of the cup.


//Written by Alex Wulff -
#define LIGHT_PIN   3
#define VIB_ONE     0
#define VIB_TWO     1
#define THRESHOLD   500

void setup() {
  pinMode(VIB_ONE, OUTPUT);
  pinMode(VIB_TWO, OUTPUT);

void loop() {
  if (analogRead(LIGHT_PIN) > THRESHOLD) {
    digitalWrite(VIB_ONE, HIGH);
    digitalWrite(VIB_TWO, HIGH);

  else {
    digitalWrite(VIB_ONE, LOW);
    digitalWrite(VIB_TWO, LOW);

Custom parts and enclosures

Fusion Archive
This is a Fusion 360 project archive that you should be able to edit in Fusion 360.



Similar projects you might like

3D-Printed RGB Wallet

Project tutorial by Alex Wulff

  • 8 respects

3D-Printed Nanoleaf ATtiny85

Project tutorial by Arnov Sharma

  • 10 respects

The Annoy-O-Bug: A Chirping Light-Up Throwie

Project tutorial by Alex Wulff

  • 54 respects

3D-Printed Jet Turbine

Project tutorial by Arnov Sharma

  • 43 respects

PIR Sensor Activated Halloween Scare Prank

Project tutorial by Kristian Blåsol

  • 15 respects

3D-Printed Arduino Obstacle Avoiding Robot

Project tutorial by Arnov Sharma

  • 3 respects
Add projectSign up / Login