Roasting beans in a repurposed air popper

User Interface

The interface for controlling the roaster was developed with Django [9], a Python-based framework for designing web pages. The background, temperature gauge, temperature digits, timer digits, and power light are all images (Figure 11). The dial on the temperature gauge rotates in 5° increments to create images that correspond to different temperatures. Almost 100 images comprise the control panel, so to avoid latency during the roast, the code disables the roaster controls until all images have been downloaded to the web page.

Figure 11: The user interface is a web page showing the roasting controls and state of the system. This image shows a roast in progress.

Django comes with its own web server, which is designed to be used during development. It typically is not used for public websites, because it is not fast enough to handle the load of millions of users requesting a web page. However, because I am typically the only user connecting to the roasting web page, I used the development server.

The web page, running on the laptop, polls the web server on the Rasp Pi every second for the most recent state. The web server, running on the Rasp Pi, responds with the most recent mode, roaster temperature, set temperature, and notes. The web page updates the display elements with the latest state information. The operator uses the web interface to change the mode, temperature, or notes. When such a change is made, the web page sends the new setting to the web server on the Rasp Pi. The change is reflected on the web page after the next polling interval when the most recent data is retrieved from the web server. All roast data is saved on the Rasp Pi so it can be viewed at a later date.


Many roasts have been performed with ELF, which allows much better control over the roasting process than repeatedly plugging and unplugging the popper. If a particular roast produces excellent coffee, I have the details in a log, so I can reproduce the process in the future. Improvements are still being made to ELF; for example, I'm currently working on developing my own charting module in JavaScript, the programming language for web browsers. With the new module, I will be able to add markers during the roast to identify certain roast events. I'll also rewrite the temperature gauge to use just one image each for the background and the dial, greatly reducing the number of images that have to be downloaded. The dial image will rotate on top of the gauge background to indicate the temperature, allowing the dial to operate in finer increments and move more smoothly during temperature changes. I'll use JavaScript to implement this functionality as well.

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • GPIO Pinout – Rasp Pi 1 Model B+/Rasp Pi 2 Model B

    40-pin GPIO

  • GPIO Pinout – Rasp Pi 1 Rev1 and Rev2

    26-pin GPIO

  • Cayenne for Raspberry Pi

    New to the whole Internet of Things (IoT) idea? The Cayenne platform provides a friendly gateway to the world of IoT. Built specifically for Raspberry Pi, this IoT platform can help you transform the little machine into a versatile IoT device and put it to some practical uses.

  • Power to You

    Small-board computers (SBCs) are getting more and more powerful. The Raspberry Pi 3 (RPi3), which just came out in February of this year, is a case in point. This latest in the Rasp Pi line now has four cores running at 1200MHz with 1GB of RAM and on-board WiFi and Bluetooth. If you need even more power in a small computer, however, you are not left wanting. In this issue, we look at three SBCs with more cores, more memory, more ports, and more possibilities.

  • Reporting Rasp Pi data on a Node.js web server

    Combine great hardware projects that use the Raspberry Pi GPIO pins and a Node.js web server that interacts with the underlying operating system and hardware, and you have a winning team.