Categories
Uncategorized

The Future of Open Source (Part II)

Open Source

In our first piece, The Future of Open Source, I talked a bit about hardware, and touched on community, as well as mentioned a few specific companies. This time I’ll talk about specific pieces of hardware.

Let’s start with the Arduino. The Arduino is probably the most successful piece of open hardware. There’s an estimate of 300,000 Arduinos “in the wild” as it were, and if that does not count “official” Arduinos, I can see that number easily being double.

Recently Phillip Torrone published an article titled: Why the Arduino Won and Why It’s Here to Stay:

While it’s nice that Arduino is open source, and commercial use is allowed if you make a clone, it’s not the biggest reason, which is why it’s down near the end of the list. However, that isn’t to say it doesn’t matter at all. Specialized derivatives can be made without paying someone or asking anyone. It’s open source hardware so a company or school can use it without any per-seat licensing. There’s no risk that it will be discontinued and the software gone forever. If you want a new feature, you can spend the time and get it added. When thousands of people have a small stake in something, or ownership, they care more. Does anyone even debate if open source software is a good idea any more?

I think part of the reason the Arduino (and its clones) have flourished is due to the community built around it. Thanks goes out to the people who are really into doing things with Arduinos, and sharing their work with others, and helping out on the forums, and teaching classes, and basically connecting with others and evangelizing the Arduino platform.

The first Arduino I purchased was the “official” Arduino Uno, which I acquired from Adafruit Industries. I remember finding out about Adafruit from the web site ladyada.net, run by Limor Fried (Lady Ada) who runs Adafruit. The fact that she had shared so many project details online led me to her business, and I became a customer. My Uno is what I consider my “top of the line” Arduino, and I feel pretty confident that it will work with any shield I get, not have any weird quirks to work around, and that buying it supported the Arduino project. Chances are when a new “official” version of the Arduino comes out, I’ll but that one as well.

I do have other Arduinos, like the Boarduino, also purchased from Adafruit. I wanted another Arduino, at a lower cost, that I could dedicate to a project. It fit the bill, and supporting Adafruit was something I felt good about doing. I’ve also got a Diavolino, from the folks at Evil Mad Scientist Laboratories. As I mentioned in my blog post, The Diavolino comes in at about $13—less than half the cost of an Uno—though there are some compromises with the Diavolino. If these compromises don’t affect you, it’s a nice little Arduino board. And as for the folks at Evil Mad Scientist Laboratories, they’re pretty awesome, just like Adafruit, and I feel good supporting them.

Now we move away from the US and over to China. I’ve got two “Seeeduinos” from Seeed Studio. I know some people would prefer not to buy from China, and if these were cheap knock-off products from a questionable company, I’d agree, but Seeed Studio seems to be a pretty well respected member of the open hardware community. They were a sponsor of Maker Faire, they helped with the radiation detection project after Japan’s Fukushima incident, and they actually develop a number of innovative products. If all they did was make a cheaper Arduino, I probably wouldn’t be as supportive of their efforts. As it is, I think they provide some friendly competition for others in the Arduino space, and do plenty of other things to be a good citizen of the open hardware community.

I’ve already mentioned the Evil Mad Scientist Laboratories gang, and their Diavolino, but I’ll also talk about the Egg-Bot. I bought the Egg-Bot kit because I think it’s awesome. Here’s the description of it: “The Eggbot is an open-source art robot that can draw on spherical or egg-shaped objects.” See? Awesome! (I’m sort of a fan of art robots.) Now, the Egg-Bot is awesome, but it’s an open & shared kind of awesome. Every time I demo it, I explain to people that it’s an open source device, and you can download the software for free, and you can download the plans to build your own for free. I’ve see a SphereBot, a Completely printable Eggbot, a Fischer Technik Eggbot, and an EggBot Makerbot Attachment over on Thingiverse, as well as many Egg-Bot design files. (Heck, you could even make an Egg-Bot out of LEGOs.)

The point of all this is, the Evil Mad Scientist guys aren’t out to crush anyone who tries to make an Egg-Bot… they encourage it. They’ve grown a community of users who help each other out, sharing what they’ve learned along the way. This helps make people fans of Evil Mad Scientist Laboratories, and the Egg-Bot, and be more willing to support their future endeavors.

But hardware, just like software, and life itself, is often a compromise, consisting of grey areas, like the Teensy. While I used a Teensy for The Button, and it was perfect for it, I still hope to move to an open source alternative if possible. I covered most of this in my Teensy vs. Atmega32u4 Breakout Board+ post. I’ll get my hands on an Atmega32u4 Breakout Board+ and see how it stacks up against the Teensy for future projects.

So where does that leave us, and the future of open source? Personally, I see open hardware as a choice sort of like buying food. You can choose to support companies you know, like, and trust, and you can even go to the local farmer’s market and talk to the people who make the food. I hate to use the word “sustainability” (only because I think it gets overused) but I think it fits. A sustainable future through open source. Works for me…

Categories
Uncategorized

The Future of Open Source

Open Source

Open source software has been around for a long time, and I’ve been following it’s evolution for the past 10 years or so, and in that time I’ve seen it grow from a small idea known only to those in the software world, to something much larger, where everyday people like Aunt Tillie use open source software and think nothing of it.

In the past year since I’ve started working more with hardware, and following the great work of the Arduino team, Adafruit Industries, and others, I’ve seen the rise of open source hardware. Take a look at the Open Source Hardware (OSHW) Statement of Principles and Definition v1.0 and the Open Hardware Summit site for more info.

There’s a great comment by Chris Anderson, highlighted in this blog post at Adafruit. Here’s just a small excerpt:

This is the classic open source hardware model. Software, which costs nothing to distribute, is free. Hardware, which is expensive to make, is priced at the minimum necessary to ensure the healthy growth of a sustainable business to ensure quality, support and availability of the products. All intellectual property is given away, so the community can use it, improve it, make their own variants, etc.

Go there now and read the whole thing.

This got me thinking that eventually open source hardware could be more successful than open source software. If you remember the old concerns about open source software by the business folks, there was always the question of how you would make money from it. You can sell “Premium Editions” or make money by charging for support, you can hire yourselves out as consultants, and offer customized software solutions for customers… The ideas were plenty. Some worked, some didn’t. There were varying degrees of success.

I see open source hardware as pushing beyond that, taking the existing model and improving upon it. The software? Free. Open. Get it rolling, get the community involved, give it away to everyone. You should expect to make no money with software. Sure, it costs money to create software, but it’s a digital good, and making one copy or 1,000 copies has almost the exact same cost.

Hardware, on the other hand, is a physical good. It’s an object, a collection of parts, or things, not just bits of ones and zeros. Hardware costs money because someone, somewhere, assembled some real world thingamabob.

I don’t want to make it sound like hardware is better than software. They’re both equally important. They both need people to design them, create them, market them, and support them. The main difference is that creating 1,000 Arduino-compatible microcontrollers is going to cost more that creating 1,000 copies of the Arduino software. That’s just the reality of digital goods. Once you have one copy, making a lot more is cheap and easy. (And the shipping costs on digital goods are pretty close to zero. I say “pretty close” because there are server costs, bandwidth considerations, and other issues, but you’re not buying boxes, and packaging materials, and paying shipping companies to move goods.

As for the clones, well, that’s just a part of open source hardware, much the same way that an open source software package has forks of the original. Again, the difference is in the support, but support goes both ways. Since open source hardware vendors typically publish everything you need to make their products, you could certainly not buy from them and either build it yourself, or find a company that makes it cheaper. Cheaper is fine. I’m a fan of cheaper, but I’m also someone who believes in supporting those that create things and add value. If it all comes down to nothing but money, we’re pretty much doomed.

(Next time I’ll talk about specific pieces of open source hardware. See you then!)

Categories
Uncategorized

Teensy vs. Atmega32u4 Breakout Board+


Photos from Adafruit Industries.

I remember seeing the Teensy when I was digging into Arduino stuff last year, and it looked interesting, mainly due to it being small and cheap. (I like cheap!) But since I’m a lot more interested in what the Arduino has to offer, I didn’t look into the Teensy very much.

The Teensy is interesting though because out of the box it functions as a USB HID device, which means it can very easily emulate a keyboard or mouse. (See this Awesome Button post for a neat example.)

If you didn’t know, I’m a big fan of Adafruit Industries, not just for their amazing customer service and great products, but for their support of the open source movement, especially the work they’ve done with open source hardware. Adafruit actually sells the Teensy, but they also came out with a product called the “Atmega32u4 Breakout Board+” (terrible name, eh?) which is like a Teensy, but not like a Teensy.

Here’s where it gets weird… or interesting… or both…

By all respects, the Teensy is pretty cool, as I said, it’s small, and cheap, and can emulate a USB HID, and if your project needs that, it’s a good fit. See the Teensy page for more info.

Now, the “Atmega32u4 Breakout Board+” (terrible name) by Adafruit is similar but different. You can check out the Atmega32u4 Breakout Board+ page for more info.

Ultimately, I think I’d prefer to use the Atmega32u4 Breakout Board+ from Adafruit, and for a good explanation, see this Adafruit blog post about the Teensy, and for extra credit, see A Brief Essay About the Benefits of Open-Source Hardware.

It’s a shame the Teensy is not open source hardware, as I’d prefer to support vendors of open source hardware.

So I’ve got a project planned, and it will use a Teensy. So why not use a Atmega32u4 Breakout Board+? The first reason is, I don’t think I’m ready for it. In reading through the Atmega32u4 Breakout Board+ docs and digging through the forums a bit, it looks like Atmega32u4 Breakout Board+ development is not exactly easy for a beginner. I’d like to get into it at some point, but right now, the Teensy seems like an easier path to completing my project, and maybe once it’s done I can look into working with the Atmega32u4 Breakout Board+.

I know this may seem like a small thing, but I’d really like to support open source hardware when I can, the same way I try to support open source software when I can. It’s always a struggle.

Categories
Uncategorized

Perl + Arduino (+ ShiftBrite)

ShiftBrite

Back when I revealed the Twitter Monkey I had a dark secret… I got the Perl script to work, but just barely, and I really didn’t grok exactly how the code worked. I was just thankful MCQN Ltd. published the Alertuino code for me to get started.

I’m happy to say that I’ve made some good progress in getting Perl and the Arduino to talk to each other, and if you keep reading, you’ll see what I’ve got so far.

I’ll be using a ShiftBrite from macetech for this example. You can buy direct for $4.99, get them from Adafruit for $5.00 or use your #freeday money to get one from Sparkfun.

ShiftBrite

To connect the ShiftBrite, you just run it’s GND to the GND on the Arduino, the V+ to the 5V on the Arduino, and the run DI, LI, CI, EI to digital pins 10, 11, 12, 13 respectively, on the Arduino. Just 6 wires… pretty simple.

Once again, I stand on the shoulders of others… a hacker named Ashley Hughes wrote a post titled ShiftBrites and the Arduino and provided a library named shiftbritehughesyarduino. Grab it and drop it in your Arduino/libraries folder before we get started.

The library makes it pretty easy to send a color to the ShiftBrite using a command like this:

sb.sendColour(200,400,600);

Where the colors are in R,G,B value. Though the scale is not 0-255, or 0-100, but 0-1023. I’m not great at math, so I’m going to use the 0-100 scale and just multiply by 10. So for the line above we’d be sending a RED value of 200, a GREEN value of 400, and a BLUE value of 600.

Here’s the code for the Arduino:

/*
 * ShiftBrite.pde
 */

#include "HughesyShiftBrite.h";

HughesyShiftBrite sb;

void setup() {
  sb = HughesyShiftBrite(10,11,12,13);
  sb.sendColour(10,10,10);
  Serial.begin(9600);
}

void loop() {

  int input = Serial.read();

  switch (input) {
  case 48:
    sb.sendColour(0,0,100);
    break;
  case 49:
    sb.sendColour(0,0,200);
    break;
  case 50:
    sb.sendColour(0,0,400);
    break;
  case 51:
    sb.sendColour(0,0,600);
    break;
  case 52:
    sb.sendColour(0,400,0);
    break;
  case 53:
    sb.sendColour(0,600,0);
    break;
  case 54:
    sb.sendColour(0,800,0);
    break;
  case 55:
    sb.sendColour(600,0,0);
    break;
  case 56:
    sb.sendColour(800,0,0);
    break;
  case 57:
    sb.sendColour(1000,0,0);
    break;
  }
  delay(5);
}

See all those “case” commands followed by numbers? They are looking for the ASCII code being sent from the serial port. Don’t have an ASCII chart handy? Look at this simple one and you’ll see that the decimal value for 0 is 48, for 1 is 49, etc. So our case statements are looking for anything between 0 and 9, which is a nice scale to use.

OK, if you’ve uploaded the code, you should see the ShiftBrite lit up, since the initialization sent this:

  sb.sendColour(10,10,10);

The code on the Arduino is now listening to the serial port waiting for some input. The input should be a number between 0 and 9. We should probably send it some numbers… that’s where Perl comes in:

#!/usr/bin/perl
#
# sendserial.pl
#

use Device::SerialPort;

my $port = Device::SerialPort->new("/dev/tty.usbmodem1d21");
$port->databits(8);
$port->baudrate(9600);
$port->parity("none");
$port->stopbits(1);

sleep(3);

for ($i = 0; $i <= 9; $i++) {
	print $i . "\n";
	$port->write("$i");
	sleep(1);
}

exit;

This is the shortest, simplest example I’ve got. You’ll obviously need the Device::SerialPort module installed. If you’ve written anything in Perl (or other languages) this should make some sense. We’re connecting to the serial port (/dev/tty.usbmodem1d21) and sending characters (0 through 9) to it, as well as printing them to the console so you can see them.

When you run the Perl script you should see the ShiftBrite light up and change about once per second, cycling through various levels of blue, green, and red.

Note: We got the port /dev/tty.usbmodem1d21 from the Arduino IDE (though I’ll show you another way to get it) and the sleep command is in there to give things time to initialize. I’ve found that without it, the serial port communication may miss the first commands.

ShiftBrite: Red, Green, Blue

Gotchas: The serial port may change. Mine is ‘/dev/tty.usbmodem1d21′ but it will be different on different machines, and may even change after a reboot. We’ll have a fix for that next time. The other gotcha is that when the Perl script is running, it’s using the serial port, so if you try to upload a new sketch to the Arduino, you will get an error. Since this script only runs for about 13 seconds, you probably won’t hit that problem here… for scripts that loop, you probably will.

I hope that wasn’t too complex. In theory, you could write the Perl part using Ruby, Python, or any scripting language that can do serial communications. In the future I’d like to try to use seriality to see if I can do it via HTML/JavaScript.

In a future installment I’ll have a complete project using all the bits we just covered…. stay tuned!

See Also: Arduino + ShiftBrite Light Organ

Categories
Uncategorized

Friday Night Drawbot

Drawbot
Arduino-Powered Drawbot

Friday night turned into Robotics/Art night at the 2XL Makerspace. I remembered seeing this Drawbot Project, and while you can modify normal servos to be continuous rotation servos, I already had some continuous rotation servos on-hand, so we got to work. (Or play, if you prefer.)

Drawbot parts
Drawbot parts

The Drawbot consists of just a handful of parts. Here’s a list of the items we used:

All of these pieces are available from our friends at Adafruit Industries. You can probably find the parts elsewhere as well, and you don’t need a Boarduino specifically, as any Arduino board will work. I just used the Boarduino because it’s small.

Sharpies and Corrugated Cardboard
A Pack of Sharpie Markers

Oh, you’ll also need some Sharpie markers (I recommend a nice 8-pack of various colors) and a 9 volt battery, a platform, and something to hold it all together.

Servos taped together
Servo motors held together with some tape

The building of the Drawbot was pretty simple. I started by using a bit of tape to stick the servos together with the wheels facing out. This gave me the width of the “platform” I would need. (It had to fit between the wheels.) I used corrugated plastic because it was handy. It’s very lightweight, easy to cut, and pretty strong. You could certainly use cardboard or something like a plastic CD case, but I’m telling you now… corrugated plastic is awesome. (I’m already using it in my next project!)

Once I had the servos secured to the platform with some rubber bands, I put the battery and the breadboard on top of the platform. The placement may be a little tricky, as you need to determine the correct balance. I wanted it to be a bit heavier on the side that would hold the marker, but didn’t want too much weight on that side. Rubber bands make it really easy to move things around.

Close-up of Drawbot
Close-up of Drawbot

With most of the pieces in place, I added the jumper wires between the servos and the breadboard. That’s it for the wiring.

At this point I wanted to test it out. I was impatient and just wanted to find some continuous rotation servo code. A quick search led me to the post Controlling a Parallax (Futaba) Continuous Rotation Servo with Arduino. I ended up simplifying my code even more. Right now the Drawbot just goes in a circle. Yeah, it’s simple, but that’s the way I like to start things. Get the simplest thing working first, and then go from there. (Code is at the bottom of the post.)

Marker holders
Marker holders made out of corrugated plastic

So we now had a robot that went in circles. At this point we figured it was time to draw something! Back to the corrugated plastic. This is another place where the plastic shines. I cut a small piece, and then cut a hole with an X-Acto knife where the marker was going to go. I cut the hole a bit small, and when i slide the marker it, it held it nice and tight. I’m glad I didn’t use cardboard, as it just doesn’t have the strength of the plastic.

Drawbot on it's first run
Drawbot on it’s first run

With the marker in, it was time to test it. We put it down in the center of a 24″ x 18″ drawing pad and turned it on. It spun around drawing circles. Success! We managed to build a robot that can create artwork. :)


Artwork by Drawbot

Since things were all loosey goosey, meaning, our marker holder could shift around, the pad was on an uneven floor, the servos were probably not perfectly matched, etc. We got a circle, and another circle, and another one, all overlapping. In a perfect world I’d suppose you’d just get a circle with every other circle drawn directly on top of it. I think it turned out better our way.

Drawbot making overlapping circles
Drawbot making overlapping circles

We figured that two markers would be better than one, so we tried that next. The results were pretty good. Here you can see how the circles start to overlap. We’re hoping to try with some bigger paper to see what happens when it doesn’t run out of room.

Here’s our code…

/*
 * Drawbot.pde
 */

int servoPinL = 9;
int servoPinR = 10;

void setup() {
  pinMode(servoPinL,OUTPUT);
  pinMode(servoPinR,OUTPUT);
}

void loop() {
    digitalWrite(servoPinL,HIGH);
    digitalWrite(servoPinR,HIGH);
    delayMicroseconds(1500);
    digitalWrite(servoPinL,LOW);
    digitalWrite(servoPinR,LOW);
    delay(50);
}

Again, this code is really simple. All you’ll get is a circle, or, a bunch of circles. But now that we’ve got the Drawbot working, we can start playing around with modifying the code to change it up a bit. We look forward to more robot-created artwork in the future!

Note: Check the project page for more info.