Advanced Pinoccio

In doing some work recently I had the pleasure of obtaining a bunch of new scouts — Internet of Things Arduinos! The Lead Scout has wifi and talks to the other scouts nearby via mesh networking (non compliant Zigbee sadly). After playing around a bit I came to the conclusion that I liked the hardware. As opposed to the Spark, these are truly Arduinos. In addition to a nice webshell (via bitlash) and set of API’s you can write code as you normally would right within in the Arduino IDE. This is in stark contrast to the Spark which emulates Arduino from an as yet unfinished web IDE where libraries are largely not yet ready. It’s worth noting that I think the Spark is my long term bet, but in the short term our hackerspace has been lousy with the Spark and nobody’s doing anything with them. That said I found the prototyping shield not enough room to play in. I wanted a full development environment so I set out to create one.

How to run Pinoccio in Atmel Studio 6.2 (IE for simulating and step by step debugging):

Make sure you have the Arduino files (go with the nightly build Pinoccio recommends) installed at: C:\Program Files\Arduino

and the Pinoccio libraries and hardware installed at:

Now for the Atmel Studio setup. The full description for how to do this in general is up at Engblaze, but I’ve done the hard work and uploaded a completed 6.2 solution to Github.

Unzip it to C:\Users\XXXX\Documents\Atmel Studio\

Open it up and you should be able to simulate and debug your bootstrap code!

How to burn an Atmega256rfr2 Xplained Pro or other breakout as a Pinoccio from within Atmel Studio

Atmel makes a breakout for the Atmega256rfr2 called the Atmega256rfr2 Xplained Pro.  It doesnt have the Fuel Guage, or FTDI chip for serial communication, but its a great breakout with onboard debugger and plenty of room to work.

First, you’ll need to set the fuses. Look them up and set them in Atmel Studio.

Other than that everything is the same as above except I had to make one change to halFuelGauge.cpp because it’ll hang trying to talk to our non existent fuel gauge:

unsigned int HAL_FuelGaugei2cRead16(unsigned char address) {
int data = 0;

// Wire.beginTransmission(MAX17048G_ADDRESS);
// Wire.write(address);
// Wire.endTransmission();
// Wire.requestFrom(MAX17048G_ADDRESS, 2);
// while (Wire.available() < 2)
// ;
// data = ((int) « 8;
// data |=;

return data;

Now just burn that image.

To actually talk to the board you’ll need to add an ftdi friend

From the Pinoccio definitions we know the serial pins are RX to PE1 and TX to PE0 and black to GND.

Now you can open up your serial port and you’ll see the bitlash command prompt just like it was a real Pinoccio!

NOTE: if you want opening serial to reset the board, you’re going to have to add in the reset line. Note, however, you’ll need a .1uF capacitor between your RTS on the ftdi friend and the RSTN pin.

How to have your Atmega256rfr2 discovered by HQ as a real boy Pinoccio

This is pretty difficult. Before you go any further, know even I haven’t successfully done this yet.

First you need to buy and hook up a MAX17048 / MAX17049 fuel gauge breakout. Test without the code from the previous section commented out and make sure it all works, or at least doesnt freeze the sketch trying to find it.

Next, you need to have the bootloader burned on to your Atmega256rfr2. 

You can find a hex to burn from Atmel Studio in the Pinoccio Github and again make sure to look up and program the fuses as before.

Or you can hook up an ISP programmer using the pin definitions as guide and burn it right from Arduino, knowing it’ll get all the fuses itself.

Now that you have a bootloader you can upload the Examples->Pinoccio->Bootstrap sketch right from Arduino.

Finally you’ll need to either edit the Pinoccio HQ Chrome Extension with your FTDI’s PID and VID set to be Pinoccio (VENDOR_ID 0x1d50, PRODUCT_ID = 0x6051), or burn a new PID and VID to your FTDI with FT_Prog. Since Burning a VID and PID didn’t work for me (the drivers still didn’t really think it was a Pinoccio) I’d suggest the Chrome Extension route.

Go to Chrome Extensions, and turn on Developer Mode in the upper right corner. Then find Pinoccio. Disable it and look for its id like njhfipeehmigebbdfbingghcjdfmjeai.

On my Mac I found the files at  /Users/XXXXX/Library/Application\ Support/Google/Chrome/Default/Extensions/njhfipeehmigebbdfbingghcjdfmjeai and copied the version named folder out to the Desktop.  Windows folks should find their folder in a more Window-sy location.

Now edit the manifest.js file to add your FTDI’s vendor and product ID like so
“usbDevices”: [ {
“productId”: 24657,
“vendorId”: 7504
} ,
“productId”: 24577,
“vendorId”: 1027

Next, open up the pinoccio.js file and swap out the pid and vid at the top for yours.

Now, back in Extensions, click the load unpacked extension and select your file.

Lastly, you’ll need the capacitor on the reset line as described above because the Extension will want to reset the board. 

Now head to It should find your device, decide its out of date, and hopefully successfully contact the bootloader to upload a new Bootstrap copy (hence the need for us to have a working fuel guage since we don’t have room to comment anything out here)

Let me know if you get this to work, as again, I haven’t!

iFirmata now in the App Store


iFirmata hit the Apple app store today! iFirmata lets you connect to your Arduino to your idevice via a BLE connection (Xadow or RedBear currently) using the awesome open source Firmata protocol.

It lets you connect to your Arduino and do all the things you could normally do over the wire with Firmata including digital write a pin high or low, read analog values, set PWM or servos, send i2c commands to devices or trigger custom scripts using the send string function.

Check out this hastily made video that I had to do in order to get Apple to approve it.

Of note, I put a $5 dollar price on it. Besides the months these side projects of mine are taking, dealing with the app submission is getting to be tiresome and my new resolution is to never put something in the store for free without a very good reason. If you know what Firmata is you’re probably interested and willing to throw me 5 bucks. If not its all up on Github so grab a copy and build your own. And when you’re done prototyping grab my source and make your own app. If you’re REALLY poor contact me for a promo code.

Of note, you CAN get Firmata to connect over BLE on a Mac by using 10.8 or greater and pairing your BLE device which binds a tty. However, thats a bit hacky at least for application usage. My implementation should work on macOSX with very few changes but I haven’t gotten to it yet. Send me some pull requests to kick me in the butt.

Body Jewelry / Wearable Electronics Adhesives Roundup


Colin and I needed to find some way to attach wearable electronics to the body for body jewelry and wearable computing type applications. Eventually we hope piercing and other body modification technologies will allow us to do permanent attachment, but despite recent articles on people using sub-dermal for the task, they’re are WAY to prone to rejection to think about hanging things off of them. Sub-dermal magnets, too, come up short currently as they destroy the skin when paired with an external magnets/ferrous objects.

So what we needed was a double sided adhesive that stuck well to FR4 PCB boards, had a foam type carrier (ie it was thick) so some electronics could sit flush, and was something we handle and package reliably.

TLDR - You can’t beat medical grade adhesives from 3M. They stick more reliably than anything else, and can be reapplied if they are removed. We sampled basically all of them and found them frankly equal for our purposes. However, only one had a foam carrier, good old 4133 med spec tape packets pk000023198. (update: these used to be called 3M Venture #7432M and you can actually find them by googling for that) After you sample they’ll refer you to a ‘converter’ who will actually die cut and or sell it to you, though we still haven’t been able to get a quote out of our local converter.

There were other adhesives worth mentioning but which didn’t fit our application for whatever reason.

We tried everything from the hardware store. Largely they didn’t work well at all:

  • 3M foam tape. Seems to be rubber and acrylic versions if you dig deep enough. Acrylic is way more common and might have seemed stronger, but not by much. Digikey stocks 4026, the stronger version, which we liked best of the hardware store tapes.
  • 3M VHB is also apparently acrylic, but didn’t work well for us.
  • Carpet tape from hardware store didn’t work at all either.

Theres also toupee tapes/bra tapes which all seem to be identical. They’re very thin double sided tapes but worked very well. Im not sure how different from any other double sided tape from Staples, so thats left as an exercise for the reader. They claim they’re hypoallergenic so the adhesive is probably not latex.

We also tried every kind of prosthetics/medical adhesives we could get our hands on. All had a similar issue for us of being unwieldy to package and apply, but would work great for any other application:

  • Pros-aide, Pro adhesive or Reel Magic (a hundred names for the same product) - a prosthetics glue used in costuming and makeup. Its thick and milky like paste. A good hold. Most claim to be latex free/hypoallergenic.
  • Tensive - A conductive gel (might be interesting for some application?) normally used for TENS/TEMs devices. Had a pretty good hold.
  • Osto-bond - Latex based so some people, surprisingly including me, might be allergic. Was pretty good though otherwise.
  • Skin tac. Very thin and watery. Leaves a tacky membrane to stick things to that wasn’t as strong as other options, but could be good for plastics or something. Also, hypoallergenic as its latex free.

Toxicity, Inclusivity, and Community Size

I’ve been struggling with the topic of toxic communication and poisonous people in our community spaces for years now. Only recently though have I been able to start collecting my thoughts and looking for answers. Today I saw that Openfly wrote an interesting article on titled "Redefining Hackerspaces" which jived well with my scribblings. I don’t want to put words in his mouth so instead I’ll quote some of the conclusion:

"We need to accept that trust networks don’t scale beyond a certain point. That trust is built on some commonality. That a community cannot be all things to all people."

I’m beginning to come to the same conclusion, that community spaces that don’t have the resources or the goal of becoming a place that pays (trained) staff CAN NOT be (radically) inclusive…

In an ideal world we should be able to communicate our grievances, work beyond our differences, simply avoid (and NOT sabotage) those who we don’t mesh with — all while still getting shit done. Sadly, our society (and thus our community spaces) don’t seem to work that way.

We’re seeing more and more toxic communication in our communities online and off. Tons of talk of twitter, reddit, hacker news, and other communities being toxic. We’ve got new newspapers and blogs removing their comments sections (finally). We’ve got every major tech conference the past few years with a big sexual harassment ‘scandal’. And in my world, huge problems in our community spaces with angry people seemingly measuring how toxic they can be against how much value they bring in.

Many people will say its just our demographic. Males, Nerds, Engineers. 18-24’s. But it sure seems to transcend into politics, religion, and all other quarters of our society. In the end it doesn’t matter, because we are in tech and thats our demographic whether we like it or not.

Ask anybody who served on the board of our nonprofit hackerspace HeatSync Labs over the past 2 years, and they’ll tell you they spent approaching 0% of their time envisioning and executing on what kind of awesome nonprofit we should be and instead spent all of their time babysitting and psychoanalyzing a CONSTANT (albeit minority) population of angry members.

Why are they so angry at this person, their project, or the way they they were spoken to? Have they tried talking to them? Have they tried not yelling at them? Have they offered to help? Were they broken up with recently? Are they having problems at work?

And thats all just to stay afloat, let alone make a dent in the problem.

As a result we’ve got the policy and administrative types screaming at us to make more rules in order to deal with all the jerks.

However, I hope we can think critically and see that rules don’t make unhealthy people healthy.

I’m not sure theres any way to make unhealthy people healthy than doing the hard work of sitting them down, forcing them to view their actions, and ESPECIALLY if their actions are getting them the results they want. And if we find that what they really want is to pain others, then we have the unpleasant (and increasingly impossible) job of removing them from our communities—rules or no rules.

Sadly all this takes energy, time, and pain which LITERALLY the opposite of why we come to communities. In fact, thats the kind of deep conflict resolution that frankly takes training and experience.

Thats why I’m starting to agree with Openfly’s conclusion that communities should not (frankly CAN NOT) be (radically) inclusive, at least not without paying staff as community managers, mediators, and at the end of the day authorities to make decisions and remove people from the community.

I’m not saying HeatSync (or your community here) have to pay community managers, but I am saying the only other option I see is to start getting less inclusive. Smaller like-minded communities (somewhere < the tribe number) who share life experiences, ways of talking to eachother, and to some extent political views will still find strife and toxic people, but are seemingly WAY more capable of communicating with eachother while still actually getting shit done— which is what we all came here for in the first place.

LED Light Strip Hacked for Haptic Motors


Last week I got to talk at about my most recent hack, a flexible haptic strip that easy for anyone to use, at Hack N Tell Round 25 in NYC.

In between working for ASU’s Cubic lab on a new haptic strip, I was pondering ways to bring haptics more to the forefront. Sure you can buy a bare motor or lilypad motor from Sparkfun or elsewhere, but in practice they’re a total pain to get working. You need a transistor and its a pain to mount them anywhere you’d want them — Especially when motors are only really fun when you have a few of them to play with. And lets not even address the cost of say 10 of these modules!

Then it hit me that the cheapest motor driver chip I could buy would be the <14cent WS28XX series LED drivers that get used on LED light strips!

Now, it’s not necessarily THAT novel to use LED drivers to drive motors. Many people, including myself, have done it before, but I realized theres no reason I couldn’t use the same flex PCB process as LED strips as a form factor as well.

I don’t yet know how to do flex PCB, and theres is no OSHPark for flex PCB yet :) (paging laen) So I just found an LED strip on ebay that used a common driver chip I liked, that wasn’t integrated into the LED which is really common nowadays, and wasnt potted with epoxy or anything.


The strips don’t need many changes for motors. Just pulled the LEDs off and put a motor across one of the 3 channels, top to bottom. You can also add a little LED across one of these channels as well to get visual notification. Finally you’ll want to use a multimeter to figure out which resistor hooks up to the motor so you can swap that resistor off for a shunt—You’ll want as much current as the driver chip can give you. In the future you may want to add some motor protection with a flyback Schottky diode across where you put the motor to protect the LED driver chip.

The additional beauty is theres already a great Arduino library called fastSPI to run these! Just follow the directions for LED light strips. SCK to Pin 13, SDA to Pin 11. They should work on 3v or 5v but I’ve been running mine at 3v with more wearable Arduinos like the Xadow and Fio V3.

And just like LEDs you can simply cut the strip anywhere you want, from 1 motor to 32, your choice!

We’ve tried them in baseball caps and arms and legs. I think they’d work well sewn into a bag strap. Let me know what form factor you try! And hopefully in the future I’ll be able to get them produced for cheaper than hacking them from ebay :)

Lasering PCB enclosures

This week I used the laser to cut some holes in my enclosures to make way for switches, light pipes, etc. My previous attempts pre-hackerspace (with a dremel) were.. rough.

There had to be a better way! The big problem with using the laser was jigging the case in the laser in such a way that I could reliably and repeatedly cut in the perfect spot. After a few attempts I found a solution.


First I exported my front board dimension and mill holes from Eagle using run -> dxf.ulp, opened it in our laser program, mirrored it and adjusted some holes and sizes.


I grabbed a square piece of stock and dropped up the in the upper corner of the laser and homed the laser head. Now, by lasering that outline on my stock, I can take it out of the machine and put it back in the same place every time.


I can also match the PCB up over the top of the etch.


And, finally, since the PCB is designed to fit the case perfectly, I can just drop the case on top of the PCB.


Wonderful. I could still use a method to cut cleaner on the other 4 sides, but for now Im happy doing a little bit of clean up work and having my cuts be entirely though the case.

Pebble review

Colin loaned me his Pebble until he gets back into town next month and I haven’t seen anyone else in our circle review it, so here goes. 

Who Needs the Time?

First some setup. I don’t wear watches and almost never have. Its a modality I think underutilized and one I’ve still intend to design for, but the truth is I haven’t found anything with enough value to wear on my wrist over the 31 years of my life.

Thus I was incredibly surprised to find that after even ONE day of Pebble usage, I felt naked without it.

Fit, Finish, Setup

First the boring stuff. I’ve found the watch to be very pleasant I’m proud to wear it on my wrist daily. It does slightly rotate off my wrist which I find annoying, but perhaps this could be solved with a new or longer watch band.  Further I’ve found the build quality to be pretty good. Theres a slight rainbow-ing on the screen apparently due to the glue process, but I can live with it. 

It was extremely easy to set up. I’m sad to report that as usual the locked down iOS ecosystem loses out on the majority of the notifications, only receiving phone calls, texts, and music information and control. Even though it sounds limiting, thats actually enough for me to recommend the pebble with just those few notifications. However, I went the extra mile and used my jailbreak to full push notifications which I highly recommend.


It turns out Music is one of my favorite features. I listen to podcasts constantly and people typically approach me have to wait for me to dig into iPhone menus in order to pause my audio. With the watch, I found I actually kept my screen on the music control app, rather than the watch, and could, with one button press, pause and play my music. Handy!

Vibration alert

What REALLY surprised me about the watch, however, was how blown away I was by the vibrator in the watch. Most people know that I’ve been doing research and development in haptics for several years now. I obviously understand the benefits of haptics and am somewhat biased, but I was curious to see what I’d think of the real world implementation.

I immediately found it incredibly freeing. As we all know phantom vibrations have completely poisoned the haptics well when it comes to our phones. We can’t leave them on vibrate because in the back of our mind we know that is as good as turning them off. 

With vibration on my wrist I found I didn’t worry about missing anything on my phone and I was happy to silence it permanently. I also loved using vibration as my alarm. I hate alarms and they don’t tend to even wake me up so adding vibration to my wrist really was a fun and new way to wake up. It should be noted that Pebble actually deals with alarms in its own OS, not in iOS, but besides this setback I found alarms easy enough to set and delete.

I did, however, find one big problem with using the watch as an alarm.

Battery Life

I’m sorry to report I’m getting only two days under typical use. Im not sure if thats backlight, vibration or bluetooth communication issues, but I’m ready to sacrifice something, ANYTHING, in order to get more battery life. They may be able to patch some of this in, but its definitely the weak point of the system. (ed. note: battery got SIGNIFICANTLY better just weeks later. Not a problem anymore!)

This is worsened by the need for a proprietary magnetic charger cable. I have to keep yet one more cable, or more likely I don’t have the cable I need and theres a useless monolith tied to my wrist all day.

Wrap up

In conclusion if I have anything negative to say about the Pebble is I feel they may have done too much, which is not surprising the way it was scope creep developed in public. Battery life seems to be suffering, charging suffers presumably due to the need to get water proofing at X feet deep, etc etc. Maybe eventually we’ll be able to disable some of the software based features in order to save battery life, but right now we’re stuck.

That is we’re stuck with a device which can’t call anything other than incredible. I can’t image what I’m going to do when I have to give it back to Colin.

Card Reader Roundup and Teardown

Recently for a client project I needed to read credit card data to an Arduino. It didn’t seem like it would be too hard or expensive since square gives out readers by the handful for free. I was only mildly familiar with the technology so I turned to wikipedia who told me the data is stored on Looks like track 1, format b.

A quick search on Sparkfun for an existing solution found their offerings to be HUGE and expensive! We wanted to embed some solution in a phone size package. Why is square able to make them so small and give them out free? Thus began my journey to destroy every card reader out there.



First a little googling led to a teardown of the original square readerI still tore mine apart anyway and found the same thing they found. The reader is literally a tapehead positioned perfectly to hit track 1, nothing more! Not even an amp!  Basically they did as much in software as they possibly could. Good job!

We wouldn’t be using a phone jack in our solution and wouldn’t have much processing power for cleaning the signal, but we spent some time trying to amp the signal and read the data. The signal was clearly evident and ampable, but our timeline didn’t include reinventing card readers.

Much later in my research I actually found an amazing talk from the Square engineers which explains everything. Its a must watch. 

In my research I found that Square had actually updated their model to add encryption. The update was touted for security, but I have trouble believing someone could man in the middle your headphone jack. A much more likely reason is using encryption to lock out the rise of the copycat mobile payment solutions like Intuit and Paypal. And of course to stop people like me from tracking down and repurposing handfuls of them.


We surveyed our friends and found one of them in the wild to crack open. Sure enough theres now a coin cell battery and TI micro in there and the signal is nonsense.

INTUIT (circle)


The first Intuit reader I took apart was THEIR v1 as well.


It used a e42407bj from Magchip and a f1936 from Microchip that seemed to either be for encryption. Some digging from my partner Tim turned up a similar part at IDTech that was very close to what we had which showed it actually output serial! Clearly they were simply in a rush to get to market and repurposed some existing silicon. Pricey for them, good for us.

I tried to locate more readers for cheap, but they were on their v2 now.


When I finally tracked one down and tore it apart they’d transitioned off the Magchip chip for a custom solution with encryption :(



So close!!!

The PAYPAL (triangle)


The Triangle is the most beautiful device of the bunch. The front cover is actually removable — presumably for rebranding? The case, however, is impossible to get open. You can see my hacksaw damage in the photo above.



Inside it looks a lot like these other second gen readers though with a ton more passive components. We’ve got a 8L151G ST Micro and an op amp package 6l04ste from Microchip. Presumably reading the signal and encrypting it for their app.

Again it makes this device not at all hackable and shows nobody going into this business at this point is going to leave their devices open any more.


At this point Tim just looked up magchip readers and we found another company called Magtek. It turns out they actually have a fully implemented chip and tape head solution that outputs RS232They’re something like $15-25 in low qty which meant if we were doing anything other than a functional prototype they’d be no good, but they would fit our custom solution just fine. We were able to successfully implement the Magtek solution with no real problems and were very happy with the responsiveness. Sadly I didn’t write the code, so if you want to see it please hassle Tim into posting the code he wrote so you can benefit from our work too!