phatIO a different way of interfacing a computer with the world that you might be used to. I first saw phatIO uses file system to control external hardware article at Hackaday.com that mentioned phatIO. phatIO is an USB I/O device that uses a mass storage file system for control.
Using mass storage for I/O controlling might sound strange at first, but after a little bit thinking it starts to make. Remember Unix and Linux systems where practically everything is modeled as files. phatIO simply extends the same basic idea across multiple platforms. The idea in mass storage for I/O controlling is that any operating system can manipulate files on a USB storage device: any alterations you make to its file system will result in pin manipulation on the I/O header. Each of the 20 general purpose I/O pins can be controlled by saving a “0” or “1” to their control file. You can also control the mode in which the pin operates. Besides normal digital input and output, 12 can also be used ADC inputs and 5 pins can be configured to be PWM outputs.
When plugged into a computer’s USB port, phatIO appears as a USB filesystem/memory stick. You can control devices connected to phatIO by writing to files on that filesystem. Any computer that can write to a USB memory stick and any program/language that can write to a file can talk to phatIO and control things. In this way phatIO significantly reduces the typical effort needed to control things with a computer – no drivers have to be installed or low level libraries needs to be used. Once connected to your computer phatIO should appear as a filesystem (the exact name and location will depend on your computer).
At the time phatIO uses file system to control external hardware article was posted, the the board was not yet in production. But the product seemed to be interesting and reasonably priced (27 Euros), so I decided that I should check this out. phatIO is currently in beta stage and I was pleased that got the board quite soon. Good thing the product was also that it was “Made in Finland” (I give plus to product manufactured in my home country).
phatIO board is small and compact (44 by 36mm). It has 2×14 IO socket. A sticker is supplied to label the IO pins when used in prototyping or on a Breadboard. Each of the 20 I/O pins can be used for digital input and output, 12 of the pins can be also be used for reading an analog input and 5 for PWM output. The I/O pins can be made to work with 5V and 3.3V TTL level signals.
The board is based on Atmel MEGA32U4 microcontroller (same microcontroller as used by MaKey MaKey and Arduino Leonardo. The other main component is 128 MB microSD memory card that contains the device software.
I have done some basic testing with the board and the file operations seem to work on initial tests well. I will plan to do some more testing later.
The file system idea is nice and simple, but it has also downsides. One issue with acting as a filesystem is that operating systems will often try to cache its content to improve performance. This means that once it’s read a phatIO file it doesn’t expect the contents to change on the device. This has most effect on reading the values of the “pins/*” files when the pin is acting as an input (both digital and analog). Systems like Linux can be told to destroy the cache and reread the contents of the file.
For cases where this can’t be easily done phatIO also provides a script language based condition mechanism that allows something to be done when the analog/digital inputs change: phatIO could change output pins automatically or simulate someone pressing a sequence of keys on a keyboard. In addition to this the scripting language can be used for many other things according to phatIO GuidephatIO Guide and phatIO Hardware and Electrical characteristics. I have used those documents as sources when I have written this article.
A more interesting and less conventional Dropbox Integration: The files on phatIO can be exported to Dropbox allowing a cheap way of exporting the phatIO functionality to other computers or other devices that support Dropbox. Tests have been done editing the phatIO’s pin files on a dropbox capable text editor on an ipad, with the relevant pins going high/low after 2 to 4 seconds because Dropbox is not a realtime communication system. Unfortunately this is said to work only works if the phatIO is hosted on a Linux and OS X computer. I have not tried this, but looks interesting.