Skip to content

Instantly share code, notes, and snippets.

@lukevc
Last active August 30, 2023 15:42
Show Gist options
  • Save lukevc/eb2fa7e6b11c3925a381151b80ca5b14 to your computer and use it in GitHub Desktop.
Save lukevc/eb2fa7e6b11c3925a381151b80ca5b14 to your computer and use it in GitHub Desktop.
Raspberry Pi and 3D printer integration project

About

This is an upload of an old project log that detailed my research and development.

Project

The goal of this project was to modify a cheap 3D printer with a Raspberry Pi Zero 2 W to be able to remotely access the printer.

Log

22nd January

Installed Raspbian to 16gb memory card using Raspberry Pi imager (instead of tools like etcher) - press ctrl + shift + x for 'secret' menu that allows you to do advanced setup (Wi-Fi, RPI name and password, enable SSH) without needing to drag and drop custom text files

Download Putty SSH client (Don't need putty anymore just SSH from windows) - ssh root@ip-address

Once the card is formatted, put it in the pi and plug it in

connect to RPI IP using putty - to get the IP address either look it up on your router home page (what I did) - plug your pi into screen and laptop and type ifconfig into terminal your IP is the wlan0 INET ADDR

update raspberry pi with sudo apt-get update then sudo apt-get upgrade

use sudo raspi-config to bring up configuration menu if required ~ enable VNC and camera in the interface menu

The default VNC that comes with the pi didn't work for some reason and just hung

so I sudo apt-get install tightvncserver xrdp, windows remote desktop worked after this

realised that I need an OS on Raspberry Pi Imager that ships Octoprint out of the box. Repeating previous steps.

Octoprint image does not come with a desktop environment because it does not need one, however one can be install via sudo /home/pi/scripts/install-desktop


23rd January

Small bit of research


24th January

Wired up the buck converter to the power supply of the 3D printer by unscrewing it and connecting wires to the spare V+ and V-. Tested using a multi meter and it is delivering 24V -> 5V, which is good as it will not obliterate my pi.

3D printing case for the buck converter that will attach to the aluminium extrusion of the printer. ~ again not the correct size.

Pi successfully powered through the buck converter. First wireless test print ~ success


25th January

Learnt that I do not have enough amps to power the LEDs from raspberry pi. A 1 meter LED strip of 30 LEDs will most likely need 18A of power. P=V*A
Will need two buck converters running off the PSU. [[Post on relationship between Voltage, Current, Resistance and Power|very informative post by so user]]

Arduino pulls 500mA to 800mA (old post from '09 may be inaccurate now) Raspberry Pi pulls 1.2A Buck converters convert into 5V 2A LEDs require high current

![[20220126_011318867_iOS 1.jpg]]


1st February

Tried to solder header pins onto raspberry pi. Getting frustrated because it was not working.


5th February

Tried again with the soldering after a break. Turns out I was using fake Chinese solder. Used my 0.3mm solder instead and it was working better, but a bit awkward to handle.

Soldered wires to the LEDs and connected buck converter to power supply ready to be connected to the LED strip. Last thing I need to do is connect the raspberry pi GPIO ground pin to common ground.


9th February

Soldering done. Testing system. Following tutorial rpi_ws281x library no longer has python libraries have to install with pip install rpi_ws281x pip is not working on Pi for some reason had to purge python and reinstall with pip using sudo apt-get purge python python3 python-pip python3-pip sudo apt autoremove sudo apt-get install python python3 python-pip python3-pip also error with the tutorial is you need to CREATE file sudo nano /etc/modprobe.d/snd-blacklist.conf not 'edit it' blacklist snd_bcm2835 add to new file

added LED python script on terminal start using: sudo nano /home/pi/.bashrc and then adding to the bottom: sudo python3 /home/pi/LED.py issue with this is that I had to run putty terminal and then enter sudo password to switch on LEDs

Instead I used: sudo crontab -e then at the bottom of the script added: @reboot sudo python3 /home/pi/LED.py This activates the LEDs on start-up can also make folder for scripts on start-up @reboot sudo python3 /home/pi/startup_scripts/*.py

Script works perfectly, marks project completion.


Project complete

  • 09/02/202x
  • 18 days to complete
  • In future log estimated time of each activity

Further work/research:

Summary

Using a Raspberry Pi Zero 2 W to be able access my 3D remotely

Connected 2 x 5V2A buck converters to the 3D printers 24V power supply powering: RPI with octoprint and individually addressable LEDs.

RPI is connected to the LEDs via GPIO so I can write code to control the lights by SSH into the Pi Remotely

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment