<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Color Sensor RGB Unit (UI Flow) (TCS3472) Data]]></title><description><![CDATA[<p dir="auto">When I read the sensor data , I always get 255 on RGB only with the RAW data I see that something changes when the color changes.</p>
<p dir="auto">Is there a table or do you have to do something before reading the data?</p>
<p dir="auto">If anyone can help me, I'd be very grateful.</p>
<p dir="auto">greet Alf</p>
]]></description><link>https://community.m5stack.com/topic/1423/color-sensor-rgb-unit-ui-flow-tcs3472-data</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 06:32:26 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1423.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 26 Oct 2019 20:17:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Wed, 15 May 2024 19:29:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2065">@crami25</a> Hi Crami, just a poke to see if you managed to make any headway with your color calibration? best,</p>
]]></description><link>https://community.m5stack.com/post/25273</link><guid isPermaLink="true">https://community.m5stack.com/post/25273</guid><dc:creator><![CDATA[gocr8]]></dc:creator><pubDate>Wed, 15 May 2024 19:29:49 GMT</pubDate></item><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Thu, 27 May 2021 23:13:27 GMT]]></title><description><![CDATA[<p dir="auto">I just started trying my M5 Fire and the first unit I was testing was the Color one. And the values were weird! I was supposed to get the Byte size values but was getting raw values of thousands!<br />
I'm going to try this code example. Really cool of you to put this here.<br />
Thanks <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2065">@crami25</a> !</p>
]]></description><link>https://community.m5stack.com/post/13924</link><guid isPermaLink="true">https://community.m5stack.com/post/13924</guid><dc:creator><![CDATA[faustofonseca]]></dc:creator><pubDate>Thu, 27 May 2021 23:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Mon, 23 Mar 2020 20:12:39 GMT]]></title><description><![CDATA[<p dir="auto">Nice work with this. Cant wait to see how your test with the ral cards work.</p>
]]></description><link>https://community.m5stack.com/post/7875</link><guid isPermaLink="true">https://community.m5stack.com/post/7875</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Mon, 23 Mar 2020 20:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Mon, 23 Mar 2020 14:55:39 GMT]]></title><description><![CDATA[<p dir="auto">Sorry it took me so long answering this question. I have been in contact with <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2284">@Alf</a>, and there seems to be a problem with the Adafruit_TCS34725.h library used for the M5Stack flow/blockly code. Here are the results and an instruction how to fix the measurements in order measuring (and displaying) reasonable data.</p>
<p dir="auto">As described in the example library for the color sensor hub I downloaded the following code for the flow/blockly environment to my M5Stack with the color hub attached:<br />
<img src="/assets/uploads/files/1584972595117-76edc618-c5ff-4396-90c2-519b13abd757-image.png" alt="0_1584972593743_76edc618-c5ff-4396-90c2-519b13abd757-image.png" class=" img-fluid img-markdown" /><br />
Then I measured a piece of bright white paper and then a piece of dark black paper. The results of the readings of tmy measurement were:</p>
<p dir="auto">black =&gt;  red: 176   green: 231   blue: 255<br />
white =&gt;  red: 192   green: 235   blue: 255</p>
<p dir="auto">If the color HUB program would work correctly, the readings shoul be 0,0,0 for black and 255,255,255 for white !</p>
<p dir="auto">If you add a variable Rawdata to the program and display the readings in a label, 4 additional values are displayed: the raw readings for the 4 sensors of the TCS3472x in the color sensor HUB (white, red, green, blue). The readings for the sensors raw readings now were:<br />
<img src="/assets/uploads/files/1584972725402-96892546-d8dd-45e4-a9eb-d604a5246d0b-image.png" alt="0_1584972720882_96892546-d8dd-45e4-a9eb-d604a5246d0b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">black =&gt; white: 18270   red: 3000     green: 6528    blue: 7852<br />
white =&gt; white: 65535   red: 13892  green: 25465   blue: 30070</p>
<p dir="auto">Doing a bit of math using the raw data values you can then make the M5Stack display the correct (and expected)  values for the RGB measurements.</p>
<p dir="auto">Because the leds of the Color Hub are always on, as  <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> correctly stated in his response, the sensor is affected by stray light from the leds By the way, M5Stack should make the Color sensor HUB casing black instead of white, diminishing the effect of stray light and also switching off the leds, when you are not taking any measurements.</p>
<p dir="auto">Putting the values read above into new values for the measurement into new values you can then correct the values of a color measurement in 4 Steps:</p>
<p dir="auto">Step 1:</p>
<p dir="auto">You will have to enter the values of raw measurement you measured above for the RGB into new variables (you don't need the datas for clear):</p>
<p dir="auto">Raw values for black:  RedB=3000 , GreenB=6528 , BlueB=7872<br />
Raw values for white:  RedW=13892, GreenW=25465 , BlueW=30070<br />
<img src="/assets/uploads/files/1584972876032-abc42fa2-c5a5-4039-8deb-b92f40bdb021-image.png" alt="0_1584972872890_abc42fa2-c5a5-4039-8deb-b92f40bdb021-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Step 3:</p>
<p dir="auto">Correct the white measurement datas subtracting the black data (correction for zero + stray light) . This corresponds to the range of measurements between black(minimum) and white (maximum):</p>
<p dir="auto">RedR=RedW-RedB , GreenR=GreenW-GreenB, BlueR=GreenW-GreenB<br />
<img src="/assets/uploads/files/1584972962089-65c12fdc-8221-4778-a594-222594bdf047-image.png" alt="0_1584972959782_65c12fdc-8221-4778-a594-222594bdf047-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Step 4:</p>
<p dir="auto">Do the same for your measured values:<br />
Read the raw data for Red, Green, Blue (#2,3,4 of the Raw data list) and put them into variables for Red,Green,Blue. Subtract the values of black readings for the values of Red, Green, Blue<br />
<img src="/assets/uploads/files/1584973420646-9faed8d0-3ed3-4369-a186-39e1af69ddf0-image.png" alt="0_1584973415811_9faed8d0-3ed3-4369-a186-39e1af69ddf0-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Step 5: Normalize the values</p>
<p dir="auto">In a normalized environment for color measurements the values for Red, Green, Blue should be in the range 0-255 corresponding to 0,0,0 for black and 255,255,255 for white</p>
<p dir="auto">So, for each color, you have to divide the values of the corrected mesurements by dividing the values of their corresponding ranges and the multplying the results by 255. In addition, you have to display the values as integers. (As alternative, you can multiply them by 100, then you get a measurement of 0-100% ).</p>
<p dir="auto"><img src="/assets/uploads/files/1584975313573-62e61b3d-abde-4111-9759-9c6c810c1bd2-image.png" alt="0_1584975284538_62e61b3d-abde-4111-9759-9c6c810c1bd2-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">This program shows the basic steps. I have used this procedure to determine the colors of smarties and building a smarties sorting machine together with <a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2284">@Alf</a> using a 5MStack, the I2C color sensor HUB and 2 servos.</p>
<p dir="auto">Another project I will have will be implementing a precise RGB multi-point-calibration. In the example above, I assumed the color sensors for RGB to have a linear response curve. I reality that isn't the case. In the multi-point-calibration, as mentioned in the TCS_3472x data sheets explaining the calibration procedure , I will use a datacolor Spydercheckr24 color chart.<br />
<img src="/assets/uploads/files/1584974840172-spyder.png" alt="0_1584974780729_Spyder.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">A last project I have, will be using the M5Stack with the color sensor Hub first calibrating and then identifying the 213 classic RAL colors. The corresponding calibration table for the RGB values together with their RAL names will be stored on the microSD card of the M5Stack. In the measurement mode the RAL numbers, the corresponding names and RGB values will be displayed on the M5Stack display. Excel tables with Ral numbers, color names in different languages and their corresponding RGB values are available online, can be downloaded and converted to csv files before storing them on the M5Stack microSDcard. I will use the RAL shade map for calibration:</p>
<p dir="auto"><img src="/assets/uploads/files/1584974641475-dd019e60-fdef-4733-aab2-7d26a40aa94b-image.png" alt="0_1584974549962_dd019e60-fdef-4733-aab2-7d26a40aa94b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Because the measurement may be varying with temperature and from sensor to sensor I made 2 improvements to my program:</p>
<p dir="auto">1: Take 10 measurements and display the mean RGB<br />
2: By pressing a Button on the M5Stack you can recalibrate the standard values for black and white with a piece of black and white paper and store them for RedB, GreenB, BlueB and RedW, GreenW and BlueW. That way, you don't have to rewrite and download your programm when you start the programm later or if you change the sensor.</p>
]]></description><link>https://community.m5stack.com/post/7873</link><guid isPermaLink="true">https://community.m5stack.com/post/7873</guid><dc:creator><![CDATA[crami25]]></dc:creator><pubDate>Mon, 23 Mar 2020 14:55:39 GMT</pubDate></item><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Sat, 26 Oct 2019 21:45:12 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1572126222857-rgb-resized.png" alt="0_1572126221443_rgb.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">I'm a beginner, and I don't know if I did anything wrong.<br />
Please have a look at my picture.</p>
<p dir="auto">thanks alf</p>
]]></description><link>https://community.m5stack.com/post/6168</link><guid isPermaLink="true">https://community.m5stack.com/post/6168</guid><dc:creator><![CDATA[Alf]]></dc:creator><pubDate>Sat, 26 Oct 2019 21:45:12 GMT</pubDate></item><item><title><![CDATA[Reply to Color Sensor RGB Unit (UI Flow) (TCS3472) Data on Sat, 26 Oct 2019 20:46:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/2284">@alf</a> The sensor is effected by ambient light</p>
<p dir="auto">255 it looks like you are only reading one channel. you need to read all three channels to get the full colour value of 255.255.255 .</p>
]]></description><link>https://community.m5stack.com/post/6167</link><guid isPermaLink="true">https://community.m5stack.com/post/6167</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Sat, 26 Oct 2019 20:46:07 GMT</pubDate></item></channel></rss>