The Rooving NetworkFirefly was replaced by a blueSMirf. (Note 7)
I added voltage regulators to power the color sensor, blueSMirf and Arduino in addition to the existing camera supply. Serial communications were routed through a DIP switch to allow for programming of the Arduino through the USB port. There are small relays (one is visible in the image above below the DIP switches) to turn off power to the camera and sensors when not needed. I also added a manual switch to turn all power from the battery off. An additional small relay directs the serial signal out of the Arduino to either the Roomba or the blueSMirf .
The floor color sensor array consists of red, green and blue LEDs and a light level sensor (Note 8). The array faces down and one LED is turned on at a time. The amount of reflection of the lit LED is read by the light sensor and the Arduino sends the information back through the blueSMirf. I had to experiment with providing shrouds around the LEDs and sensor to provide the best color differentiation. After this picture was taken I added a small rubber gromet around the sensor also. Works very well now.
The Roomba Control application window is laid out in functional areas. The top row provides information about the bluetooth or other communication port used to send commands to the Roomba. The second row provides 'messages' about the action experienced from the command sent. Any errors are reported there also. The third row provides sensor reading from the Roomba. 'mA' is the reported current flow. Positive flow occurs in the charger, negative when driving around. The right framed area provides driving controls and alternately, the area for displaying the video feed. The left frame provides connecting and other non-movement functions.
Please note that in order to send and receive serial data in AppleScript, the application uses SerialPort X.osax (Note 9).
Inserting the Arduino into the flow, commands can tell the Roomba or the Arduino to do something.
Roomba only actions
Arduino only actions
Arduino initiated actions
The Arduino never receives information from the Roomba. It does send commands to the Roomba and it does send informtion to the Roomba Control application on the Macintosh.
The Roomba Control application expects the Arduino to pass all instructions on to the Roomba unless the instruction sent is a special one. The special instruction, "99", is not one needed normaly by the Roomba, so the fact that the Arduino never passes it on is OK. The next instruction sent after a "99" is also kept by the Arduino and it tells the Arduino's internal program to carry out a Arduino specific routine, such as checking the color of the floor and returning the values to the Macintosh.
The instruction set to follow the blue tape is contained in an external script "8-FollowBlueTape.scpt" that resides in the RoombaScripts folder.

For deviations from a straight path, correction is usally made in the first or second cycle. The more acute the angle of the tape, the more cycles it takes to find it again.The amount of space needed for these course corrections is only about 250 mm in total, so maneuvering down a hallway and then through a doorway is pretty easy. Nothing gets bumped into.
The instructions for the arm mounted sensor was changed in two significant ways. First, the basic routine is now
You can see a video of the "Armed Roomba" performing here.
You can use you imagination to extend this to other color tapes and paper squares. One time the Roomba might follow the "Blue-line" of tape and next time the "Red-line" of tape to a different destination. A "Green" square might mean turn 180 degrees and go back.
If you just want the latest Arduino Script for the Armed Sensor version, use the appropriate text field and button.
My web site privacy policy is:
Disclaimer
This Disclaimer only applies to the software associated with "RoombaControl" on OperationsImprovement.net
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470072717.html
http://www.smarthome.com/76001A/Mini-Air-Watch-Wireless-Color-Camera-Kit-Channel-1/p.aspx