Generation 2 of the Conference Presentation and Manipulation Apparatus

Lead Image © Christos Georghiou, 123RF.com

Cool Controls

The doctor upgrades a conference slide projection apparatus and adds a retro-clicker with some Python code to keep his talks moving forward.

In an earlier edition of Raspberry Pi Geek magazine [1], I looked at a basic Raspberry Pi "presentation machine," in which I used a Rasp Pi generation 1 device to display slides during my conference tech talk at OSCON (Figure 1).

Figure 1: Generation 1 presentation machine.

The experiment proved that the use of unique, one-off devices in my show can bring a lot of attention and new conversations to the conference experience. Since then, I've taken it to the next level by combining my fascination of Steampunk [2] with my tech talk gadgets.

In this issue, I'll look at the mods and upgrades that make up the second generation presentation machine: the "Conference Presentation and Manipulation Apparatus." Recent talks with the gen 2 device have gone well, and audiences seem to appreciate homemade, "exotic" hardware before, during, and after the show.

Steampunk and physical computing: How could it possibly get any better?

Quick Review and Mods

The generation 1 device was simply an early Rasp Pi, a USB hub, a USB webcam with a little stand, and a wall wart. I packed everything into my computer bag, connected everything together at the venue, and crossed my fingers. However, I took my Linux notebook loaded with the presentation, just in case. Parts rattling around loosely in a notebook bag might not be the best way to transport your physical computing gear, particularly when going through an airport. Clearly, a more permanent solution would make setup easier and give a little extra assurance that everything would work at show time.

For the wooden base, I scrounged through my shop and found a short piece of laminate flooring that seemed like the perfect base material for the machine. It even had rubber padding on the bottom. The base was sized to accommodate the Rasp Pi on one end, the webcam arm in the middle, and a small display area that I wanted to display on the projector screen during the presentation (Figure 2).

Figure 2: Conference presentation machine on a wooden base.

For durability, the Pi needed to be solidly mounted to the base. I ginned up a little frame using 3/16-inch-diameter thin-wall brass tubing, which is easy to cut with a tubing cutter and can be soldered using a standard 100/140W solder gun. I also used some of the tubing for spacers to elevate the Pi above the frame. Brass flat stock .032-inch thick by 1/4-inch wide served as mounting points and corner braces (Figure 3), and 3/4-inch by 2.5-mm brass machine screws from a local hardware store fit through the Pi's mounting holes. Yes, I know I mix metric and imperial measurements. One of my unique quirks.

Figure 3: A close up of the brass frame.

Instead of the wimpy, spindly, aluminum webcam frame I used in version 1, the device now sports an articulated arm with a mounting in a decidedly industrial style with exposed circuit board (Figure 4). The arm is 1/8-inch thick by 3/4-inch wide flat aluminum, lightened with regularly spaced 1/2" diameter holes. The bottom pivot brackets were made by splitting and flattening out some 3/4-inch copper plate, then bending them to shape and drilling the holes.

Figure 4: Hacked webcam, articulated arm, and mounting with an industrial spin.

For maximum presentation performance – because I don't want to wait for LibreOffice or individual slides to load – I did a few simple mods to ensure that everything would run smooth and fast. First, be sure to use at least a Raspberry Pi 2 (RPi2) for your own slide machine. The first-generation Pis definitely work – it just takes considerably longer to start LibreOffice and switch between slides.

Second, use the fastest microSD card you can afford. The Samsung EVO+ 32GB UHS-I microSD [3] showed markedly faster Rasp Pi operation across the board over cheapo, generic microSD cards. Best Buy puts the EVO+ cards on sale every few months. As of this writing they were $10.99, down from $27.99. The SanDisk 32GB Extreme Pro SDHC UHS-II card looks like it would be even faster at around $80. Speed costs money: How fast do you want to spend?

Third, use reasonably sized graphics on your slides. I crunched pictures down to 1024x800 and used the JPG format without any noticeable loss of resolution on the finished slides. Switching between slides was never longer than a half a second.

An interesting side effect of building your own themed hardware gadgets is that as you carry it around a conference, it invariably attracts attention. When one attendee spied the device on top of my computer bag at breakfast, he then commented that he'd definitely have to go to my session.

Do you want to attract attention? Build your own unique hardware and put it out in the open.

New Functionality – The Wired Clicker

The Steampunk theme, brass frame, articulated aluminum arm, and exposed circuit board webcam mount were fun, but I also wanted something to highlight the general-purpose input/output (GPIO) capabilities of the Rasp Pi to my audiences. What better way than to build a hardwired slide clicker?

I used a couple of gnarly-looking "leaf" push-button switches [4] and attached them to a common everyday door lock striker plate (Figure 5). The plate was the right shape and the holes were the right size to fit the switches. To the plate, I attached a flattened 4-inch-long, 3/4-inch-diameter copper pipe for a handle.

Figure 5: A close-up of the leaf spring push-button clicker.

The switches were wired to a 15-foot-long piece of CAT 5 cable with spade terminals at the other end. The terminals screwed into a barrier terminal block mounted on the wooden base. The terminal block was then connected to the GPIO pins through the standard 40-pin connector, and the switches were attached to GPIO pins 23 and 24 on the Rasp Pi.

One great thing about building Steampunk-themed gadgets is that you get to "un-engineer" things. Instead of designing for efficiency and low cost, aesthetic embellishments and high-visibility style are substituted into the design, frequently making things "way overkill" or even slightly impractical. It's a good thing, though, because the projects turn out to be one-of-a-kind and absolute geek magnets.

The wired clicker was a great addition to the basic presentation machine. For some reason, people are drawn to the device and want to know all about it. It's just a couple of switches on a handle and a wire that goes to the Rasp Pi. Audiences love it.

On the Rasp Pi, a Python script detects the clicker button pushes. It's pretty straightforward and amounts to a loop that watches the high/low state on the two digital input pins. The pins have built-in pull-up resistors, so there's no need for a voltage divider circuit, which you would have to use with an Arduino or other microcontroller.

The process I use is to start LibreOffice Impress and then pull in the slide presentation. I then start the Python script (Listing 1) in a terminal window. Finally, I push the slide show button in LibreOffice to display the first slide, full screen, on the projector.

Listing 1

scrollslides.py

01 import RPi.GPIO as GPIO
02 import time
03 import os
04
05 GPIO.setmode(GPIO.BCM)
06
07 GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
08 GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP)
09
10 while True:
11     input_state = GPIO.input(23)
12     if input_state == False:
13         os.system("xdotool search --name 'Impress' key Up")
14         print('Button Pressed')
15         time.sleep(0.2)
16
17     input_state = GPIO.input(24)
18     if input_state == False:
19         os.system("xdotool search --name 'Impress' key Down")
20         print('Button Pressed')
21         time.sleep(0.2)

When the Python script [5] notices a button push, it makes a system call to a command-line program named xdotool [6], which imitates keyboard actions. When the Up button is pushed, xdotool outputs the Up arrow character. Likewise, the Down button, produces a Down arrow character. LibreOffice reads it as if it came from a wireless keyboard or mouse-pad. Using this method, I am able to continue using the keyboard, if I like, as well as the clicker.

You might think going through a system call would be clunky or laggy; however, the whole button-pushing/GPIO-sensing/keyboard-character-generating process is fast enough that you have to add a little time delay; otherwise, you would experience key bounces and multiple characters if you didn't push the button quickly enough. A delay of 200ms works pretty well and is reflected in the script (lines 15 and 21).

Make sure when you use the clicker with LibreOffice Impress that the mouse focus is on the slide window in the application. I had to use the keyboard/mouse-pad during one talk when I couldn't get the wire clicker to work. It turned out the mouse focus was on some other window when I activated the slide show. Instead of slides in the Slide Sorter window, I was cycling through the different slide formats in the Properties window. If you put the mouse focus on the correct window, the clicker works flawlessly.

Don't limit your thinking to either desktop-only apps or GPIO-only projects on the Raspberry Pi. The RPi2 and Linux are powerful enough to mix and match desktop apps and GPIO capabilities for some awesome project possibilities.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content