Rick & Morty Portal Gun (Arduino & 3D Printer Project)




About: Currently a Hardware Engineer at Frontier Silicon. I Graduated from The University of Kent with a MEng in Electronic & Communications Engineering.

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 - https://www.thingiverse.com/thing:2935246

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 'TM1637-1.1.0.zip'

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?!



    • Sensors Contest

      Sensors Contest
    • Classroom Science Contest

      Classroom Science Contest
    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest

    15 Discussions


    11 months ago

    Greetings from Los Alamos, New Mexico, USA. I made 2 of these as a demo for our makerspace! The first one was completely constructed, but the second one was deconstructed and had parts everywhere. I added a couple of UV leds under the green tube, and made a plasma ball with some hot glue! The glue lights up pretty good with the UV bulbs.

    Thanks Jack, for this projcet!!! This was the first thing I soldered in my life, I might have never learned with out this project!

    What ever you do with this portal gun, stay out of the Citadel.


    1 reply

    Reply 10 months ago

    Hi Jonathan, Awesome job and great idea with the UV lights they look great, I've ordered some to try out myself and some UV Reactive Green PLA samples for the plasma ball in the tube! Thanks for sharing your build and I'm glad you enjoyed it!



    Answer 11 months ago

    Hi, is it a 4 bit 7 segment display? you will need to follow another guide of how to configure it like this one to get there working https://create.arduino.cc/projecthub/SAnwandter1/programming-4-digit-7-segment-led-display-2d33f8

    The issue with doing this is that my code will not work, you would need to rewrite the display sections.

    I would advice either buying a cheap TM1637 IC and find a guide on setting that up or the better option would be to buy a TM1637 4 bit 7 segment display module like I used otherwise the wiring can get messy!


    Reply 11 months ago

    The TM1637 is ac IC that handles the 4 digit 7 segment display connctions, so that TM1637 chip connects to the 8 pins on the display itself. The chip drives the LEDs in the display based on simple I2C commands it recieves from the Arduino.

    This means that the Arduino only need to use 2 pins Rx and Tx instead of the 8 pins that the LCD Display needs. Also now that we are just sending standard I2C signals it makes it much easier to programme everything.

    Using modules like this is always easier especially when using a small microcontroller like an Arduino Nano, as it has very limited I/O.


    1 year ago

    Wonder if a persistance of vision display could be used to create a portal effect infront of it...

    1 reply

    Reply 1 year ago

    Hey, that is a possible solution I think although I don't know how bright this method would be. I'm quite interested in how the Funko Toy Ricks Portal Gun does it (seen here https://youtu.be/9eXw0bzWeRw?t=123). I think its just a High power LED behind a lens with the portal image on it which would be nice and simple. I'd be tempted to buy one to see how they did it if they were on sale.


    Question 1 year ago

    Will this work even if I am not a rick ?

    2 answers

    Answer 1 year ago

    Can confirm that yes it does work if you are not Rick!

    Unfortunately the real portals only work for Rick :)


    Question 1 year ago

    What's the green tube from? I see it as a toy of sorts in one of the images, but do not recognize it.

    1 answer

    1 year ago

    awesome I love it! it would be super cool if you could put an electrical discharge (like a plasma lamp) effect in the green tube.

    1 reply

    Reply 1 year ago

    Hi Jamie, Actually that's a really good idea I did plan to do something like that initially but totally forgot about it. I might have a look at modelling something tonight and possibly try printing it in either Green or Natural PLA not sure what would work best