Tag Archives: raspi

Real Life Pac Person

Real Life Pac Person debuted yesterday at the Burlington Mini Maker Faire. It must have been a big hit. ūüôā ¬†Rough numbers look like about 900 people played 350 games. A pure guess has them at 97% kids. Not too surprising – as adults we’re at high risk of forgetting how to play.

DSC_0032

The game construction has been covered a little bit already. Three-quarter circle capes were sewn from canvas. LEDs were sewn onto the capes: yellow LEDs on a yellow cape for the Pac Person, and blue LEDs plus either red or green LEDs onto the black capes worn by the ghosts. Ghosts then were equipped with a Raspberry Pi (complete with WiFi stick) for smarts, and a smaller accessory protoboard was made with the aforementioned voltage regulator and a pair of MOSFETs. These MOSFETs were used to turn individual strands of LEDs off and on.

Construction was intentionally crude – I have a covert social science agenda around how people learn about technology artifacts¬†on first exposure and how they manipulate it to their ends. Making it intentionally crude and exposed leads to lots of good questions, and sets up an environment where it’s safe to make suggestions.

OLYMPUS DIGITAL CAMERA

Surprisingly, the rats nest of wiring holds up fine. Leaving the connectors on means there are places to disconnect things and plug in power supplies (to light the lights) or to probe the other side with a voltmeter (to show what the computer and the MOSFETs are doing).

Once you have the technology, you need masking tape. In this case, 180 yards of masking tape. Plus you’ll need a big space – setup was about 24 feet by 40 feet with an extension out to the side. This makes the play area sort of L-shaped. Not exactly faithful to the original game, but I think it makes it more fun. Being able to spread out and run¬†is a good thing. Naturally, using blue painter’s tape makes the play area look a bit more faithful to the original.

Power Pills have been an issue since I started. I wanted to use some tall, skinny cabinets to hold a big battery, a junker laptop, and an easy button. The big problem has been a safety question – for one thing, I don’t someone running full-power into a hard structure in the middle of the game. Secondly, I need a lot of power to run the laptops for a whole day. I’m talking about car battery amounts of power. If that thing gets tipped over, I have a problem.

Solution: pink squares on the floor represent power pills, and when I see someone run over one then I press return on my laptop. The laptop is running a program that sends the network request to the ghosts each time I press return.

“Network request”, you say? Yes. Network protocol is HTTP over TCP/IP. Ghosts run the Apache web server, each network request is a GET request for a cgi program. The cgi program sends a unix signal (signal.h style) to a setuid executable that triggers the Pi’s GPIO pins. Software is a state machine that transitions between ghost states – body color, then blue, then flashing blue, then back to body color. At any point, a new cgi request can send a new signal that sends it back to the “I just turned blue” state and it keeps on chugging. Light timing is read from a configuration file (once per startup to save power-hungry flash accesses). Now that you mention it, yes I did tune game timings on-the-fly.

Some spectators were amused by being able to ssh into a ghost and tweak stuff on the fly. Or for that matter, ssh into a ghost and play Minecraft on there, while the game is running.

Advertisements

Powering a Raspberry Pi from a Battery Pack (AA batteries)

(Time Travel Alert – this happened a week ago. If you played Real Life Pac Person at the preview on the 18th, then you’ve seen this and more. If you’re playing in Burlington, NC on the 25th at Mini Maker Faire, then know that I may not have the blog caught up until Sunday)

If you’re using a Raspberry Pi for a wearable, then you have an acute power problem. The RasPi needs 5 volts at about half an amp, peak, when a USB wireless adapter is connected. Steady-state draw with a very light workload will be about 350 mA. Based on the performance curves from a reputable manufacturer of batteries (OK, “cells”), this is going to give you about 3 hours of battery life on a quiescent device and a little less if it’s busy. Add in as much as 110 mA for all the blue LEDs, and Houston, we’ve got a problem.

So, Nickle Metal Hydride (NiMH) is your friend. 2500 mA/hr off the shelf, no waiting.

But you didn’t think it was going to be that easy, did you? Of course not. Four of those cells will give you 4.8V. Technically, that’s not enough voltage. In practice, yes, it will work, especially if all of your USB devices have nice, broad safety margins. I don’t want to chance it. Also, the wire lights vendor lied: the blue strands are actually 12V devices (they claimed 5 volts, and I¬†should have known better…) and need a good 11.0V to be bright enough. Given that, I’m stuck using ten NiMH AA cells or eight alkalines and a shorting jumper.

12 volts is enough to fire a Raspberry Pi into the asteroid belt, so it has to be stepped down. In Ye Olden Days, that would be with something like a 7805 regulator – an analog device that basically turns excess voltage into heat, and lots of it. Welcome to the twenty-first freaking century. ¬†We now have the¬†78SR-5/2-C. This is a 5V switching regulator a little bit bigger than a postage stamp and having a sweet, sweet 2 amp current rating (twice the original 7805). Claimed efficiency is around 90%… what it draws in, it puts out. Not much heat at all. Bonus side effect – the wattage in is just about the same as the wattage out, so if you produce 5 volts at 1 amp, then it will load down a 10 volt battery stack at half an amp, give or take. Nice.

Here it is cobbled up on the breadboard for a fast checkout:

OLYMPUS DIGITAL CAMERA

Please ignore the cheeseball AM transmitter on the upper strip. That’s for a future revision of the game. ūüôā

Raspberry Pi – First Light

The big upcoming project uses the Raspberry Pi for brains. ¬†Actually, it uses four of them, one per ghost. ¬†Last week I got them powered up and actually started configuring them. ¬†Simple USB-WiFi adapters are plenty good enough for what I’m doing, and I’m pleased to report that they work flawlessly.

In fact, everything works flawlessly. ¬†This is a totally “plug it in and it works” kind of thing. ¬†Plus, the Pi comes with both Minecraft and Mathematica. ¬†This is the first time in two or three years I’ve felt complete, unadulterated joy from a computer. ¬†The purity of the experience is remarkable.

OLYMPUS DIGITAL CAMERA

(brightness, contrast, and effective gamma have been tweaked to compensate for the exposure being completely blown out by the bright monitor behind it).

CPU power feels about like a PII-450 running a modern distro, but the microSD card feels very slow. ¬†No matter – it won’t be heavily taxed in the upcoming application.