READ N TRY

Roman's website about chip carving, whittling, and woodturning

DIY Printer Button

When you need a blank sheet of paper, how do you get one?

Now I can get a sheet of paper from my paper storage box with the press of a button. The real challenge was realizing there was this first-world problem; solving it was easy.

DIY Printer Button

Since opening a tray to get a sheet of paper isn’t very convenient, I wish all printers had this feature built in. I mean, all paper storage boxes should dispense paper on demand out of the box. 🙂

See the magic button in action:

I used a Raspberry Pi, a push button and a Python script to make that little life hack. The script prints an empty file every time the button is pressed:

import RPi.GPIO as GPIO
import time
import os

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)

while True:
  input_state = GPIO.input(18)
  if input_state == False:
    print('Button Pressed')
    os.system("echo | lp")
  time.sleep(0.4)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *