Homeward Bound Penguin

An Arduino-based solution for disoriented stuffed penguins.

It’s been a busy couple of weeks in Arduino-land. When I realized gloomily that my sewable GPS project was having some major power issues, I decided to move my project back to my larger, decidedly un-sewable Arduino board. Since the whole idea behind the project was to create a portable GPS-based game (in the vein of childhood favourite “hot and cold”), it seemed like a fun idea to house the whole thing in a squishy enclosure that looked nothing like a traditional GPS unit. Enter the toy store.

While browsing the aisles, I came across a display of very cuddly-looking creatures. Some didn’t have the body cavity space to house a whole Arduino board and battery pack. Others were huge. One was perfect. So perfect, actually, that it inspired a completely separate project. Six dollars later, I had a charming penguin. Sixty minutes later, his stuffed innards were all over the kitchen table.

A much-deflated penguin awaiting 'tronics.

Weeks ago, I had borrowed an HMC6352 compass module from Bill’s lab with the intention of using it in tandem with my GPS module to provide some directional clues to game participants (without a compass, the device could only calculate its distance away from its target location, not the direction a person would have to travel to bring them closer together). My busy library school schedule had unfortunately limited the time I had to develop this idea further, and the compass was left sitting idly in its plastic bag.

When I saw the penguin toy, two thoughts occurred: (1) An adequately-sized body cavity! and (2) Penguins live in the SOUTH.

Since compasses can detect their orientation relative to the north pole, coding something that would react when the compass was pointing 180° away from north seemed easy enough. My first step was liquidware’s compass sensor library for Arduino. While a few compass libraries are floating around online, this one comes with a handy calibration sketch that makes setting up the device a lot easier (I spent a few hours exploring the alternatives without a lot of luck, and boy did the compass require calibration!). At any rate, calibrating the device required running the sketch, opening the serial monitor, entering some commands according to the directions provided, and rotating the compass a full 720° on a flat surface. I used a third hand tool to keep it parallel with the tabletop while rotating since the header pins connected to the device preventing me from setting it flush against the surface.

Once the compass started returning plausible headings, I moved on to coding. The whole thing relied on a very basic IF/ELSE statement within a loop. If the heading returns a value between 170 and 190, turn on the vibe board. If not, don’t!

#include <Wire.h>
#include <LibCompass.h> // liquidware's compass sensor library.
// See https://github.com/liquidware/LibCompass

int vibePin = 10; // One end of the vibe board is plugged into Pin 10.

LibCompass compass = LibCompass(0);

void setup() {
 Serial.begin(9600); // Start a serial connection with the computer.
 pinMode(vibePin, OUTPUT); // Set the vibe board pin as an output.
}

int c;

void loop() {

c = (int)compass.GetHeading(); // Set the value of c to the heading reading.

 Serial.print("Heading: ");
 Serial.print(compass.GetHeading());  // This part just prints the heading.
 Serial.println(" degrees");

 if (c &gt; 170 &amp;&amp; c &lt; 190) // If the heading is between 170 and 190...
   {
     digitalWrite(vibePin, HIGH); // Vibrate!
   }
   else // If it isn't...
   {
     digitalWrite(vibePin, LOW); // Don't vibrate!
   }
  delay(10); // Compass manufacturer-recommended delay period.

}

Once everything was working well, I smushed the whole thing plus battery pack into the penguin. This video, filmed just before everything went inside, shows all of the electronic penguin guts and how the compass and vibe board work together.

Overall, I’m really happy with the final product. Even though the penguin is subject to many of the pitfalls of these types of compasses (if the compass isn’t parallel to the earth’s surface, the heading readings are a little wonky, for instance), assembling the toy was a great stress reliever and fun way to wrap up the course. *

* Fans of the GPS game need not worry! I’m hard at work thinking up more interesting enclosures for that project too.

Troubleshootin’

We’re within three weeks of the end of the course (!!) and I’m deep in troubleshooting mode. After sewing and soldering all of the appropriate bits and pieces onto my felt base, I’ve been working to test whether or not the components are working properly together.

Assembling the final product stitch by stich.

Assembling the final product stitch by stitch.

A big part of my problem has been sorting out whether my problems lie in the physical device or in its code. While my prototype code was working fine on an Arduino Diecimila with a GPS shield and breadboard equipped with LEDs, the current configuration (a Lilypad Arduino, power source, vibrating motor and made-for-Lilypad sewable LEDs) isn’t working consistently.

I was able to test my wiring today with a multimeter and found no problems with any of the soldered or sewed connections. It’s now down to my code and potentially the Arduino’s battery, whose power/juice I’ve been a bit iffy about. Since the connections appear to be okay, I’m now focussing on the code. While one of my test sketches appears to return a nice string of data over the serial connection when the GPS has a signal, the LEDs and vibe board aren’t responding to changes in my location as they should. Nonetheless, I’m hopeful that I’ll work out the problem before class demonstration day on April 11.

Starry Starry Felt

It’s week eight (!) of my interactive exhibit design course and I’m patiently awaiting delivery of the remaining components and cables I’ll need to finish off the more permanent iteration of my GPS game. In the meantime, I’ve been experimenting with the sewable/flexible part of the project by combining the Lilypad Arduino with some felt for a kind of bendy Van Gogh rip-off  Van Gogh-inspired piece.

Making a pattern using my low-tech light table (this one's solar-powered!)

The completed, colour-coded pattern.

My first step was to trace Van Gogh’s famous painting onto a felt-sized sheet of paper and to assign colours to each block. I tried to make them fairly close approximations of the original painting without creating details that wouldn’t survive the felt-cutting and sewing process. I also only had four colours!

Freshly-cut pieces awaiting pinning and sewing.

Sewin' by the light of the machine.

Once the pieces were cut and pinned, it was over to the sewing machine to attach them to my base piece.

A screw-and-bolt system for attaching the Arduino. By doing it this way, I figured I'd be able to remove the board easily for future projects.

With the help of my needle-nose pliers, I poked the LED leads through the felt and curled the ends (square curls for positive leads, round ones for negative ones).

Once the Arduino and LEDs were in place, I decided to test each of them out by running a quick “Blink” sketch and trying each of the LEDs in turn.

Testing the LEDs with a simple Blink sketch prior to wiring it all together.

Soldering everything together. Resistors hooked around each of the screws were a good semi-permanent compromise.

Once I was satisfied with the LEDs, it was over to the soldering iron to wire up the project. Since the sewable Lilypad LEDs come with built-in resistors (and I was using regular ones), I chose to incorporate some 100 ohm resistors into the design for good measure. They hooked nicely around the screws and were secured easily using the bolts. A ground wire was also installed to connect all of the negative LED leads back to the – tab on the Arduino. I chose to use insulated wire for all of the connections that might potentially end up overlapping in the final design.

Four corner snaps and some code from SparkFun and we were in business!

While I had intentions of coding a sketch to blink the lights intermittently, I came across a SparkFun fade sketch for LEDs that did the job much better than the code I was experimenting with. Like magic, twinkling lights appeared on the project. While I’m not 100% sure if the final project will involve felt, I’m hoping to incorporate some of the things I learned assembling this piece in the wearable GPS game.

Edit: Just after getting home tonight I realized I had an empty frame that would more-or-less fit the whole thing. Even better!

GP-Yes! The GPS game takes shape

The GPS game takes shape.

My little GPS game prototype works by detecting a GPS signal, calculating the device's distance from a specified target location, and lighting up LEDs depending on proximity to the target. Here we have an EM-406 GPS receiver (the little white square), a Spark Fun GPS shield atop an Arduino Diecimila board, and a small breadboard equipped with six LEDs.

One of the funny things about testing a GPS-based project is that you can’t really do it indoors. Halifax weather was pretty lousy and wet today, but I did have an opportunity tonight to run down to the end of the driveway with my device in hand for a few tests.

So far I’ve been prototyping stuff on my little breadboard. While I’m hoping to port everything over to a more wearable set-up soon (my extra GPS receiver cables and other bits and pieces are on their way), for the time being I’m pretty pleased with the system I’ve got now. For one thing, nothing’s permanent. It’s also been really easy to identify problems and swap out components when everything is laid out so clearly. Hurray for breadboards!

The software side has been a learning experience. I didn’t come into this with a C/C++/Wiring background, so I’ve done a lot of reading to figure out how to get my program to do what I’ve imagined it should do. I’ve had to remember things I’d learned once but forgotten (float versus int values) and do a lot of guesswork when it comes to defining and using variables. Syntax-wise, Arduino’s “Verify” command has been a huge help when it comes to missing curly braces and poorly thought out IF/ELSE statements.

Gear-wise, I’m in electronics heaven, and my semi-retired engineering-type father will be sending me back to London with a tackle box full of resistors, LEDs, soldering accessories, pliers, cutters, and my very own multimeter. Major kudos to him for teaching me when to use resistors (and the AdaFruit Circuit Playground app for identifying them on my behalf).

Western’s MLIS Program: Words of Wisdom

It occurred to me today that I’m within two months of finishing library school. Since I relied so much on student blogs before joining Western’s MLIS program, I thought I’d pay it forward with some of the “wisdom” I’ve acquired over my 14 months in the program.

1. You might qualify for an Ontario Graduate Scholarship, and yes, they’re awarded to MLIS students (not the case for SSHRCs). They require a little forethought (deadlines are usually in October for awards that begin the summer of the following year), but the tedious application process is so worth the $15,000 award. I had a small research agenda when I applied (undertaking a “research project in the field of geographic data dissemination”) but otherwise submitted my application before setting foot in a FIMS classroom.

2. Make contacts at Western Libraries. Loads of student employees are hired every year in a variety of casual positions. Meeting librarians and asking about student jobs can be your ticket to the top of the application pile. In my experience, librarians are often keen to hire MLIS students with a little reference training.

3. Have a couple of interest areas and tell people about them. I can’t count the number of times people have passed along job postings and invitations to events because they knew I was into $interest.*

4. You can take up to two graduate-level courses outside FIMS. Really. Need to brush up on stats or GIS or your favourite subject area? My top picks were in the Public History program and featured lots of discussions about digital preservation, born-digital materials, search engines, and exhibit design. If the course offerings are a little slim during one of your elective terms, I highly recommend going this route for a little variety.

5. If you’re interested in something specific, do an independent study. I had a fabulous summer in coffee shops all over London researching gazetteers, spatial searching and metadata for cartographic materials. That project is now a publication-ready paper.

6. Conferences. Attend them when you can. You’ll find that student rates are often much cheaper than the full rates, so use this opportunity to get a sense of how they work and which organizations do the kind of work you’d like to get involved with**. As with many things in life, the awkwardness factor decreases as you get to know people working in your field.

7. The tech question. This one’s tough. I’ve gotten a lot out of one FIMS tech offering (Database Management Systems) but have otherwise learned that they’re not really my cup of tea. Teaching technology skills to people with such a broad range of experience levels (as is the case in library school) is a difficult task, and the resulting coursework can be pretty dull for experienced students. As an aside, though, I’m really comforted when I hear that formerly-technophobic students have gotten into CMSes or RSS readers or web usability.

8. Library school isn’t a race. I don’t think I would’ve been able to get involved with half the things I did had I been taking five classes per term. Taking it slowly has allowed me to soak in the material a little more, get involved with local community organizations, work part-time in a library and as a research assistant, and participate in student events. It’s not the optimal solution for everyone (doing it all in twelve months is the most economical option for people without much time or money to spare), but I think I’ve really benefited from the extra four months.

9. Marks don’t really matter. Coming from a research-intensive institution, this one was a little difficult to grok. While I haven’t dropped my good student ways entirely (future grad school still being on the radar, at least for now), I’ve decided that sacrificing a percentage point or two in favour of a fun weekend away isn’t the end of the world. Sometimes you just need to finish assignments and move on.

10. When it comes to London, don’t just talk the talk. I didn’t really like London when I first moved here (and to be honest, I still worry about council’s management style). I promise that your experience in this city will improve dramatically if you get involved with people who are changing it for the better. Head to the market and the East end and Wortley Village. Support local businesses and people that are making a difference (my picks are City Symposium, London Public Library and the UnLab), and for goodness’ sake, step off the campus.

* Where $interest = “maps, GIS, maker culture, airplanes, technology”;

** As an aside, my favourite local conferences have been the Ontario Library Association Superconference in Toronto in February and a smattering of THATCamps. More personally, if you’re into maps and GIS, the Association of Canadian Map Libraries and Archives puts on a good show every June.

What’s the buzz?

I spent some time on Monday night avoiding an assignment disembowelling my dear embroidery hoop set-up to rescue some parts for more tinkering. This time I tried out a sketch by Ben L. which uses a potentiometer to control the pitch of a little piezo buzzer.

We’ve also been busy assembling a Makerbot 3D printer this week (complete with “accessories“). I’m happy to report that most of it looks like the schematic and we’re on target to finish it in the next few days. It turns out that all those years of Meccano and IKEA assembling have left me with pro hex key skills that were put to good use with the printer. I’m really looking forward to seeing what we can design and build with it once it’s all together.

Finally, our final projects have all been taking shape slowly. I’ve apparently taken our unofficial class description, “like a giant kindergarten”, to heart, and will be working on a slightly more technologically-advanced game of “hot and cold”. I’m hoping to use a small GPS receiver, a Lilypad Arduino and some little bits and pieces to make a large-scale treasure hunt game that guides players to a particular destination using some kind of signalling mechanism (maybe blinking lights or vibrations). Rather than having players hold on to some kind of GPS device, I’d really like to create a more subtle and “built-in” way of guiding people around. In the coming weeks, I’m hoping to start digging into the ways in which I can capture the location information from the GPS receiver and create particular signal responses (via the Arduino) depending on where I’m located. Should be fun!

Late night Lilypad Arduino

I spent some time last night getting into Lilypad Arduino, Arduino’s sewable, wearable cousin. It was love at first stitch. The idea that I could mount my components on a traditional embroidery hoop using age-old sewing techniques was comforting and exciting all at once, and I can envision some great applications of these tools after only a few sketches.

1. Twinkling LEDs

void setup() {
  // initialize the digital pin as an output.
  pinMode(11, OUTPUT);
  pinMode(17, OUTPUT);
  pinMode(16, OUTPUT);
}

void loop() {
  digitalWrite(11, HIGH);   // set the LED on
  delay(100);              // wait for a second
  digitalWrite(16, HIGH);   // set the LED on
  delay(100);              // wait for a second
  digitalWrite(17, HIGH);   // set the LED on
  delay(100);              // wait for a second
  digitalWrite(11, LOW);    // set the LED off
  delay(100);              // wait for a second
  digitalWrite(16, LOW);    // set the LED off
  delay(100);              // wait for a second
  digitalWrite(17, LOW);    // set the LED off
  delay(100);              // wait for a second
}

2. Light-controlled blinking 

3. The Buzzer (see Leah’s website)

Library Day in the Life

UWO Map and Data Centre

A view from “command central”, the front desk at Western’s Map and Data Centre. Maps are kept in the low-lying cabinets in the foreground, while atlases and globes are positioned along the walls.

Since discovering the Library Day in the Life project a handful of rounds ago, I’ve learned tons about the day-to-day work of library staff in all kinds of settings. Now that I’m blogging regularly, I thought I’d share my contribution as a library assistant and MLIS student at the University of Western Ontario in London, ON (roughly midway between Detroit and Toronto). I’ve worked part-time at Western’s Map and Data Centre since September 2011 and love my job to pieces. Here’s what I was up to on Monday, January 30th 2012.

9:20 – Commute to work. See a student on the bus completing one of our fill-in-the-blanks maps of Canada. Feel good about self, future of geography, etc.

9:30-9:50 – Arrive at the library, chat with our three librarians, log in to computer and desk tracker software, water plants (I am paranoid about killing the plants).

9:50 - Look up call number for book at main library. Learn that I can text myself call numbers from the catalogue. Proceed to do just that.

10:10 – Open the documentation file for a survey we’re loading into Equinox, Western’s homegrown data delivery system. Check to see which fields were incorrectly imported during the automated loading process. Locate a list of wonky derived variables without much additional information, and begin transferring the appropriate snippets of documentation into our database’s “variable source” field. This is all done using a version of InMagic DB/TextWorks.

10:30 – Tea time!

10:40 – Back to desk and the survey.

10:50 – Reference question from a friend at the University of Toronto’s iSchool about how people conceptualize “Northern Ontario”. I pull out some maps of the province to see how it’s portrayed, noting where they decide to split the province into two sides of the map (somewhere near Sault Ste. Marie, Sudbury and North Bay). I make a mental note of the few road/overview maps that don’t make use of the split.

11:05 – A borrowed cart is returned. I move the cart to its usual spot in our backroom.

11:10 – Back to the survey!

12:00 – Lunch time. I nibble away at leftover pierogi while our map librarian steps in to take over desk duty. I then dash over to the main library to pick up a book (using the text message received earlier) for an upcoming archival administration essay.

12:30 – I return to the desk and assume control. This is much less dramatic than it sounds.

12:40 – A campus tour drops by! The requisite “here’s a map of the map library” joke is made about the floorplan we have in the entrance. The tour guide notes that our library is “the coolest one” on campus. Feel good about it.

12:45 – More survey!

12:55 – A student stops by the desk to sign out some historic map reproductions of London for a project. We complete a sign-out slip and roll the maps into a plastic carrying tube.

13:00 – Survey! Grumble to self about lousy documentation and poor formatting.

13:10 – Reach the end of the survey. Celebrate by re-heating a mug of cold tea left over from hours ago.

13:05 – Open ArcGIS to resume work on an historical GIS project of Southern Ontario counties. I’ve been georeferencing a 19th century map of Halton County that has been split into sixteen individual images, so the process is taking a long time. Once all of the pieces are aligned properly, I’ll be using the information on the maps to relate the position of each lot to the names of the landowners who settled in the region.

15:00 – Re-file some Ordnance Survey maps and direct a visitor toward Western’s GIS job fair on the ninth floor.

15:30 – Wrap up my latest batch of georeferenced images and call it a day.

And that just about sums up my usual routine. I hope it has given you some insight into front desk work in a unique academic library. Thanks so much for stopping by!

I think it’s the conductive thread

HIS 9832 Rocks

Does anyone ever use "rocks" like this anymore?

Lessons learned and Wi-fi challenges

We’re now a couple of weeks into HIS 9832, and I’ve learned lots of things. Beyond our in-class work configuring switches, sensors and output devices (see our little LCD display above), I’ve been fiddling around at home with a Wifly shield (a second board that fits into the existing pins of the Arduino board, enabling extra functionality without a breadboard). Here are my lessons learned:

1. There are some major differences in how to code things between Arduino 0023 and Arduino 1.0. This has made working with other peoples’ sketches (even those as recent as last year) pretty difficult, so I’m going to have to backtrack a little and go back to basics in order to work out how to set things up with the latest software iteration.

2. Likewise, ethernet shields (providing hard-wired internet connectivity to the Arduino) have different coding requirements than the wireless shield I’m using. They’re also a lot cheaper, so many people have been using those instead of wireless devices. This has meant that most of the sketches and libraries set up to connect Arduino boards to the internet have not been configured for wifi-enabled boards. Converting these over to wireless-friendly versions has been challenging for this beginner!

Those things said, though, I’ve developed a huge respect for people who take the time to document what they’re working on online (including code snippets and software settings). While my wireless experiments are far from complete, I’ve learned a lot from these forums and blogs.

Final project directions

I’ve also started thinking about my final project for the course. Arduinos are ideal for applications where the device can sense something (location, temperature, light, sound, motion, etc.) and then produce an action/behaviour in response. Inputs can come from loads of different sources and produce any number of different responses (light, sound, motion, data transfer to a computer/server, etc.), so I’ve been spending some time thinking about just what I’d like to do with my final device. Some projects that have been on my radar lately involve augmenting a person’s sense of direction (see the North Skirt and the Haptic Compass), although I think I’d enjoy working on pretty much any wearable device (I think it’s the conductive thread!). Maybe some kind of jacket that could alert the wearer that they’re close to historic sites or points of interest, or something that could read out facts about particular locations once a person is in the right vicinity? How about a geocaching helper device that could glow in different colours depending on proximity to the cache? There’s definitely a lot to think about.

Episode 2 of the Maker Librarian

Thanks to a temperamental video camera app I wasn’t able to film our in-class activities last week. Instead, I thought I’d try one of the beginner Arduino sketches at home. This week on the Maker Librarian, I demonstrate how to set up the “Analog Input” sketch with a potentiometer and LED.

 

The Maker Librarian: Week 1

It’s Sunday night and I’m putting off a paper about library budgeting (sorry, library budgeting fans). Many of you know that I’m enrolled in another public history elective at UWO called Interactive Exhibit Design. It’s the kind of course that will end in some really cool projects (most using open-source Arduino microcontrollers), and I’m excited to take this blog along for the ride.

My background in electronics and coding is fairly limited–I’m the kind of programmer that borrows much better snippets of code from other people to get things to work–so this course will be both a test of my patience and my problem-solving skills. Fortunately, though, members of the online Arduino community are great code sharers. In fact, collaboration and communal troubleshooting are at the heart of the Arduino universe.

This week in class we teamed up to work through Massimo Banzi’s “Getting Started With Arduino” book (O’Reilly, 2008). Armed with an Arduino Uno board, a box of MakerShed‘s “Get Started with Arduino” components and a laptop, we jumped straight into the fundamentals of Arduino programming.

Below is the first video in what’s hopefully going to become a weekly (or semi-weekly) series following my Arduino adventures this term. Watch out for tutorials and vlogs as the weeks progress. Happy making!