March 2009

8×8 LED matrix control on an Arduino Mega

Once you’ve mastered microcontroller programming, you might be tempted to control a lot of LEDs.  Lots of people have this desire once they master the basics. Many microcontrollers have a limited number of output pins, however, so you might think that limits how many LEDs you can control.  I’ve written about a few different methods around this before, in chapter 14 of Physical Computing, and in this tutorial on this the ITP physical computing site.

By matrixing your LEDs, you can control many more than the number of pins you have.  For example, with the Arduino Duemilanove and earlier models, you had up to 20 digital outputs (13 labeled digital I/O 0 through 13, plus the six analog outputs, which double as digital I/O 14 through 19).  With 16 of those, you can control an 8×8 matrix of LEDs.  That’s 64 LEDs.  With the Arduino Mega, you have 54 digital I/O pins, so you can control a lot more.  This example uses 32 of them to control 2 8×8 matrices, for a total of 128 LEDs from one controller.

To make this example, you’ll need:

  • Arduino Mega
  • Breadboard or prototyping shield. I’m using Smart Projects’ proto shields, which were designed at the same time as the Mega itself.  I love them.
  • 8×8 LED matrix.  I got mine in a surplus shop in China, but you can also get them from most electronics retailers
  • male pin headers
  • female pin headers
  • Wires

Continue Reading »

AVR
arduino/wiring
circuits

Permalink

Controlling Inkjet Printers from a microcontroller

There was an interesting thread on the Sketching in Hardware mailing list a while back on how to control an inkjet printer.   Wendy Ju started the discussion. Following are some of the links from that thread:

A closed, proprietary portable printer:  Xyron Design Runner

Nice explanation of how inkjets work and how to control them in general. Link submitted by Scott Minneman

Instructions for now sold-out Parallax Serial Inkjet Kit (which does include inkjet cartridge pinouts for the HP 51604A Black Inkjet Cartridge, as well as board schematics, parts and instruction routines for  writing to the cartridge). Even without the device, Parallax’ documentation is handy.

Instructions on how to build your own DNA microarrayer using commercial off-the-shelf parts, including inkjet technologies.  The last two links submitted by Wendy.

Haven’t had occasion to use these yet, but they seem handy.

AVR
BX-24
PIC
arduino/wiring
circuits
pBasic (Basic stamp)

Permalink

Dynohubs: power from bikers

Lots of people are into mechanical generation of electrical power these days, so here’s a nice tip from the guys at Uncommon Projects: dynohubs.  I had a note in my inbox for months that just said “dynohubs, Tarikh.”  So I wrote, and he offered a lovely explanation, and a link:

Dynohubs are cool. They are sort of stepper motors in reverse,
actually sealed in a bicycle hub. They generate AC current which can be
easily rectified and smoothed to DC and (mine anyway) generates nearly 400mA
without significant speed. There’s some minor friction from the magnets but
they’re much better than the old style “bottle” hubs (which are
significantly cheaper).

Dynohub in Uncommon Action!

Perhaps you were asking me because I’ve been meaning to make an instructible
for months about how to power or charge your iphone/device from your bike?

They’re not necessarily cheap. A quick google search for the Shimano 3N71 that Tarikh mentions comes up with prices ranging from $99 – $150.  3W at 6V, that’s half an amp. Not a bad start.

circuits
construction

Permalink

Surplus Center

Mike Olson likes to move heavy things.  So when he says something like this:

Hands down the best site for finding cheap powerful motors is:

www.surpluscenter.com

You can’t search by torque, but they usually have an excellent seclection of powerful gearheads and linear actuators.

I had great results with one of these guys a while back. Probably bigger than what you need, but produces huge torque with very little current. The only problem is that it’s very heavy.

I believe him.  So if you’re looking for motors that can lift heavy stuff, follow Mike’s lead.

circuits
construction

Permalink

RFID to Web Interface

This tutorial introduces a Processing interface sketch provides a GUI for the command-line interface written into the Arduino RFID example. You should read that tutorial first. The sketch shown here also allows you to upload tags it reads to O’Reilly’s Emerging Technology Conference attendee portal, and retrieves the resulting profile. The API for this was written by Edd Dumbill. The Processing sketch retrieves RFID tags from the Arduino reader serially, then  passes the tag via a HTTP request to a PHP script on a remote server, shown below,  that adds an authorized login to the O’Reilly site.

Caveat: this tutorial was written specifically for the RFID workshop at Etech 2009.  If you’re doing this on your own, the uploader won’t work because your tags won’t be associated with records in the O’Reilly database, and the PHP script that it calls probably won’t be active on my site anymore.  But you could build your own version on your own server. The PHP code that follows below gives you a start on that process, and the Processing code below can make a HTTP call to any web address you give it.

The entire sketch can be downloaded here:

rfid_uploader_0002

Continue Reading »

PHP
Processing
arduino/wiring

Permalink

Arduino-based RFID reader

This tutorial shows how to make an Arduino-based RFID reader that reads Mifare tags and stores them in EEPROM. It is a modification of Alex Zivanovic’s code on Tinker.it. Thanks to Alex and Massimo Banzi for the reference. Once you’ve got it running, go on to the RFID to Web example, which provides a Processing interface sketch provides a GUI for the command-line interface written into the Arduino code.

The entire sketch can be downloaded here:

arduino_rfid_reader_0001

Continue Reading »

PHP
Processing
arduino/wiring

Permalink

Writing to Mifare RFID tags

Mifare RFID tags, like other RFID tags, contain a serial number that can be read using an RFID reader, but they also have a limited amount of memory space that you can write data to, and read back from.  This can be handy if you want to do something like keep a user’s account balance or name directly on the RFID tag.

This tutorial shows a number of the functions of my sonMicroReader  library for Processing, including how to write to the memory on tags.  It uses the same circuit as the SM130 reader example. The entire sketch can be downloaded here:

sonmicro_writer_0001

Continue Reading »

Processing

Permalink

Reading Mifare RFID Tags

This tutorial explains how to read from Mifare RFID tags from your computer using a Sonmicro SM130 read/write module. The sketch below is written in Processing using my SonmicroReader library. The SM130 has a TTL serial interface that you can connect to a micocontroller, or to a personal computer through a USB-to-serial interface.  Using the latter, it’s pretty simple to send serial commands to it and receive the data back. The entire Processing sketch can be downloaded here: rfid_simple_0001.

Continue Reading »

Processing

Permalink

Sonmicro RFID Reader Library for Processing

Last year, I worked with Timo Arnall and Einar Martinussen and Jørn Knutsen on a Processing library to read and write to Mifare RFID tags using the Sonmicro SM130 read/write module.  Here it is, with a few improvements and bug fixes.

SonMicroReader.zip

To use the library, unzip it and copy the folder to your Processing libraries folder.  Then restart Processing.  There are two example sketches, a simple reader that seeks new tags, and a full read/write example.

For more details, see the datasheet for the module. Code examples will follow in this blog.

Continue Reading »

Processing

Permalink