Monday, September 19, 2016

Detecting Colors thru a sensor using Arduino and Publishing to IBM Bluemix IoT Watson Platform.

This blog is about Publishing Color sensor data to the IBM Bluemix IoT Watson platform using the MQTT ( Message Queue Transport Telemetry Protocol)

The microcontroller is the Arduino Uno with the Ethernet shield connected to the Color Sensor.

Data being Published is the frequency of the color and is visualized on the local laptop  and on the Bluemix by installing the Node.js visualization platform.

At this point : I'd assume that the user has created the device, credentials, Authentication tokens etc on the IoT platform in Bluemix.

To get started on IoT Platform on the IBM BLuemix and get a starter trial go to -
http://console.ng.bluemix.net
The color sensor used is the TCS3200 and has 8 pins.

S0..S3 goes to Pin 4,5, 6 and 7

OUT goes to Pin 8 on the Arduino
LED and Vcc goes to 5 V on the Arduino.
In this snap below I have a tomato placed under the sensor which detects the color.





The theory behind this is the photo diode in the middle of the sensor detects the color of the object and can transmit different frequencies.

The frequency is then mapped to a value between 0 and 256.  Lower the mapping means the color is either Red , Green or Yellow depending on what is the settings for the sensor.

Each sensor sensitivity can be different and that's why this is called as the programmable sensors wherein we can program the value of the material being programmed.

The code is in https://github.com/kiranshashiny/mqtt_arduino_color_sensor_registered_to_IBMBluemix

0 Comments:

Post a Comment

<< Home