DIY Scratch I/O Board Using Arduino

Scratch Project that I used to test the DIY Scratch Sensor Board

I downloaded Scratch to play with it after a presentation on E-Textiles at UPenn back in April.  I found it kind of interesting, and I was particularly interested in the “Scratch Sensor Board“, which provides a way to send physical signals into Scratch scripts and have Scratch respond to them.  It’s a pretty simple protocol, and I filed away “build a Scratch sensor board” as one of those projects that I might do … someday.  Well, nothing like being stuck at home during a major weather event to crank up the boredom level to the point that ya gotta do something.  So, courtesy of Hurricane Irene, here’s a DIY Scratch Sensor written as an Arduino Sketch.

This sketch uses information that you can download here.  You may need to use the Scratch Board Watcher to get things cooking 100%.  For example, this is how I learned that the sense of the Button input is inverted.

/* 
This code emulates a Scratch Sensor board
*/

// --- sends serial bytes corresponding to a signal with value given by "data"
//     coming from the channel designated by "channel"
//     data is in the range 0 .. 1023 inclusive and generally gets mapped to the range 0 .. 100 by Scratch
void sendScratchData(int channel, int data);

int buttonPin = 2;   // Change this if you want to use some other pin for the Button input. Just don't use pins 0 or 1.
int ledPin =  13;    // LED connected to digital pin 13. I used this just to monitor the request/response traffic

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);   

  // Set baud rate expected by Scratch sensor:
  Serial.begin(38400);
}

void loop()
{
  int inByte;
  // if we get a valid byte, send the scratch data
  // Technically, we should check that the value is a 0x01 byte,
  // but, meh ...
  if (Serial.available() > 0) {

      // toggle the LED so that we can see the request/response activity
      // this is optional, really
      digitalWrite(ledPin, ~digitalRead(ledPin));

      // get incoming byte:
      // we really should test the value, but meh++
      inByte = Serial.read();

        sendScratchData(0,analogRead(0)); // Resistance "D" is mapped to Analog 0
        sendScratchData(1,analogRead(1)); // Resistance "C" is mapped to Analog 1
        sendScratchData(2,analogRead(2)); // Resistance "B" is mapped to Analog 2
        sendScratchData(3,digitalRead(2) * 128); // Button is mapped to Digital 2
        sendScratchData(4,analogRead(3)); // Resistance "A" is mapped to Analog 3 
        sendScratchData(5,analogRead(4)); // light is mapped to Analog 4 (signal is inverted)
        sendScratchData(6,analogRead(5)); // sound is mapped to Analog 5
        sendScratchData(7,0); // slider did not map slider, but any analog input could be moved here.
        sendScratchData(15,4); // version info The current version is 4
  }
}

void sendScratchData(int channel, int data){
   byte highByte;
   byte lowByte;
   data = data & 0x3FF;
   highByte = 0x80 | (channel << 3) | (data /128);
   lowByte = data & 0x7F;

   // --- send the data
   Serial.write(highByte);
   delayMicroseconds(400);
   Serial.write(lowByte);
   delayMicroseconds(1000);
 }

Neighborhood Cleanup 9/5

le broom

The block on which our building for our space sits is a bit of a… wayward soul. There is a lot of garbage tumbleweeding through the street, giant weeds poke up through the sidewalk everywhere, and a smattering of graffiti makes someone’s presence known.

Well, we’ve decided to clean it up. All of it. Next Sunday, September 5th, from 12pm to 5pm, we’ll meet at the space and just start doing. We originally planned to do it this weekend, but the IMPENDING DOOM NAMED IRENE has forced us to postpone.

Bring what you can, plastic garbage bags, shovels and rakes, brooms, leftover paint, etc. Don’t forget some heavy gloves, there are a lot of broken glass and other sharps in the area.

If you can’t make it to this date but still want to help out, we will have other dates in the near future, so stay tuned to the blog for future announcements.

Open House 08/24/2011 Recap

For Wednesday’s Open House, we experimented with using simple, house-hold items to etch common, metallic objects. We found that candle wax, melted in a thin layer on the surface to be etched, worked as an excellent resist material. The firmness of the wax helped to keep the scratch lines straight, while the thickness of the paperclip made for a consistent stroke. We also tried acrylic paint as the resist, but it quickly dissolved under the cotton swab. We also tried the ink of a permanent “Sharpie” marker, but that was also easily dissolved under the cotton swab. We had other resist materials available to us, but these were the only ones that were “household” items.

Once the resist is set and the design is scraped out of the resist, the anode (negative terminal) of a 9v battery is attached to a bare metal area of the object, and the cathode (positive terminal) is attached to a cotton swab soaked with very salty (NaCl, common table salt) water. Within a few seconds, the electrolysis process creates a weak hydrochloric acid solution that eats away the steel of the object. After etching to the desired depth, the polarity of the connections can be reversed to oxidize the bare metal, as the now-anode cotton swab will produce oxygen molecules out of the electrolised water.

Here are some photos of our efforts.

Wax was at first a little difficult to scrape away consistently

 

I etched a little wine glass on my bottle opener. I believe this is nickle-plated zinc, hence the pinkish-brown color.
Matt made a negative etch of our hexagon on the bread box.
Brendan added a classic message to our bread box.
I managed a very clean etch of my monogram on my pocket knife. After etching to the desired depth, I then reversed the polarity of the setup to achieve the black color of the letters.

 

In addition to the electro-etching, we also had some fun toys to play with.

These Nintendo Wii-motes that Brendan is smashing apart will eventually become wands to be used with a Smart Board.
Brendan acquired a sick, Russian, night vision scope.
Brendan cautions one against extended exposure to the eye-piece. Apparently, the USSR did not feel the expense of leaded glass in front of a cathode ray tube was a necessary extravagance for their soldiers.
I found this circuit. I have no idea what it does. It looks to be audio related. Maybe an amp?

 

And then I just had fun taking photos of stuff.

Oscar Mike Golf! We have books!
We actually do occasionally receive post cards. Please! Send us more!
Okay, I showed up in a photo somewhere. Back behind the camera now.
We have one of the best views in the city.

 

Stop by next time when we bust out the big guns and… it’s a secret! Come by and find out!

Art at Hive76

It’s not all about circuits and microcontrollers and chemistry at Hive76; we love art and we love making art in an incredibly dynamic environment that has become a second home for many of us. With the hustle and bustle of an active workshop, not a lot of people notice the artwork scattered around our humble space. Some is from our members, some is from artists in our building, and all of it is a delightful expression of the duality of art and engineering that makes us what we are: hackers.

Background: photo of statue at Hoover Dam. Foreground: our stereo for all da beats.
A note left by some friends
A bad joke. So bad, it's wonderful.
The origin of this print escapes me at the moment, but I definitely love it.
A few prints of Philly's own City Hall
A colorful selection of whimsical 3D printed objects.
Even a piece of cardboard is art in the right context.
An unfortunately blurry of an intriguing concept. Samples of textiles as if they are samples of microbes, or insects.
Urban abstract, from our favorite neighbor, the one we know as "G"
Electrically conductive painting with surface mount LEDs. Unfortunately, the lights no longer work.
Another conductive ink print, an earlier prototype for the previous print.

 

MAKE Blog Love for Dave Sharp

One of our members, Dave Sharp, recently showed up on the MAKE Magazine Blog in their post on the Lockheed Samarai. You can see Dave piloting the maple-leaf-inspired drone in the video after the jump.

Dave joined us back in early February of this year. He does amazing work with raw fabrication of contraptions. For our exhibits at the PAFA “Grossed Out” event, he built a giant pantograph used with a USB-microscope to etch small designs on microscope slides. It was one of the most complete “DIY” builds I’ve ever seen; extremely clean and professional. Just like Dave.

We love having him as a member and look forward to seeing what else he comes up with.

Open House for 8/24

I etched my monogram on my zippo earlier today.

This Wednesday night, during Open House, we’re going to be doing some basic electro-etching. The technique is very simple–requiring little more than a 9v battery, some wire, a cotton swab, some salt water, and nail polish–and takes very little time to get very good results (actually, it works so quickly that you have to be a little careful of eating through thin materials).

I did this earlier today with the back of my Zippo, though I was a little sloppy and went a little too long. I’ll be trying this out with a knife blade on Wednesday, as well as the lid of my computer. Bring your stuff in and let’s have some fun personalizing our stuff.

Open House 8/17/2011 Recap

It’s been a while since we’ve had something to talk about for Open House! Believe me, I missed activity at Hive76, too. But that’s what happens in the summer, people jaunt away to far off lands for this thing called “Vacation” and forget to send us post cards. You wouldn’t forget to send Hive a post card, would you? (HINT: Our address is Hive76, 915 Spring Garden St., Suite 519, Philadelphia, PA 19123)

Ira Laefsky, Mike Hogan, Ben Sautner (developer of Nimbits, a “free, social and open source platform for the internet of things on the cloud”) and I had a lively discussion on The Internet of Things. Right now, it’s a very informal group of people interested in such things as home automation and data aggregation. If such things interest you, use any of the means available here to contact me and we will get you on the mailing list.

We have a new membeeeeeeerr! WHAAT? We totally did. Everyone give a big, ol’ “Hi-diddly-hey, neighbor” to David Morfin!

Mighty Morfin Power Ranger
Mighty Morfin Power Ranger

A bunch of faces where in our spaces last night.

Chris shaved his beard and wore contacts. He looks so young! Le rarrrr.
Mike has perfected his privacy security measure, dubbed "Quantum Head Rattle".
Jordan got pregnaaaaaaaaant! WHAT?! He totally did.
Brendan is auditioning for the part of STOP TAKING PICTURES OF ME!!!

And I forgot to get any pictures of myself. Guh, sorry. I know you miss me.

I’m working on rebuilding a toy electronic keyboard:

The case was busted, so I'm building a new one.
The original circuitry. I'll probably have to replace the amp, it's weak.

And we also played with some glow in the dark tape and an ultraviolet flashlight.

Also, take note, we’re going to be restarting the Open House Mini Projects very soon. I’ll post a more formal announcement later, but look forward to custom etching anything you own that is metallic!

Philadelphia Geek Fest


Hive76 desecrates the Philadelphia Folk Fest Logo

Friday was a bust — weather was bad and I unexpectedly got stuck at work.

Saturday was, by objective measures, not a good day.  We had almost no traffic at our spot and one of Matt’s giant QR posters went missing sometime during the day.  But it was a good day .. for whatever unfathomable reasons.  Matt and Chris showed up with a RepRap  and had live 3D printing demos for hours.  We ended up giving away a plastic octopus to some jewelry vendors that we met at random when they parked on my lawn.  The solar weenie roast worked reasonably well (film to come) and we got an MSP430 POV working to display the message “HELLO ARLO”  (film of this on the way as well, you can find source code here).  Matt and Chris used the UV flashlight and the glow-tape pad to design the 5×5 fonts that we used for the POV — it was ingenious.  They would draw the character and when I saw it, I was able to work out the hex codes in my head.  We also used the fresnel lenses to turn ordinary LED flashlights into blinding search beams — when you take even a small light source and focus it to a beam, it’s shockingly bright over surprising distances.

Sunday — who knows — things are fluid

I think we’ll try to do this next year, but with a bit more preparation .. and Matt suggested maybe we can get on the fairgrounds proper to do our thing, which I think is a fine idea.

We will be on this corner

Build Your Own Open Source 3D Printer

Build Your Own 3D Printer!

ONLY ONE WEEK LEFT TO SIGN-UP!

In collaboration with NextFabStudio, we are offering a state-of-the-art and upgraded RepRap printer kit and accompanying 3-day Build Workshop from August 26th-28th. The class cost is $998 ($1,200 for non-members) and includes EVERYTHING you need to get up and running, and more importantly, a fully calibrated and fine-tuned robot.

CLICK HERE FOR MORE INFO AND TO SIGN-UP

Check out the time-lapse video below from our first class in Baltimore where we got 10 printers up and running in 3 days.

We’ll help you and a friend or two to build your very own open-source RepRap 3D printer, which has more than 4x(!!) the build volume of it’s closest competitor, the MakerBot Thing-o-Matic. Note that you will save $202 off the class if you’re a member of Hive76 or NextFab Studio. Total class cost for members is only $998. This is a crazy cheap deal! You can’t even buy a MakerBot for that price, let alone learn how to assemble it and fine tune it correctly in just a weekend.

There’s lots of additional bells and whistles on this bot that you won’t find anywhere else: custom machined aluminum motor couplers, linear bearings, the latest RAMPS electronics, and much more!

Any questions or concerns? Click Here to contact Jordan.

First RepRap World Tour 3D Printing Class from jmil on Vimeo.

Wide-Baseline Stereograms

Thanks to all who attended our first stereo photography class, it was a great turnout with several new faces! If you attended, here is some content that I just created that you can view using either the anaglyph glasses or parallel-viewing stereopticon that you received, or if you have been practicing up on your free-viewing, you can use the cross-eye method or “look-through” method (just set the 3D settings appropriately towards the bottom of the video on YouTube). I’ve created a slideshow of 3D images captured using wide baselines — in other words, the two photos making up each 3D picture were taken very far apart, much farther apart than the distance between a human’s eyes.

So, why wide-baseline? Well, the sense of depth from stereo vision is highly nonlinear, so we generally have exceptional depth perception up close (within a few inches or feet), but we are able to differentiate less and less as the objects get further away. In everyday life our depth perception due to binocular disparity is basically limited to around 20′ or so for most practical purposes. (This is why 3D pictures of landscapes are usually extremely boring and flat — the subject is too far away to make out the depth!) However, it is possible to overcome this limitation by moving the two cameras (one for each eye) farther apart. Some of these images were taken from airplane windows hundreds or thousands of feet apart, making it possible to discern depth between cloud layers many miles away. This tends to produce an effect that is similar to examining a miniature model of the subject up close.

Most of these 3D pictures were captured with the video camera on my phone while on a moving platform (train, car, airplane, etc), with the camera held very still up against the window and facing directly out. I would then open up two copies of the captured video side by side and use the cross-eye method to find two frames of the same subject that provide good depth. I would then copy those frames into Gimp, align the images and crop them down to produce a finished stereogram. It takes time and practice but it can produce some really cool results!

Boats outside Dave & Buster's on the Delaware River. Click to view entire slideshow