Category Archives: hacking

A Brief detour into Cryptocurrency

dogecoinI attended a meetup of HackBoston, run by Abby Fichtner (HackerChick) from the Harvard Innovation lab. Project 11’s Reed Sturtevant wanted to learn more about Cryptocurrency, so he started experimenting and shared the basics with us at the meetup.

Most people have heard of BitCoin, but Reed shared that it’s so hard to mine now, it’s very difficult to experiment without putting in real money. He found DogeCoin as a fun, and lighthearted alternative. Often used as a +1 or like tipping system for blogs and on social networks.

Pre-work was to set up wallets before the meeting, as they take time (about 5 hours) to synch with the network.

We each recieved 2000 dogecoin at the beginning of the meetup. Then we learned the basics of how to use addresses (essentially the destination of coin transfers. We transferred money to each other.

While doing this Reed went over the basics of cryptocurrency, which I won’t cover here, but the wikipedia article covers it pretty well.

We also created accounts at which lets you send DOGE via twitter. (feel free to tip @osbock)!

Intro to Mining

If you read the wikipedia article, you know that transactions are verified by a cloud of contributers performing cryptographic checks distributed across the Internet. “Miners” are rewarded both through the creation of new “coin” (which slows) and the distribution of transaction fees. Without special hardware, your chance of winning a race to solve the puzzle that is a cryptocurrency transaction is minimal, so mining pools were created to distribute the work and the reward.

We created accounts on the mining pool site, created workers (essentially addresses within the pool for your mining processes to communicate) and downloaded and configured mining software.

I recently got a nice “gaming” laptop from Lenovo, because it offered very good price performance, plus it has an Nvidia graphics card which I wanted for computer vision experiments.

Because Nvidia graphics cards contain many parallel processing cores, and Nvidia has released an API that allows their use for general purpose parallel computing, they are often employed for mining.

The Experiment

Following instructions from, I set up cudaminer (cuda is what Nvidia calls their processing cores) and another instance running the pooling cpu-miner to take advantage of the native cpu cores of my laptop’s i7.

Each mining process (cudaminer and pooling-cpu-miner) were configured to report to a “worker” setup at

I then mined overnight to determine:

  1. The kH/s (thousand’s of hash per second) capability of my laptop
  2. How much doge/hour I could mine
  3. Electricity cost of running the computer. (determined with a P3 Kill-a-watt)

Using an exchange rate, I converted into dollars to see if I could mine more doge than the electricity cost.

The Results

The cuda miner was reporting an average of around 80 kH/s and the cpu-miner around 54 kH/s

In 14.07 hours I mined 261.229 Doge for 18.57 Doge/hour, or $.0147/hour (at an exchange rate of .00079$/Doge.) Power usage was approximately 1.4 kWh, which I calculated to cost $.19.

Projecting out to a month, at  134 kH/s, I’d earn a whopping $.95 (and lose a lot of the computing bandwidth of my laptop!)

I could invest in a fancy graphics card and dedicate a computer, but I imagine it would cost even more electricity.  So, I would say  overall, a negative return on investment.

This apparently became the case for bitcoin as well, until people developed specialized hardware that gives a high H/s rate at low electricity usage, first using FPGA’s and then specialized ASICS (Application Specific IC’s). Doge uses a different Hash algorithm than Bitcoin, so you can’t use the now ubiquitous ASIC mining equipment optimized for the SHA 256 algorithm. There’s a new ASIC to be released soon that supports Doge’s (and litecoin, and others) Scrypt algorithm, and by extending my calculations, the cheapest of these devices ($119) would pay for itself in 3 or 4 months.

I’m going to try to get one to see. Of course, all these calculations are based on assumptions of stability (exchange rate, mining rate etc.) which are completely unreasonable. Still it’s fun to try!

Electrify Your Halloween! Making it Move!

In late September, I  led a workshop at the Duxbury Free library on making interactive Halloween displays, and more recently I set my project up on our porch for Halloween.  One of the most effective ways to make your front porch scary and immersive is to pay attention to sound, and to make things move.

The first part (making it scream) was documented in this post. This is about the movement part, creating a pop-up inflatable ghost, completely from scratch. It was very successful and popular!with the kids. Unfortunately I didn’t get any video, but I can cover the construction.

I like inflatables, and wanted to try making my own. One thing that made this really easy was a really cool product called Powerswitch Tail. This allows you to control an AC outlet from a digital signal. Its available from Adafruit and Makershed. It’s essentially a short extension cord with an opto-isolated relay in line. This eliminates any dangerous AC wiring with relays, and protects your Arduino and other circuits as well.

Next I needed to make the Ghost. I use white kitchen trashbags at home, and I took three of them, two laid end to end (with the end of one cut off.) I cut the third bag in in thirds and used the outside sections for arms. I used simple transparent packing tape to bond the edges.


A total of 3 bags (top and bottom, both arms)

I used one of those small vortex fans, and taped it around the output side.


Boo! Attached to the fan, and inflated.

Hook the powerswitch tail to a digital IO on an Arduino and you are good to go. As I mentioned in the last post, you can get the code on github here.


Open Hardware Summit Photobooth

As you know, my Wyolum buddies and I partnered up with SeeedStudios to make a really cool e-paper badge for the Open Hardware Summit which took place last week. We wanted some cool ways for people to customize their badges. Justin created a great simple program for converting images ( and I leveraged that software to create a photobooth.

photobooth (by Addie Wagenknecht)

Photo by Addie Wagenknect

My friend Michael Castor at Makershed built a cool tablet from the Raspberry Pi, and he told me about the nice 10.1″ LCD display and HDMI adapter he found from Chalk-elec.

I ordered one, and started figuring out how to put the whole thing together. I also got a big red button from Adafruit. I have been playing with the Raspberry Pi camera and it’s perfect for embedding in a project like this, even though the software is a bit primative at this point (no video for linux drivers, etc.) I used our own AlaMode to read the button and use one of our WS2811 arrays to do a visual countdown before taking the picture.

I’d never really designed anything for laser cutting, and this was my opportunity! I used Inkscape, with the T-slot extension written by Justin. I got the box cut at Einstein’s Workshop (a family oriented makerspace in Burlington, MA.)

Lasercut box

Next, I laid out the components. The trickiest parts were the LVDS cable (though it’s pretty generous) and the Raspberry Pi Camera flex cable.

One really sweet thing about the Chalk-elec hdmi adapter is that you power it, and there’s a USB power port to power the Pi.

Raspberry Pi and HDMI adapter


Attaching the LCD to the case is a little nerve wracking, as like most tablet screens, it’s intended to be glued in. I used 3M permanent mounting tape (really not tape but adhesive on a backing roll.) It’s really difficult to cut with scissors (it sticks to everything) I made the mistake of putting it on the bezel and trying to cut it with an X-acto knife. I scratched the paint on the bezel, but I managed to fix it with a sharpie.

The better approach turned out to attach it to the opening, and cut along the opening.


After trimming I added the LCD, and the USB panel mount jack.

I had to drill a few holes because I hadn’t completely planned ahead, for a jack for the switch box (used a 1/4 phone jack and plug) power, and the 16 pixel LED array.



I had planned for it to swivel on the sides from two carriage bolts with wing nuts. This meant making a stand, and I didn’t want it to be just a couple of 2×4’s. Also I was running out of time so I took Justin’s suggestion and made a tripod mount for it. More holes…. And a mending plate from the hardware store. Fortunately I have a set of cheap taps from Harbor Freight, so it was pretty simple to drill the plate and tap it (1/4-20) to accept a tripod mount.


Getting it hooked up with the short cables is a little tricky, but there’s room to get your hands in there:


I used a proto-screw shield to make it easier to hook up the button and LED leads. As you can also see, there’s a small usb hub inside too.

I booted it up:



and then hacked Justin’s Wifit program to take a picture:


Justin then created a more kiosk-y gui, and I ironed out a few things with the Arduino code for AlaMode. The gui checks to see if an sd card is mounted, and when it is, it sends an enable command to the button and prints on the screen “Press Button when ready”  The AlaMode then monitors for the button, and when pressed, sends the signal to take the picture and begins counting down on the LED strip. You can find the code in our github repository:

I tried also using the LED strip as a flash, and it worked but made sort of ghastly underlighting like a camp flashlight! So I took some cheap chinese led strip I had around (about $12 for 5 meters) and made a light panel:


And the finished product:


And on the badge:

IMAG1729I’m thinking of modifying the code to upload higher res pics to the Internet with an imprint, or printing them on a portable printer I picked up at a yard sale!

By the way, I left the Raspberry Pi’s wifi dongle attached, as it made it much easier to debug with SSH from my laptop. That said, I did also plug another hub into the one exposed port to use a keyboard and mouse (even though the touch screen does work!) If I had to do it over again, I might bring at least one more port out for other devices.

You’ll notice in the first picture, the Wyolum Logo across the top. Elizabeth Shaw cut that for me and delivered it the morning of the OHS, and it fit perfectly!


Lazertag hacking

My friend Nick asked if we could find a way to create enhancements to the fantastic, but no longer made Lazertag Team Ops system.

Many people believe that this was the Pinnacle of consumer lazertag, and I tend to agree. In addition to working better both indoors and out, it could host games where it kept track of the scores of multiple players.

Nick and his friend Max came over and we were totally successful! Here’s a brief video showing our results.

First we looked up what was known about the protocol. I found this:

via the LTTO (LazerTagTeamOps) Yahoo group. As you can see the page is no longer in service, but the archive still has it.

Here’s the cool diagram that they created in the past, apparently based on Aaron Nabil’s reverse engineering effort:

From the Internet Archive’s record of

Of course it’s easy to say this now, but the protocol was pretty easy to decode by looking at the output on a scope. The only difficulty I had was capturing just the shot, as the dome is constantly shooting out messages saying what team, etc.

Here’s an example of a shot that is created by our program:

Lazertag shot

you can see that it uses a 38 kHz carrier (to distinguish it from random IR noise. Fortunately Ken Shirriff wrote a terrific IR Remote library for the Arduino. It’s not really well documented, but there is a sendRaw() function that we used to send the actual timings for the shot. Grab his library here. The library uses preset pin numbers for the LED output, but you can change them in the library itself, you just need to use one of the PWM pins as he uses the timer function to create the carrier frequency.

unsigned int shootOne[] = {3000,6000,3000,2000,1000,2000,1000,2000,1000,2000,1000,2000,1000,2000,1000,2000,1000};

// the one confusing thing with the irsend.sendRaw command is that the last argument is labled hz, but it’s really
// kiloherz. The lazertag team ops uses the common 38kHz frequency.

For the TV-B-Gone, I modified the original firmware to send out the appropriate pulses, similar to my previous hack for camera remotes. The V1 firmware uses uncompressed codes, so that is what I started with.

Grab the example code zip here, and let me know on google+ if you build anything with it!

Also if you want to use Git to pull the code (whether or not you want to fork) it’s all checked in to the baldwisdom github repo:


Using GPS with AlaMode

We included a header for the UP501 GPS module on AlaMode.
The UP501 is popular, and has the additional advantage of having a PPS output which can be used to do ultra-precise timing.

Unfortunately we made a little mistake and reversed the silkscreen on the connector (documented in this forum article.) The actual orientation is actually quite logical the RX pin of the GPS lines up with the corner of the AlaMode.

Mikal Hart wrote a wonderful GPS library called TinyGPS

The GPS library doesn’t actually talk to the GPS module, but parses the output (NMEA statements) In this case, our example code uses the SoftwareSerial library (also by Mikal Hart!) to listen for the output and feed it to the GPS library.

The pins used in AlaMode are 6 (receive on the Arduino, output from the GPS), and 4 (Transmit on Arduino, input into the GPS module.) Note you shouldn’t actually write to the GPS module from the Arduino, as it’s a 3V module, and the Arduino’s outputs are 5V. It is, however safe to read.

SoftwareSerial nss(6, 4);

also in the setup() function initalize the SoftwareSerial for 9600 baud:


After that, you are good to go! Stay tuned, in a future post, we’ll have a guest blogger who will be using the GPS feature of AlaMode to build a compact WarDriving module.

Here’s a copy of the GPS example code, pre-edited for use with AlaMode:


AlaMode available for Pre-Order!

The Chinese national holiday is over, and production of Alamode has begun! Our current estimate is that they will be shipping on Oct. 25.

We’ve put up 50 units for Pre-sale on the Wyolum website, so if you want to be one of the first to try it out, sign up!

Raspberry Pi not included. Photo by Brian Krontz (

Repairing Raspberry Pi SD holder

Do a quick Google, and you’ll find a lot of people have broken their Raspberry Pi SD card socket. Justin Shaw and I both broke ours within 15 minutes of each other while chatting on the Internet. In my case, I put my finger on the card while unplugging the HDMI cable.

The plastic is very brittle on the SD card holder of the Raspberry Pi. This one broke off on the right side when it was dropped with a card in place.

Adafruit makes a nifty half length Micro-SD to SD slot adapter. If I had this to begin with, my slot probably wouldn’t have broken. When I saw it, I thought maybe I could glue it in to restore function to the broken Pi. Phil Torrone of Adafruit graciously sent me one to try. (Warning: It’s hard to fix this slot, and hard to find a replacement, so I really had little to lose, but it would also be easy to mess things up further. If you don’t fix your Pi, and end up with a glued in sd adapter you can’t use, I’m not responsible!)

There’s a gap between the bottom of the “Card” and the PCB, so we’ll need a space filling glue that sticks to fiberglass

I happen to have some 5 minute epoxy that I purchased on a trip to Japan. It has glass in the pictures, so I figure it will do.

I always get a little nervous at this step.  Mix according to instructions. Equal amounts of the two parts. It sets up in 5 minutes but you should leave it overnight before applying too much force.

Glue and Clamp. I put some along the edges of the socket (make sure you don’t get it on the contacts) and then placed the adapter, and dripped some in to the gap. You should probably wait over night. While it’s pretty solid in 5 minutes, it may not be totally bonded/cured for 24 hours.

Ok, I couldn’t wait overnight. after about 10 minutes I tried it. Hack Successful!

he finished project. You can’t use SD cards anymore, but micros are pretty easy to come by, and it no longer sticks out for you to apply leverage.


Simplified Setup for Arduino on Raspberry Pi

I just got back from the Open Hardware Summit and World Maker Faire. It was fantastic and I spent a day and a half doing demos of Alamode and the Raspberry Pi in the Makershed. I’ll have more on that later, but I got a lot of questions about setting up Arduino, and I realized that things have been simplified since my last blog post on the subject.

I recommend you download the latest raspbian (these instructions are for that version.)


After running through the setup (raspi-config) which runs automatically the first time do a:

$ sudo apt-get update
$ sudo apt-get install arduino

You used to have to get the avrdude and gcc packages separately and install them in an unzipped version of arduino, but there’s now an up-to-date package. This works out of the box with FTDI Arduinos, but Uno’s /dev/ttyACM0 and the Raspberry Pi /dev/tty/AMA0 aren’t recognized by the Arduino IDE. To do that we create some “udev rules” that create symbolic links to those devices that are named /dev/ttyS1 (uo) and /dev/ttyS0 (alamode) respectively.

I created a setup script to do the hard work for you (note the $ represents the command prompt, don’t type that!):

$ wget -O alamode-setup.tar.gz
$ tar -xvzf alamode-setup.tar.gz
$ cd alamode-setup

If you want to be ready to run Alamode, and the Uno run:

$ sudo ./setup

which disables logging and getty on the internal serial port (so you can use it to program alamode), sets up the /dev/tty links, and installs a modified avrdude that has a new programmer type, -c alamode. This should be completely safe, as I only and (I think properly) added a new programmer type, but I haven’t tested it thoroughly on other programmer types. It also sets up the board type for alamode in the Arduino IDE.

reboot to get rid of the logging and getty.

If you just want Uno support, type:

$ sudo arduino-setup

Here you probably don’t have to reboot, just

$ sudo udevadm trigger

If you want Bonjour, which will allow you to refer to your raspberry Pi on the local network as raspberrypi.local

$ sudo apt-get update
$ sudo apt-get install libnss-mdns

Arduino Setup instructions for Raspberry Pi

These instructions are for setting up an Arduino and alamode friendly environment on the Pi. Gathered from many sources (see earlier posts) and updated with the latest info.

Download and install Linux Image

Download the Black Raspberry Distribution from Adafruit:
DIrect link to the current (0.2 version):

Burn to your favorite sd card. Helpful tips at:

If you need to set up Wifi, or other things, follow the instructions at the first link above.

Configure your keyboard and Timezone

It’s difficult to edit config files when the quote key produces a different symbol.
Unless you are in or have a Great Britain keyboard, you’ll need to:

sudo dpkg-reconfigure keyboard-configuration
sudo dpkg-reconfigure tzdata


Serial Port configuration

AlaMode can communicate via the UART pins of the GPIO connector. Unfortunately, for now, the Arduino IDE doesn’t recognize the device name /dev/ttyAMA0, so you’ll need to create an alias. By the way, it also doesn’t recognize the Arduino UNO (/dev/ttyACM0) so you can handle this the same way.

sudo vi /etc/udev/rules.d/80-alamode-rules

KERNEL==”ttyAMA0″,SYMLINK+=”ttyS0″ GROUP=”dialout”
KERNEL==”ttyACM0″,SYMLINK+=”ttyS1″ GROUP=”dialout”

Next, disable logging messages:
This bit disables logging to the GPIO UART, so if you are using an Arduino via USB, it’s not necessary.

Edit /boot/cmdline.txt

dwc_otg.lpm_enable=0 rpitestmode=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait


dwc_otg.lpm_enable=0 rpitestmode=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait

deleting the two parameters involving the serial port /dev/ttyAM0
You also have to edit /etc/innitab to remove the login (getty)
comment out:

2:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100


Installing the Arduino IDE

Before getting any of the other packages:

sudo apt-get update

and again:

sudo apt-get update

The IDE is written in Java (based on Processing) and while Oracle doesn’t have an official Java for the ARM core in the Pi, the Open JDK has been ported. It doesn’t have a JIT (Just In Time Compiler) so it’s a little slower, but it works.
First grab the Arduino IDE code. 1.01 is heavily entwined with the native GCC toolchain, so is a lot more work and not recommended. For now, stick with 1.0.


tar zxvf arduino-1.0-linux64.tgz

The Arduino IDE is written in Java, but there are native parts to do compilation for the atmega328p  microcontroller. Fortunately those have also been ported:

sudo apt-get install avr-libc

sudo apt-get install libftdi1

sudo apt-get install avrdude


sudo apt-get install openjdk-6-jre

Serial support:

sudo apt-get install librxtx-java

And then copy the native stuff into the Arduino directory:

cd arduino-1.0

for i in $(find . -name “”) ; do cp /usr/lib/jni/ $i ; done

for i in $(find . -name “RXTXcomm.jar”) ; do cp /usr/share/java/RXTXcomm.jar $i ; done

cp /usr/bin/avrdude /home/pi/arduino-1.0/hardware/tools/avrdude

cp /etc/avrdude.conf /home/pi/arduino-1.0/hardware/tools/avrdude.conf

And probably reboot again, and then you should be good to go! Contact me on Google + and let me know how it goes!

Introducing Raspbery Pi à la mode

Our first prototypes are back, and working quite well! SeeedStudio fabricated the prototype boards and quickly sourced the parts.  The boards were of excellent quality. We ran into a few hiccups along they way, but Seeed Studio took care of them right away, and rushed to make up time.

If you haven’t been following, Anool Mahidharia, Justin Shaw and I from the OSHW collaborative have been developing a stackable Arduino compatible for the Raspberry Pi.

While there are lots of emerging examples of interfacing hardware to the Pi, it’s just not as easy as the Arduino, and the Arduino already has hundreds of libraries for interfacing with motors, sensors, and displays. While you can always plug an Arduino into the USB port, but it’s not as neat and embed-able as a a GPIO interfaced board. You can write a program on the Pi in any language you want to control or monitor your Arduino application, making Internet integration and control super easy. In addition you can even program the AlaMode directly from the Pi.

Here are the features including a few extra goodies:

  • Flexible power. Can be powered directly from the Pi, standalone with a battery or wall-wart, or USB power. This is important if your shield takes more power than the Pi can provide or if you want to undock it for standalone operation.
  • Programmable via the Pi’s UART on the GPIO pins, or an FTDI USB-Serial adapter or ISP.
  • Header for connecting Fastrax UP501 GPS.
  • DS3234 Real time Clock. The Pi doesn’t have it’s own battery backed RTC. You can set a program in the AlaMode to report the time to the Pi via serial or I2C
  • Micro-SD card slot. Useful for datalogging, and big-memory  for your Arduino applications
  • Row of Servo Headers connected to the PWM pins with a configurable power and ground rail

We’re in limited Beta right now, but as soon as it’s thoroughly tested, we hope to produce them for sale as soon as we can!