Introduction: Rick and Morty Portal Gun (Arduino and 3D Printer Project)

About: I’m a dependable and passionate engineer with 6 years of experience working on a wide range of projects across multiple industries from Medical to industrial at all stages of the development cycle. Time and ti…

Welcome to my first big 3D print project!

Sneak Peak of end result!

This Instructables will explain all the steps you will need to flow to build yourself a working portal gun like Ricks! for roughly £35!

Hope you enjoy & lets begin!

Step 1: Project Proposal

As a massive Rick and Morty fan I really want a Portal Gun of my own, having looked about the current existing projects I thought I could add some extra features!

Key Goals

Have a Working (Visually anyway, still a ways of a real portal gun) Ricks Portal Gun this will include,

  1. Working 4 Digit Seven Segment Display in Red
  2. The display must be able to cycle through infinite dimensions and the key ones from the show!
  3. Must be able to fire the portal gun causing front panel to light up indicating portal generation!
  4. Portal Tube must be lit
  5. Needs a self destruct button hidden in the handle!
  6. Some way of charging the gun without disabling the device
  7. Must look like the portal gun!

I've planned out a simple system flow diagram for how I think the device should work

Step 2: BOM

Lets discuss the the electronics and materials required for this project, to achieve the proposed system flow diagram the following components will be required.

The estimated cost of this projects components would be £35.17 to buy all the parts out right,

The cost of all the components used in one of these projects would be approximately £24.77

*Note that this does not include the cost of the 3D printer material used!


Arduino Nano V3 - £3.60

4 Bits TM1637 Digital Tube LED Display Module - £0.99

Rotary Encoder Module KY-040 - £1.56

Momentary Tactile Push Button - £1.25

PCB Slide Switch DPDT On-Off-On - £8.14 **** (This part is not only option any Vertical Slide On - Off Switch could be used)

TP4056 Lithium Battery Charging Module - £2.40

180Ω & 1kΩ Resistors (Just buy a set of resistors) - £5.66

Green 10mm Diffused LEDs - £1.69

3.7V 1600mAh Lipo Li-polymer Rechargeable Battery - £7.50

M3 8mm Countersunk Screws - £1.39

3D Parts

If you don't want to paint your parts you will want to get some White & Black PLA to print all the required model parts.

For this project I used,

Flashforge® PLA 3D Printing Filament 1.75mm 1KG White - £17.00

AMZ3D 1.75mm Black PLA 3D Printer Filament - 1kg Spool - £16.99

of course the other option is to print the parts in any materials you currently have and then post process the parts

Step 3: 3D Printed Parts

The 3D print models can all be found on Thingiverse here -

To design this model I used Fusion 360, I tried to find as many screen shots of the gun from the show as possible and tried to recreate the gun with consideration for all of the electronics.

The parts have all been designed with a 0.4mm tolerance to compensate for any 3D print inaccuracies (This is based on my experience with my printer)

Note* You may still want to file back some of the joins e.g the LED cutouts.

The parts are named with the colour they need to be printed in,

  • 'B_' = Black Part
  • 'W_' = White Part

The only 2 parts that require supports are the

  1. W_HiddenDoor_v4.stl
  2. W_Handle2 SinglePartSecretDoor.stl

All other parts do not require supports or rafts.

For the portal gun tube I have used a Bubble Sword toy which had a diameter of roughly 27mm this is what the current 3D model has been designed for. If you have issues finding a similar part I can modify the .stl if you let me know what you need it changed to!

Step 4: Electronics

Now time to put together the circuit diagram!

I've used Fritzing to plan the circuit diagram which is a really awesome free bit of software for these types of project.

The setup shown in the attached image will allow for the Arduino to control the TM1637 Display and update it when the user inputs on either the Rotary Encoder Module or the Momentary Tactile Push Button.

The battery is connected through the TP4056 which allows for Micro USB charging, this then connects to the MT3608 which stets up the 3v7 to 5v for the Arduino Nano Vin. The Latching slide switch is connected through this 5v connection to use as an On/Off switch. While in this configuration the battery can still be charged while the device is powered down.

The 2 LEDs for the tube are always powered up & the 3 LEDs for the front panel are connected to a Do pin of the Arduino so they can be triggered when the Rotary Encoder is pressed.

Step 5: Code

The code for this project was pretty simple,

For this code to work you will need the attached library ''

This is far from an optimal code but it seems to work for me!

(Code shown below but it would be better to download the .ino rather than copy and paste)

Step 6: Assembly

Once I assembled and tested the electronics it was time to put together the entire gun!

I used a small pin to hold the secret hinge door, a header / small bit of wire / paper clip should work as well.

Once assembled its time to test it out!

Final Test

Step 7: Conclusion

I'm really happy with how this project came out and hope you guys enjoyed,

If you get around to making your own please send me photos, I would love to see how it worked out for everyone!

If you have any questions or issues please comment and I will try to help as best I can

Future Work

  1. I plan to add audio to the device soon using a ISD1820 chip and a small speaker, this will play the audio bite and I may also find a self destruct noise
  2. Maybe an Evil Rick Portal Gun Variant?!