Hi all
I am using sparkfun color sensor 7262 , I have a problem in calibration , i want to get R, G, B values which varies between 0 to 255 but the sensor gives me very high numbers more than 255 so I used map function using the values of calibrated samples with an industrial laboratory spectrometer the samples I used for calibration is white cloth R,G,B = 41,41,41 and black cloth sample R,G,B = 219,222,224
float RR=map(R, 11,484, 41,219);
float GG=map(G, 15,687, 41,222);
float BB=map(B,11,452, 41,224);
When I test after calibration the sensor gives the correct values for black and white but the problem is when the sensor used to read any other colors it gives wrong values
for example (blue) sample its true values 63,116,167 sensor values 51,67,104
(Pink ) sample its true values 183, 110, 118 sensor values 190,80,73
https://learn.sparkfun.com/tutorials/as726x-nirvi/all
code :
#include "AS726X.h"
AS726X sensor;
byte GAIN = 0;
byte MEASUREMENT_MODE = 3;
void setup() {
sensor.begin(Wire, GAIN, MEASUREMENT_MODE);
Serial.begin(9600);
}
void loop() {
sensor.enableBulb();
// sensor.setBulbCurrent(3);
sensor.setIndicatorCurrent(0);
sensor.setIntegrationTime(210);
sensor.setBulbCurrent(0);
sensor.takeMeasurements();
float B = sensor.getBlue();
float G = sensor.getGreen();
float R = sensor.getRed();
float RR=map(R, 11,484, 41,219); //
float GG=map(G, 15,687, 41,222); //
float BB=map(B,11,452, 41,224); //
Serial.print(RR);
Serial.print(" ");
Serial.print(GG);
Serial.print(" ");
Serial.print(BB);
Serial.println(" ");
}