Skip to content
A box that prints poetry on demand with a thermal receipt printer
Python CSS JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Poetry Box

Poetry Box

Poetry Box prints a random poem from the Poetry Foundation. Running on a Raspberry Pi, Poetry Box scrapes poems from the Poetry Foundation website with a Python script and stores them in MongoDB. When the user pushes the glowing white button, Poetry Box prints these poems with a Epson thermal receipt printer.

Required Hardware

  • Raspberry Pi 2 (or 3)
  • A Button with LED
  • Epson Thermal Reciept Printer (such as the TM-T88V)

Required Software


  • Run NOTE: This project is intended for educational and personal use only. All poems scraped from the Poetry Foundation website are subject to copyright law. As such, I will not be updating the scraper file, which no longer works with the Poetry Foundation website.

  • Edit to reflect the pins you have chosen for your button and LED.

  • Add to your Pi's startup processes

  • Run


Further Thoughts

The main problem with the current setup is that MongoDB creates a lock file if the Raspberry Pi is not shutdown properly. In general this means if the Poetry Box loses power (via being unplugged) the device must be disassembled and the lock file manually removed. As of right now you can power down Poetry Box safely by holding down the button for a few seconds. However future iterations will most likely employ a different database.

You can’t perform that action at this time.