I²C smartColours Smart Sensor
This project is shared with the fischertechnik Corner website, as the first smart sensor is intended for the fischertechnik Robo TX controller.
This part in more technical oriented. |
The first smart sensor I'm working on is a colour recognition sensor, called smartColours.
Based on the functional specifications, the main choices are about the sensor and the MCU. The sensor should have at least 3 channels, red-green-blue, and optionally a forth one, clear. Needless to say, the sensor should be as compact as possible. A first iteration almost used a whole 26x18 base plate. The target is to fit everything into the 6 x 3 cm red box. |
The MCU should provide an I²C slave since the connection is through I²C bus. The sensor couldn't be on the same I²C bus, in order to prevent any collusion, and should deliver one voltage or frequency per channel, with some settings for sensitivity.
Because I'm a hobbyist, I'd prefer to deal with DIP packages rather than SOIC or, even worse, SSOP. The MCU should have as few pins as possible. Finally, the whole firmware of the sensor is going to be developed in C++. This requires using a Processing-based Wiring-derived IDE and, even better, one supported by embedXcode so I could use Xcode for the development. |
Selecting the Sensor and MCU
After an extensive research, I came with two short-lists, one for colour sensors and the other for MCUs.
Finally, I'm considering an affordable 4 channel colour sensor and a MSP430 MCU. As both operate at 3.3V, an additional regulator and logic level converter are required. The colour sensor meets the sensitivity requirements. The MCU comes in DIP package and can be programmed with embedXcode. As an additional but critical benefit, specific sheets are well written, clear and understandable. |
I²C Commands
Based on the functional specifications and after extensive tests on a prototype based on an Arduino board, I defined three sets of commands:
Learn more about the commands. |
Building the Prototype
Finalised and Working Sensor
The sensor is finalised, integrated into a standard fischertechnik 9 V battery box and working!
Extensive testing was performed during the Hannover Maker Faire held August 3rd, 2013. The smartColours sensor ran continuously during 10 hours, identified 600 cylinders and failed to recognise the right colour 8 times only. With a successful rate of 98,7%, the smartColours sensor is thus highly reliable. |