Via Libris: Smartbook with a Arduino Mini Pro computer and sensors to take reader to the treasures of our world
The VIA LIBRIS is a paperback-sized treasure book. It leads its user to a predetermined location, using a special compass dial and by giving COLD, WARM, or HOT clues. At the treasure location, a gift card pops out of a hidden slot in the book. It’s a great surprise for the gift card recipient. A new location can be programmed anytime with the push of a button. Each book is handmade, one of a kind, beautiful, and reusable. I use it to give gift cards to friends and family, by leading them to the store/restaurant that the card is for. When the card pops out, they suddenly understand the surprise, and can use it immediately. It’s great fun.
The VIA LIBRIS uses an Arduino Pro Mini (under the circuit board), a magnetometer, an accelerometer (for compass tilt compensation), a GPS module, a sub micro servo (clue wheel rotation), and a special continuous rotation gearmotor servo (compass pointer rotation) which I custom designed and built after trying many alternatives.
This project was inspired by Kenton Harris’s reverse geocaching box. I really liked the idea of leading someone to a location to find a surprise, which is in the box all along.
The VIA LIBRIS was designed to be a bit old-fashioned. I love things that move. I like that good old mechanical feel. I made a conscious decision to implement many features in hardware (with servos that rotate indicator wheels). I could have implemented these indicators with a display or an LED light array. This would have been MUCH simpler for my design, and still would have looked great. But I decided to take a harder route and make things mechanical. I felt like a display wouldn’t be much different from a smartphone app.
As I thought through my design and built a prototype, I made some changes to my idea early on. For example, I decided I only wanted two motors (or servos) in my product. This required me to develop a design that did three types of movement with only two servos – the compass wheel, the clue wheel, and the gift card dispenser. A third servo or motor would have created a space issue, and would also add another set of magnets to a design that relied upon a sensitive electronic compass to determine magnetic bearing. This was one of many trade-offs in my design, and by identifying them early I was able to think them through and envision the ramifications of the different options. Still, this two-servo decision eventually created many challenges for me. More about that later.
I enjoy building mechanical projects with Arduinos. The hardware/software combination often enables you to make a design or behavior change by simply changing your software. This is much faster than a hardware modification. For example, I discovered that the sub-micro servos I use for my clue wheel have some variation in the way they rotate. A 20-degree rotation isn’t the same from servo to servo. The COLD, WARM, HOT wheel locations varied from servo to servo (and therefore from box to box). I had two options: make a custom decal for each servo, with slightly different clue locations, or use one decal version and simply change the rotation values in the software for each box. It’s easy to change the rotation values in software, and I had to use custom values for each box anyway for the electronic compass calibrations.
I designed a custom printed circuit board (PCB) early in the process, as the size of the PCB drove so many other design parameters. I had a crucial decision to make regarding this PCB. I would be using several different product “modules” – an Arduino Pro Mini, an Adafruit Ultimate GPS, a servo controller, and an electronic compass. I could have designed a PCB that would essentially rebuild all those products on one PCB. But that was well beyond my ability at the time. It would have required me to purchase (and solder) many tiny surface-mount components. So, I opted for a slightly different approach. I used EAGLE PCB (Autodesk) to design a master PCB onto which I could solder various whole modules (Arduino, GPS, etc.). My design was still complex – it required a two-sided board, with GPS module on the top and Arduino on the bottom. But EAGLE has this capability.
Before sending my PCB design to a fabricator, I built my own board to test the system. It was crude, but it worked! I did learn that a big ground plane under the GPS module is important – it isolates the weak GPS signals from all the electrical noise that an Arduino (and servos) produce. It was easy to design this feature in EAGLE.
I ordered ten custom PCBs from a fabricator. Despite checking my design before ordering the PCBs, I realized as soon as I received them that I had made a design error. I had to rework a few paths on every PCB. No big deal for ten, but it would have been a huge effort for 100 or more. Triple check your design before you order custom PCBs! It’s a bit difficult, especially with multi-layer boards, but do it. Don’t make my mistake.
I needed three clear acrylic pieces for my prototypes. I ordered them custom-cut from a plastics supplier, and drilled my own holes with the help of a cardboard template. This was fine for ten prototypes. But for larger quantities, I will laser cut the pieces (and the holes).
3D design is where I made my first big mistake. Remember my decision to use two servos/motors for three different motions – the compass wheel, the clue wheel, and the gift card dispenser. This created a complex design challenge for me. I needed the clue wheel servo to also trigger some type of dispenser. I wanted the dispenser to “pop” the gift card, in a surprising way, from a hidden slot in the bottom of the book. It had to have a mechanism triggered when the rotating clue wheel hit the “you’ve arrived” GPS location.
At first, I decided NOT to invest my time in a 3D design, and instead tried building prototypes of different versions of dispensers. I tried five different versions, all using some sort of spring (for one I used a large safety pin). The design was constrained in several ways – mostly by the small space that the dispenser mechanism had to fit into, but also by the motion of the clue wheel.
Each time I created an updated version, it would have one of two problems. It would either work well but be ridiculously difficult to make, or it would be easy to make and work intermittently. I discovered this when I started making prototypes to give to friends and family. I needed a design that enabled easy “making.” I spent months of work on many versions, each with their own problems.
When version five was a failure, I threw up my hands and decided to invest my time in creating a good 3D Computer Aided Design (CAD) model. I used Autodesk Fusion 360. I spent a few hours over a weekend creating a complete assembly of my design, minus a dispenser. I added every part that would interact in any way with the complete system. The design allowed me to visualize the constraints, and to easily try different dispenser ideas without building anything. If it didn’t work, I simply clicked “undo” and tried something else.
I spent a few hours over a week trying different dispenser ideas in my 3D model. I finally settled on a reliable, repeatable solution, using three 3D-printed parts. All total, I spent 10 hours on this design process. Had I done it at the beginning, I would have saved weeks and months of aggravation. Don’t make my mistake. Start with a 3D model!
The model also enabled many valuable extras. I could easily 3D print the three components of my dispenser. I could also create photo-realistic 3D renderings, 2D drawings (for laser-cutting the acrylic mentioned earlier), AND I made a nice animation of the dispenser design and operation. This took some time but was worth it. I used that animation clip in a longer video to introduce my product. You can see all these items on my project website.
The Arduino software code (my Arduino “sketch”) took a bit of work to ensure the Arduino could handle all the necessary functions. This included the i/o for a variety of external devices. The Adafruit Ultimate GPS Breakout uses serial communication. The electronic compass, a LSM303, uses I2C. The servos use digital pins, and my custom-designed compass servo also needed an analog pin to measure feedback. My project also includes a small disk vibrator to provide user feedback, which uses another Arduino digital pin.
The Arduino uses serial communication for programming, and there’s only one serial “port” hardcoded on an Arduino. The GPS module also uses that serial port. A connected GPS module interferes with uploading a program sketch to the Arduino. Ideally, I would have shifted the GPS to a couple of digital pins using the Soft Serial Arduino library. It uses software to mimic the hardware serial interface. BUT when I built my first version, I found that Soft Serial and servos don’t work together at all. They interfere with each other’s timing. So, I stayed with the one serial port, and added some simple jumpers to my PCB design. I can pull the jumpers to disconnect the GPS for programming. An example of a hardware change to solve a software shortcoming.
During my build process, I documented EVERY step with photos and notes. Including any special tool setups. I therefore created an assembly and manufacturing guide on the fly. I highly recommend this! You’ll need it when you ramp up your production, or even if you’re building only ten items for family and friends. Doing it now hardly takes any extra time. Also, add lots of comments to any code that you write!
During my process, I also discovered that some of the wire routing, especially with the servo cable, was difficult due to limited space. There was no way around this for the initial ten PCBs that I had. But I immediately made a change in the design for version 2 of the PCB to fix the issue. Make those types of changes when they’re fresh in your mind! Like most Makers, I work on a project in phases, move on to something else, then come back to it, sometimes weeks or months later. It’s hard to remember needed changes at that point.
Once I had some working prototypes, I had a fun time testing them. I packaged my prototypes into a nice “book box” that I purchased at a craft store. I would soon buy MANY of these boxes. I decided on a few adventurous friends and family members, and gave each a VIA LIBRIS with a pre-loaded gift card for a merchant location near them. The location was pre-programmed into the EEPROM of the Arduino. I also gave them very minimal instructions. Remember that they had no idea a gift card was inside. I wanted to see if they could begin their “treasure hunt” just by turning on the box and following it, and I wanted them to be surprised. It worked! My favorite was a phone call I got from a friend – “I had no idea what was going to happen when I arrived at the place this box was leading me. But I’m here in front of “merchant,” and a gift card just popped out FOR THIS STORE! Totally cool!”
I also received some important feedback. My box doesn’t tell its user how far they are from the “treasure” location. It could, but I like keeping it a bit of a mystery. It just gives COLD, WARM, HOT clues. One of my users pointed out that they had no idea at the beginning how far they would need to travel. Car? Bike? Walk? I added icons on the clue wheel that represent a car, or footsteps. I also tell a person at the beginning roughly how far they will need to travel.
There was an unusual issue. My mom lives far from me, and during her treasure hunt the compass wasn’t pointing the correct location. I found this hard to believe. Math is never wrong, correct? I eventually discovered an error in my code in the trigonometry function that calculates bearing. It was a subtle and strange error that wasn’t apparent around my home latitude/longitude. But it was a definite problem in other areas of the country. Easy to fix, but I otherwise wouldn’t have known.
Another valuable feedback suggestion was to add sounds to the box, to keep children engaged during the treasure hunt. Great idea! My updated version includes the Adafruit Audio FX Sound Board. It plays a bunch of funny sounds through a small speaker on a random basis. I’ll need to update my PCB design again, but that’s easy to do. Thankfully, there’s room for the sound board just above the Arduino.
It’s been a fun and educational process, and I’ve learned some good lessons along the way:
First, keep careful track of your revisions, whether to hardware, code, etc. I have a revision history document that details the dates and changes made with each version. There have been many. The history has been a lifesaver – especially when I come back to this project after a few months off, and can’t quite remember where I left off.
Second, decide what inspires you, and focus on that. I’m inspired by that combination of Arduino and mechanical movement. The two just seem to work well together.
Third, keep a list of the parts you use, including the source, their price, dimensions, etc. That parts list will be invaluable as you start to build your item in quantity.
Finally, once you’ve built a prototype, test it! Try it yourself in different environments, potential use cases, etc. Don’t be discouraged if it doesn’t work as well as you hoped. Remember the gift card dispenser challenge I mentioned earlier? Use this self-test process to identify any possible issues. Then, have family or friends test your prototype. Before you do this, write up any special usage instructions that they might need. Pretend they’re a customer that just unboxed your product. You want to test their entire experience, without your guidance. You won’t be available to guide every potential user or customer anyway.
I wrote a prototyping guide based upon this project, which has great lessons-learned for any project, large or small.
Thanks to makemagazin.com, the online magazine with the latest technolgyand to make it by your self