Raspberry pi 3d printer camera


How to control your 3D printer using OctoPrint and Raspberry Pi

All tutorials

Control and manage your 3D printer and more using OctoPrint and Raspberry Pi. Here’s everything you need to know to get started!


What you’ll need:

  • Raspberry Pi
  • Suitable power supply (depending on model of Raspberry Pi — see Choosing the right Raspberry Pi below)
  • microSD card (we recommend a minimum storage size of 8GB. If you plan to use a camera and save timelapse recordings of your prints, you’ll need a larger capacity card)
  • SD card adapter
  • USB cable (this will depend on your printer)
  • Raspberry Pi camera or USB webcam (optional)
For the initial SD card setup, you’ll also need:

Another computer connected to your network. We’ll refer to this as “your usual computer”, to distinguish it from the Raspberry Pi computer that you are setting up for retro gaming.

Choosing the right Raspberry Pi and accessories

While older Raspberry Pi devices are supported by OctoPrint, we’ll be using a 2GB Raspberry Pi 4 for our tutorial, because this will give you a faster, smoother experience. With this model you will need a USB-C power supply. If you plan to use an older model, you’ll need a micro USB power supply instead.


Installing OctoPi

We’re going to use an application called Raspberry Pi Imager to write Raspberry Pi OS to our microSD card. Raspberry Pi Imager is available for free for Windows, macOS, Ubuntu for x86, and Raspberry Pi OS. You can download it to your usual computer here.

Open Raspberry Pi Imager and connect your microSD card to your usual computer using a microSD card adapter. Now we can go ahead and install OctoPi to the SD card. In Raspberry Pi Imager:

CHOOSE OS: Select Other specific purpose OS, followed by 3D printing.

Next, select OctoPi, then OctoPi (stable).

Open the advanced menu: select the cogwheel icon in the bottom right corner.

Enable SSH: check the Enable SSH box and set a username and strong memorable password.

Configure wifi: enter the SSID of your network and its password, then select Save to close the advanced menu.

CHOOSE STORAGE: select your microSD card.

WRITE: lastly, click to write OctoPi to your microSD card.


Set up your Raspberry Pi

Once your microSD card is ready, insert it into your Raspberry Pi. Next, connect your 3D printer using your USB cable. The type of 3D printer you have will determine what type of USB cable you need. For this tutorial, we’re using an Ender 5, which requires a USB-A-to-mini-USB cable.

Lastly, connect the USB-C power supply to your Raspberry Pi.


Set up OctoPrint

Open a web browser on any computer connected to the same local network as your Raspberry Pi, and type http://octopi.local into the address bar. This will allow you to set up OctoPrint. Follow the on-screen instructions to set up OctoPrint and enter details of your 3D printer. Once complete, OctoPrint will restart and you’ll be able to get printing by following the on-screen instructions.

You can access OctoPrint at any time by visiting http://octopi.local on a computer or mobile device that is connected to the same network as your Raspberry Pi.

Optional: add a camera

Add a Raspberry Pi camera or a USB webcam to your Raspberry Pi to allow you to keep an eye on your model as it prints.

To do this, unplug your Raspberry Pi from the power supply, and connect your Raspberry Pi camera or webcam.

Reconnect the power supply and open OctoPrint by going to http://octopi.local.

Next, go into OctoPrint settings by clicking the wrench icon at the top, and select Webcam & Timelapse under FEATURES.

Here, you can click the Test button to make sure your camera is working properly and make any necessary changes, such as altering aspect ratio and rotation.

You can also enable timelapse recordings of your prints and save them to your Raspberry Pi.

You can view your camera settings under Control on the main OctoPrint dashboard.


Using OctoPrint

OctoPrint offers an easy-to-use dashboard that most users will be able to navigate quickly. More advanced users, and those interested in expanding their 3D printing experience may want to look into the vast array of third-party plugins managed by its wide community of users. You can find them in the OctoPrint Settings menu.

OctoPrint is a free-to-download open-source web interface created and maintained by Gina Häußge. If you would like to support OctoPrint, you can make a contribution via their website.


Learn more about 3D printing with HackSpace magazine

Would you like to learn more about 3D printing? HackSpace is a monthly magazine for creative people, and it provides a wealth of 3D-printing tips and tricks, along with news, reviews, interviews and tutorials for every kind of making and crafting you can think of. You can download HackSpace for free here, or buy it in print from your favourite supermarket or newsagent, as well as from the Raspberry Pi Press store.

For a taste of what to expect from HackSpace, here’s their video all about 3D printing infill patterns.


Help and support

More help and information on OctoPrint is available from their website and forums.

Arducam 5MP OV5647 Autofocus Camera for Monitoring 3D Printer, 3.28FT/100CM Long Extension Flex Ribbon Cable for Raspberry Pi

Buy Now

 

  • Convenience: Native to Raspberry Pi 4/3B+/3 and more, and Arducam has solved the problems with the installation and setup on OctoPi
  • Motorized Focus: See closer and easier than the fixed focus lens, which is better to monitor the 3D printer nozzle and make you pay close attention to your creation
  • Focus Controllable: Using the OctoPrint Control tab, which utilizes custom commands from your slicer to adjust focus while printing
  • Long Extension: 100cm/3. 28ft extension cable included, especially useful when you don’t want to place the camera near the Raspberry Pi

SKU: B0176R Categories: 5MP OV5647 Cameras, Cameras for Raspberry Pi, Native Raspberry Pi Cameras - 5MP/8MP/12MP

SKU: B0176R Categories: 5MP OV5647 Cameras, Cameras for Raspberry Pi, Native Raspberry Pi Cameras - 5MP/8MP/12MP

  • Description

Overview

Most 3D models take more than a few hours to print, so you may wish to leave the 3D printer at some point in the printing process. Using an Arducam camera to monitor 3D printing can make you pay close attention to your creation. Since most cameras are not made specifically for the use of 3D printing software, it is impossible to obtain proper support from the manufacturer. Fortunately, Arducam can help you solve all installation and setup problems.

For more details, please refer to our Doc page: https://www.arducam.com/docs/cameras-for-raspberry-pi/native-raspberry-pi-cameras/how-to-use-arducam-motorized-focus-camera-with-octopi-to-monitor-3d-printers/

Applications

  • IoT cameras
  • OctoPrint, Monitoring 3D Printer
  • Robot cameras
  • Wildlife cameras
  • Other battery-powered products
  • Can be used in MCU, Raspberry Pi, ARM, DSP, FPGA platforms

    Specifications

    SensorOmnivision OV5647 sensor
    Sensor size1/4” (OV5647)
    Resolution5MP 2592×1944
    Video1080p 30 fps, 720p 60fps, 480p 90fps
    Field of View (FOV)54°(H), 44°(V)
    Focus TypeMotorized Focus
    Focus Distance2” to infinity
    IR SensitivityIntegral IR filter, visible light only
    Full-frame SLR lens equivalent35 mm
    Dimension25mm×24 mm
    Peak Current300mA

    Package Including

    • 1×5MP OV5647 camera board with motorized lens for Raspberry Pi
    • 1 set acrylic case for the camera module
    • 1×5. 9″(15cm) flex ribbon cable for Raspberry Pi Model A&B series (Pi Zero cable not included)
    • 1×39.4″(100cm) flex ribbon cable for Raspberry Pi Model A&B series (Pi Zero cable not included)
    • 3×Manuals

    Note

    • Raspberry Pi Board is not included in the package
    • The camera’s autofocus function needs to be operated by using python scripts, etc. Please see the following documentation for detail
    • Contact [email protected] for customization and [email protected] for support

    Documentation

    Manual

    User guide video

    Video

    Making a time lapse for a 3D printer using Raspberry Pi

    A time lapse is a video made from a series of pictures taken at a certain interval over a long period of time.

    In this example, we will make a time-lapse that will take pictures of not after a time interval, but by events such as: pressing a button, triggering a limit switch, triggering a sensor, etc. In our case, it will be digital line sensor and we will make a time lapse for a 3D printer. In order for this example to work, it is necessary to add to the gcode file for printing the coordinates of "retracting" the printer head after each layer to a given coordinate, where the line sensor will be attached. To do this, you can use our g-code modifier. Before proceeding with this guide, you need to set up your Raspberry Pi according to this guide. nine0008

    We need:

    • Raspberry Pi Zero W;
    • Raspberry Pi Camera;
    • Camera cable for Raspberry Pi Zero;
    • Trema-module Digital Line Sensor;
    • PC running Windows, MacOS or GNU/Linux;
    • Putty;
    • Bonjour Print Services.

    A Windows, GNU/Linux or MacOS computer is required to connect to the Raspberry Pi. We will use ssh to connect. Computers running GNU/Linux and MacOS must have the openssh package, for Windows you can use Putty, Cygwin, Windows Terminal, Termius, etc. In our example, we will use a Windows PC and the PuTTY remote connection manager. nine0008

    Also, starting with Windows 10 october 2018 update, Microsoft did something with the mDNS server, and in order to detect Raspberry not by IP address, but by name, you need to install mDNS. We'll be using Apple's lightest (ironic), Bonjour Print Services for Windows v2.0.2. You can download it here.

    Connection:

    To connect the camera, you need to carefully pull the black latch to the stop away from the printed circuit board in the plane of the printed circuit board on the camera connector, insert the camera cable with contacts to the printed circuit board and close the latch:

    Next, we will solder a block of three pins to the GND, GPIO23, GPIO24 pins, connect the line sensor to it and prepare a USB cable for connecting to the power supply: