Email

Donate Button

LightScythe

Update:

Dozens of people told me I should patent or make a business selling Light Scythes. I'm not really into that (but it's open source, so feel free to make your own!) But if you want to sling me cash, I promise to spend it on nifty projects!

More pics of the LightScythe can be found here:

Intro:

The LightScythe is a device for writing text and images frozen in midair. The hardware information and software is open source and anyone can make it.



One of the inspirations for this project was the mapping of WiFi signals here:
http://yourban.no/2011/02/22/immaterials-light-painting-wifi/

Hardware:

The hardware is pretty simple. There’s a 2m programmable LED strip inside an acrylic tube, which is controlled from a small receiver and battery pack. A laptop PC with a wireless Xbee link sends the image data to the scythe at a specified time. 



Battery power is provided from a 6V SLA battery, which is able to power the strip directly without regulation.

Parts list (Per scythe):


Software:


Arduino code:

The arduino code is quite simple. The software parses input from the serial port (Xbee) and writes it to the staff. The format is “M01234...”, where ‘M’ means manual mode and 0-7 is the colour for each LED. The first number is the colour for the top pixel, the next for the second one down, etc.

The use of the ‘M’ allows for easy synchronisation with the start of the colum, as well as allowing future codes using other letters. (E.g. bargraph with a ‘B’ value, etc.)

To aid in triggering, there’s a button on each scythe controller that sends a serial ‘1’ or ‘2’ (depending on scythe number) to the PC. This is a handy way to start the scripts without being near the laptop.

To prevent the battery from being drained excessively, there’s a snippet of code to check the voltage (via a 2:1 voltage divider and analog in pin), and flash the top 3 LEDs red to let the user know it’s time to charge.

There’s also a potentiometer on each control box, which I might use in future code to add demo modes, etc. to the firmware. It’d be nice just to be able to make the scythe do cool things without the PC.

I was originally going to use the SD card for pattern storage (hence the ‘stalker’ module rather than regular arduino), but it’s quite tricky to find a non-SDHC micro SD card, and the libraries I could find didn’t allow you to write to a SDHC, only read. There may be a better option.

Xbee setup:

The Xbee module setup is quite minimal for this application. Basically just setting the baud rate and making sure the PAN is the same for all nodes. I’m not using 1-1 transmission (SH & SL are 0), meaning you can have multiple scythes displaying the same message with no problems. Also I set up the hardware to auto-reset when the PC opens the serial port. This saves worrying about getting the scythes stuck into loops, and in theory allows me to program them wirelessly.  In practice the large code size is almost impossible to download easily without many retries due to radio dropouts/timing, etc. (Can take 6 downloads before one is fully successful)

Other people have used custom bootloaders more amenable to wireless links, but I decided not to bother.

The manual and tutorials are invaluable when troubleshooting Xbee coms:
http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Manual.pdf
Especially Adafruit’s tutorial on wireless programming. This saved me heaps of time:
http://www.ladyada.net/make/xbee/arduino.html


PC - Image Creation: (createtext)

For simple text, the image is created dynamically using a small script and the ImageMagick toolbox. The text is rendered in a selected font, and with inner and outer colours selectable.

I was really impressed with the ImageMagic tools. Seems like you can do practically anything from the command line. Some examples are here:
http://www.imagemagick.org/script/convert.php

>./create_text "Hello World"

PC - Image Conversion to Scythe format: (LightScytheParse.py)


The Scythe can only display a few colours using raw RGB channels full on or off. To automatically convert the image to a suitable format, I made a simple Python program to parse GIF files and output them to a .SCYTHE file which contains the raw serial info. The closest colour in RGB space is chosen, but it could easily be adapted to use a nonlinear or more human friendly distance metric.

For example this:
is converted to:
But with dithering is:

Here's the undithered output in a photo:

and the dithered version:
Thanks to David who advised on an easy dithering method. It's as simple as running "convert rainbow.gif -ordered-dither o8x8,2 rainbow_o8x8_2.gif" in ImageMagick.


The Python Imaging Library (PIL) made it quite easy to convert the image. The code is less than a hundred lines.

PC - Transmitting to the Scythe (LightScytheTransmit.py)

PySerial is used to interface with the serial port.
http://pyserial.sourceforge.net/pyserial_api.html#classes

The code opens the .SCYTHE file created above, and pushes it line by line after an adjustable delay. The total time to write the image is also calculated and displayed to the user, which comes in handy in the field for judging the shutter time and walking speeds to use.

Photography Tips:

Any camera that can take a long exposure can be used to capture the image. Most of these shots were taken with 10-15 second exposures.

A late addition to the code was having the transmission wait for the scythe to send a pushbutton message before starting. This made it a lot easier to line up the shots. Previously I was having a hard time using automatic timers on the camera and PC and ended up needing about six hands.
  • Set 10 second timer then run into shot and push button on the scythe.
  • For designs, outlines can look cooler than solid colours.
  • Fonts can make the look. (Good selection of them here: http://www.dafont.com/)
  • A good gopher makes it much easier :) The key to shots is repeatable starting, and being able to pace out steps regularly
Man, it's hard to prove your identity on the net. Purple monkey diswasher Kruug!
Č
ċ
LightScytheParse.py
(2k)
Gavin Smith,
Jun 28, 2011, 4:53 AM
ċ
LightScytheTransmit.py
(1k)
Gavin Smith,
Jun 28, 2011, 4:53 AM
ċ
create_text
(1k)
Gavin Smith,
Jun 28, 2011, 4:53 AM
ċ
lightscythetest.pde
(8k)
Gavin Smith,
Jun 29, 2011, 4:33 PM
Comments