This upcoming Tuesday, 9 March 2010, 8pm at Crash Space in Culver City, we’ll be having some fun quick DIY projects for you to build. Come on over and have fun with us. The project kits are $5 for CrashSpace members or $10 for non-members and you can take them home after you build them.
In the kit you get the parts to build your own Bristlebot, a tiny robot made from a toothbrush:
(consists of toothbrush, pager motor, battery, and foam tape)
and LED throwie art:
(consists of two color-changing RGB LEDs, battery, and a magnet)
We’ll have a Bristlebot race track you can do time trials on:
And we’ll be showing you how to build all of this, no previous experience required. Come build bots and lights!
(as a few had noticed, I had an error in the schematic shown. It’s been updated, thanks!)
A recent question from a friend who made a really cool BlinkM hoodie was: How can you turn a momentary button press into an on/off toggle?
There are tons of ways to do this if you like getting into electronics. Most all work off of some flip-flop like principle. And while I could have suggested a true flip-flop chip, I thought it would be cooler if you could use a 555 timer chip (which contains a single flip-flop and a couple of comparators). After scouring my childhood collection of Forrest Mims electronics books and a few 555 timer devoted websites (two of the best I found were: http://www.bowdenshobbycircuits.info/ & http://www.kpsec.freeuk.com/555timer.htm), I cobbled together the following circuit based off a few almost-what-I-wanted examples.
This is what it looks like in use:
The schematic is pretty straightforward, but does use a bit of feedback trickery to get the toggle functionality:
(old incorrect version here)
The parts cost is pretty low. The 555 timer chip can be had for about $0.43, the 2N3904 transistor for ~$0.40, and various resistors & capacitors are essentially free if you have them.
The circuit has 3 external two-pin connections: 5V&Gnd, button input, and the two pins of the thing to switch. In this case, the switched thing is a power supply to a BlinkM.
By changing the transistor to a beefier one, you can switch much larger loads. The little 2N3904 transistor in there now can switch around 200mA, but a bigger NPN or FET transistor and you could switch a few amps.
It can be made pretty small on a tiny breadboard (courtesy of FunGizmos.com) like this:
It’s not the greatest for battery-powered applications. When “off” it draws about 4-6mA, depending on the brand of 555 timer chip you use. When on it draws that plus whatever power the switched device draws. Best to put a proper power switch on the battery pack to eliminate this quiescent drain.
One of the challenges of working with I2C (aka “two-wire” or “TWI” or “Wire”) devices is knowing the I2C address of the device. Older devices have a fixed address, or a “choose one-of-four” approach. But newer I2C devices have fully programmable addresses, leading to cases of not knowing what address a device is at.
Fortunately, there’s a technique one can use to “scan” an I2C bus and determine these addresses. Conceptually it’s very similar to a network “ping”. Below is an Arduino sketch “I2CScanner.pde” that turns an Arduino into an I2C bus scanner.
When loaded up on an Arduino, the sketch will immediately scan the I2C network, showing which addresses are responding.
For example, the above output is from an I2C bus with four slave devices on it (one BlinkM MaxM, three regular BlinkMs). (Notice the 2 pull-up resistors on SDA & SCL. This is needed for longer bus lengths)
One thing to notice about the I2CScanner output is that although there are four devices on the bus, only three addresses were detected. This is because unlike IP networks and “ping”, you can’t tell if two devices have the same address. They’ll both respond to commands sent to them just fine, you just can’t read back data from them.
How it works
In I2C, the first byte transmitted/written by the master to a slave is the address of the slave. If there is a slave at that address, the slave will signal the I2C bus, otherwise it leaves it alone. We can use this to implement a bus scanner.
The Arduino “Wire” library utilizes a set of C functions called “twi.c”. One of those functions is “twi_writeTo()”. This function is used to both send the address of the slave down the bus and also to write data to slaves. It returns 0 if it was able to successfully transmit a byte or non-zero if it couldn’t. Since the very first write to a slave is its address, a very simple bus scanner using it would be:
void scanI2CBus(byte from_addr, byte to_addr) {
byte data = 0; // not used, just a ptr to feed to twi_writeTo()
for( byte addr = from_addr; addr < = to_addr; addr++ ) {
byte rc = twi_writeTo(addr, &data, 0, 1);
if( rc == 0 ) {
Serial.printl("device found at address ");
Serial.println(addr,DEC);
}
}
}
In the I2CScanner sketch, this function is extended a bit to support a callback function. The callback function is called with the result of every address scan. In I2CScanner, this callback function is called "scanFunc()" and just prints out "found!" or nothing, but it could be modified to do more complex tasks like doing additional I2C transactions to figure out what kind of device it is, or setting all the devices to a known state, etc.
[This post was part of a CrashSpace mailing list discussion on a "proximity t-shirt": a shirt that would light up or similar when other similar t-shirts were nearby. People were wondering how good RFID was at localized detection of tags.]
Okay so I’m a big RFID nerd, did a lot of consulting work using it. So here’s a quick brain dump.
Regular passive RFID is designed for identification not localization. The RFID tags can be reliably read only to within a few centimeters. But the readers are cheap. You can get 128kHz (LF) and 13.56MHz (HF) RFID readers for $20-40 and the reader chips themselves for under $2. RFID tags that work with these systems are around $1. These systems typically cannot handle multiple tags in the reader’s field at a time.
UHF (900MHz-2.4GHz) passive RFID readers can read up to a few meters, and the tags can be a $0.05 in large quantities. The readers can get pretty expensive though: >$1000. These are the systems used by Walmart et al to read a palette of Mach3 razors as they transit the warehouse. And by the marathon race timers. The standard is called EPC, if you’re interested. These systems can handle a few hundred tags in the reader’s field, but read time goes down exponentially with tag count.
“Active RFID” has ranges up to hundreds of meters. The term “active RFID” is a bit loose, since one can describe a WiFi laptop or a cellphone as active RFID tag. Really it just means an RF radio system that transmits a unique ID using its own power source. There are active RFID versions of all the above technologies. Eric’s suggested use of the RF Link boards is essentially an active RFID beacon. One of my favorite active RFID designs is OpenBeacon (http://www.openbeacon.org/ ). It uses the ubiquitous Nordic RF chips (used in almost every wireless keyboard & mouse) Sparkfun has a ton of Nordic boards to play with.
“Localization” of RFID tags can mean two things. For normal passive RFID, the tag is “located” when a reader sees it. It’s a boolean: sees it / doesn’t see it. This is often called “proximity detecton”. So one way to approach localization is to just have a lot of readers. True localization (knowing where in a reader’s field-of-view a tag is) is pretty tricky. The main issue is just finding how far away an RF source is. The simplest is signal-strength (”the louder you are the closer you are”), but that falls prey to the non-homogeneity of the environment: in free space it would work; in a room full of RF-absorbing humans, it fails. If you’re really savvy, you can do time-of-flight calculation. The reader sends out a ping and measures the time it takes to receive the tag’s echo ping. This requires nanosecond-accurate clocks on the reader (speed of light is very fast) and falls prey to multipath distortion (reflections off the environment). And then you need multiple antennae for a single region to do triangulation. It’s hard, but RFID vendors are starting to release stuff.
If you want a slightly different look for your Halloween pumpkin or skull, you can pretty quickly whip something up with a few servos and an Arduino. Here’s a set of Scary Shifty Servo Eyeballs, for instance:
It looks around randomly…what’s over there!… wait, what’s that!
As you can probably tell it’s a pretty simple arrangement (click for bigger):
This is one of the greatest bits of youtubery I’ve ever seen, and I generally dislike auto-tuned stuff. Carl Sagan’s Cosmos was one of the most important things to happen to me as a child. This video & song gives me the shivvers. And makes me miss Sagan all the more.
I love the song’s chorus created from cut up Sagan quotes:
A still more glorious dawn awaits
Not a sunrise, but a galaxy rise
A morning filled with 400 billion suns
The rising of the milky way
The Crystal Monster is an art piece created by Beverly Tang and Tod E. Kurt (me). It’s on display in the Continental Gallery on 4th & Spring St in downtown Los Angeles. The shape and structure of the Crystal Monster are Beverly’s design. I created the lighting and the electronics. It’s made from over 400 sheets of laser-cut acrylic, more that 240 feet of LED tape (>2200 RGB LEDs!), and around 500 steel rods and other steel hardware. It’s approximately 12 feet long and 10 feet wide and hovers 10 feet above your head. It’s got an Arduino brain and 18 BlinkM MaxMs (one per segment) to let it flutter color patterns up and down its length.
Some of my photos (click on any to go to the Flickr set):
It was first installed at the Ball-Nogues studio in Downtown Los Angeles as part of their participation in Downtown L.A. Art Walk, and lived there for a few months.
Then it moved to its mostly-permanent location at the Continental Gallery at 4th & Spring in Downtown Los Angeles.
It’s right on the corner, so you can really see it just from walking by on the street.
The electronics consist of 18 BlinkM MaxMs driven by a single Arduino, all powered by an ATX power supply. The Arduino has an IR remote control receiver so the Monster’s behavior can be controlled from afar.
Random experiments, circuits, code, rapid prototyping examples, sometimes things to buy, and occasionally tunes by Tod E. Kurt.
Reach me at tod [at] todbot.com
Yay BlinkMs!
BlinkM is a smart LED. Imagine an LED with a tiny computer inside, one that can be any color and have a life of its own. You can buy them now from one of our global distributors.
ThingM
A device studio that lives at the intersections of ubiquitous computing, ambient intelligence, industrial design, and materials science.
Recent Comments