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.
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!
One of the inspirations for this project was the mapping of WiFi signals here:
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.
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.
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:
Especially Adafruit’s tutorial on wireless programming. This saved me heaps of time:
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:
>./create_text "Hello World"
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:
and the dithered version:
The Python Imaging Library (PIL) made it quite easy to convert the image. The code is less than a hundred lines.
PySerial is used to interface with the serial port.
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.
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.
Man, it's hard to prove your identity on the net. Purple monkey diswasher Kruug!