Giter VIP home page Giter VIP logo

421_521_final_project's Introduction

Kenny Toastman and Andrew Crusty present: LaserToasterino

This is toast.

This repository contains source code, CAD files, course deliverables, and instructions to create a laser toaster using a slew of microcontrollers. This is our final project for BIOE 421 at Rice University, taught by Dr. Jordan Miller and trusty assistant Dan Sazer.

Table of Contents

  1. [Abstract] (#abstract)
  2. [Use Flowchart] (#flowchart)
  3. [Software Approach] (#software)
  4. [Hardware Approach] (#hardware)
  5. [Brainstorming] (#brainstorming)
  6. [Safety] (#safety)
### Abstract Technological breakthroughs in the last decade have significantly altered the way we experience our everyday lives, from smartphones, smart TV's, and even IoT products like thermostats. One aspect of our lives, though, has not seen any improvements coming from technology for many decades-- toast. The goal of this project is to thrust the breakfast experience into the 21st century. We will create a device that allows you to wake up to a perfect piece of personalized toast. Laser etching will be used to burn images, a daily agenda, an inspirational quote, or the day’s headlines right onto a piece of bread. The device can be used immediately on command, or can be scheduled to have your perfect toast ready for you, right when you wake up. The image to be printed could be a selfie (or other inferior photo) that you upload or content from the Internet, allowing for an entirely customizeable breakfast.

The device will be comprised of a laser, an enclosure with controls, and a Raspberry Pi retrofitted onto an old 3D printer. Stepper motors will control the position of the laser along the toast, and the power of the laser will be modulated at each point to create different toasting patterns. Software will be developed to combine photos, Web-scraped text, and more into a grayscale image to be burned on the toast, and it will then generate G-code for printing. This project will aim to recreate the toaster experience using an Arduino to control the knobs, dings, and doors that we’ve all grown to love.

### Use Flowchart This flowchart shows the processes and decisions that are made to output the admittedly scrumptious final product. ![Flowchart](https://raw.githubusercontent.com/ase1/421_521_final_project/master/resources/flowchart.png "Flowchart showing use cases.") ### Software Approach The three main facets of the software are controlling the motors/laser, generating and processing images for toasting into G-code, and displaying a graphical user interface to allow the user to select what they want on their toast.

The GUI is the central hub of the software, connecting all of the pieces together. It runs in the Processing Development Environment, and monitors the touchscreen for button presses and acts accordingly. Each button is hardcoded because we didn't want to waste time making something fancy - we just need something that works. The GUI was laid out in Microsoft PowerPoint, then the layout was transferred over to Processing by determining all of the button sizes and locations. Screenshots of the GUI (running on a separate computer) are below:

GUI1 GUI2 GUI3

The GUI forces the user to follow the steps on the flowchart above, first prompting the user to either choose to toast from image or data, then prompting the user to select the specific pattern to toast. The user can either take an image using the Raspberry Pi camera, or use an existing file by navigating through the file browser. The toast from data option grabs the latest tweets from Twitter based on the selection, and formats the text as an image. The user then opts to immediately send the image to the toaster for processing and toasting, or to wait until the specified time.

Each button press runs a bunch of scripts. We're using the launch() function in Processing, and launching .desktop files that run bash scripts that either run terminal functions or Python scripts. It's a really roundabout way of doing things, but it's the way we've been able to make Processing work for us. Variables for other scripts (like the image path, scheduled time, or status of the emergency stop button) are stored in dedicated text files. We chose to use Processing for the GUI environment because we want to integrate Arduino StandardFirmata and also want to make an attractive layout for the touchscreen.

Once a user is ready to make his toast, he initiates a printing sequence by selecting the "Toast Now" button on the GUI. This actuates a series of steps that lead to printing, all executed in Python:

  1. Image Processing:
  • Image resized to 128 x 128 pixels, which are the dimensions of the print (these numbers could change based on testing)
  • Image recolored to grayscale with lighter colors corresponding to darker pixels
    • This is so that lighter images will be more toasted
    • RGB values are converted to grayscale using a weighted average formula: I = .299[R] + .587[G] + .114[B]
  • Grayscale values are scaled to a power level 0-255, corresponding to the PWM range of the RAMBo Fan MOSFET output
    • Scaling is also based on the user's deisred toast power level (provided through the potentionmeter knob and Arduino)
  1. Automatic G-Code Generation:
  • Based on the printer's print-area coordinates, the code generates a path for the laser head that covers each pixel in the image
  • At each pixel, the laser intensity changes corresponding to the intensity at that pixel
  • At the end of the print, the platform returns the toast to the user.
  • The G-Code is generated and saved as a .gcode file
  1. Communicating with the Printer:
  • We use Printcore, a software developed by Printrun (same group that makes Pronterface, Pronsole), to communicate with our RAMBo board.
    • Printcore is developed in Python and includes a module of commands that allow a user to interact with a printer
  • Connect with the printer through Serial Port, send over the G Code, and initiate print.
  • For safety, we also added the capability for a user to cancel the print mid-print, using the red "X" button in the GUI
### Hardware Approach We have an old 3D printer, inherited from legendary Rice alum Ravi Sheth. We're using this as the base of our project since it already has the dimensional movement that our plotter will require. We want to take apart the printer, remove unnecessary components, and reassemble it inside of an enclosure. We need to install a couple of Arduino-controllable actuators to put some polish on the experience. For EHS reasons, we aren't allowed to use a laser powerful enough to cause blindness, so as a proof of concept, we'll mount a 5mW laser on the machine and test using photographic paper.

The modified 3D printer hardware was modelled in SolidWorks, and the enclosure was created around it. The enclosure is made of plywood, which is fine for now because the laser isn't powerful enough to burn through it. It was made in the OEDK woodshop, and the display panel was ironically cut using a lasercutter. For the interface with the user, we're using a Raspberry Pi touchscreen display and a couple buttons and knobs for tactile control. A sliding door will shield the user from the laser during operation.

rendering

On the electrical side, we'll be using three boards for this project: a Raspberry Pi, a RAMBo motherboard, and an Arduino Uno. We had a bunch of problems hooking up the laser to the RAMBo; the idea was to control the intensity using the 12V PWM slot for cooling fans, but the fuses on the board kept burning out when our 5V lasers were connnected. We made a linear voltage regulator circuit to control the input voltage to the laser diode, and it seems to be more stable now. Both the Arduino and the RAMBo communicate with the Raspberry Pi using a serial connection. The Pi connects directly to the touchscreen and uses that as the only display. Ideally, the keyboard and mouse will be unnecessary to run the printer.

### Brainstorming We spent the weekend coming up with ideas, and the crowd favorite is a toast printer. You've seen Jesus toast, and we want to take that one step further. Imagine waking up, checking your calendar, reading the newspaper, and ravenously scrounging for something to eat in the morning. Our idea proposes to combine early morning activities using a toaster with a controllable toast pattern. We're considering creating an appliance that internally works like a laser etcher, with the functions of a toaster. We have a non-working 3D printer that we're willing to scavenge for parts. We plan to design the hardware and software experience. Software for generating G-code for laser etching already exists, so we'd probably implement that and focus our efforts on image processing, content production, and hardware control.
  • Sensors:

    • Check if bread is on the plate
    • Check door status (open/closed)
    • Check power level dial
    • Button for start
    • Laser temperature
  • Actuators:

    • Emergency stop button
    • Eject button (might be fun to have this under a plastic shield)
    • Must include spring actuation and self-deployed toast parachute
    • Move platform
    • Open/close door
    • Ring bell when complete
    • Laser ventilation
    • Alarm clock function that wakes you up to fresh toast
  • If we have time (we won’t have time):

    • Toast flipper
    • Camera on toast (timelapse?) (Twitter?)
    • Butter melter and liquid butter spreader
    • Photo booth
  • Create lasercutter functionality - hardware
    • Disassemble printer
    • Buy parts
    • Figure out power requirements
    • Safety measures
    • Control
  • Data grabbing from the internet
    • Date
    • Inspirational quotes
    • News
    • Notifications
  • Compile into an image for image processing
    • Image processing (see this: http://nebarnix.com/img2gco/)
    • Take existing image and convert to grayscale
    • Create an array of laser voltages per pixel
      • We can just always go line-by-line if that’s easier
    • Send to laser cutter
    • Arduino stuff
### Safety (for a device with a full-powered laser) We can break safety concerns down to three categories: health, fire, and electrical.

Health. The most threatening safety concern is health - pointing a laser at a person for too long could cause blindness or burns. The easiest countermeasure is to buy the lowest-powered laser that will still accomplish our goal. We're ready to do some testing on Thursday using the OEDK laser cutter to see what powers we realistically need for etching the toast, but online research has shown that we won't need more than 1-2 W. For testing, we'll want to modulate that power down to the mW range (typical laser pointers are 5-10 mW) so we can see what we're doing but aren't creating any threat. The final device will have a door that seals the inside off from the outside, so there can be no leakage of light. We can make this door into a physical switch, so the laser can't receive power unless this door is closed. For testing, we'll also have to get some laser safety glasses, which depend on the wavelength of light produced by the laser.

Fire. Another big one, also mostly solved by choosing the right laser. We want to do some testing on the laser that we eventually choose, but if need be, we can solder on a heatsink and provide forced convection with a fan. I don't expect there to be too much smoke produced, since normal toasters don't produce an unreasonable amount of smoke and we plan to only etch the surface of the toast. We want to make the enclosure out of think aluminum or 1/4" wood - the laser shouldn't be high-powered enough to penetrate or ignite either of these.

Electrical. Good insulation practices should resolve any concerns.

421_521_final_project's People

Contributors

kennygrosz avatar ase1 avatar

Stargazers

 avatar

Watchers

Jordan Miller avatar  avatar  avatar

Forkers

kennygrosz

421_521_final_project's Issues

things we still need to implement, 15 November 2016

  • get the laser diode working
  • control the RAMBo automatically
  • arduino components: door, bell, power knob
  • figure out how to stop print mid-print
  • interface while the toast is toasting - is it always a fixed time? --kinda
  • scheduling the toaster
  • weather integration
  • calibrate size of print, home position, etc
  • mark printing area on platform
  • mount the hardware in the enclosure
  • trim the screw in the printer
  • integrate automatic printing with processing
  • permanently mount boards + power supply + screen (rip)
  • fix homing issues
  • fix x-min endstop (borrow endstop from new rambo????????)
  • mount laser
  • control keystrokes to make scripts "execute" without user intervention
  • paint exterior

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.