ARM Code for color sensor

Guest #5305175
Rate this post
useful
not useful
Sir,
I am using TCS3200 color sensor. In the data sheet, it is specified that 
the output of the mentioned sensor is frequency in the form of square 
pulses. How can I find out the frequency value from that output? Anyone 
have the code for TCS3200 color sensor with ARM LPC1769? Please help.
Guest #5331215
Rate this post
useful
not useful
Neethu P wrote:
> Sir,
> I am using TCS3200 color sensor. In the data sheet, it is specified that
> the output of the mentioned sensor is frequency in the form of square
> pulses. How can I find out the frequency value from that output? Anyone
> have the code for TCS3200 color sensor with ARM LPC1769? Please help.

You can connect the pin from the sensor that generates this waveform and 
connect it to an Oscilloscope or Logic Analyzer.
Guest #5607355
Rate this post
useful
not useful
Neethu P wrote:
> Sir,
> I am using TCS3200 color sensor. In the data sheet, it is specified that
> the output of the mentioned sensor is frequency in the form of square
> pulses. How can I find out the frequency value from that output? Anyone
> have the code for TCS3200 color sensor with ARM LPC1769? Please help.

can u please share code for tcs3200 colour sensor as i am facing the
same problem........plz
Guest #5609734
Rate this post
useful
not useful
charushilakhandait@gmail.com wrote:
> as i am facing the same problem

Uuh, you face the problem that you can't use a search engine with the 
terms 'TCS3200 color sensor code' too?
1
    /*     Arduino Color Sensing Tutorial
2
     *      
3
     *  by Dejan Nedelkovski, www.HowToMechatronics.com
4
     *  
5
     */
6
     
7
    #define S0 4
8
    #define S1 5
9
    #define S2 6
10
    #define S3 7
11
    #define sensorOut 8
12
    int frequency = 0;
13
    void setup() {
14
      pinMode(S0, OUTPUT);
15
      pinMode(S1, OUTPUT);
16
      pinMode(S2, OUTPUT);
17
      pinMode(S3, OUTPUT);
18
      pinMode(sensorOut, INPUT);
19
      
20
      // Setting frequency-scaling to 20%
21
      digitalWrite(S0,HIGH);
22
      digitalWrite(S1,LOW);
23
      
24
      Serial.begin(9600);
25
    }
26
    void loop() {
27
      // Setting red filtered photodiodes to be read
28
      digitalWrite(S2,LOW);
29
      digitalWrite(S3,LOW);
30
      // Reading the output frequency
31
      frequency = pulseIn(sensorOut, LOW);
32
      // Printing the value on the serial monitor
33
      Serial.print("R= ");//printing name
34
      Serial.print(frequency);//printing RED color frequency
35
      Serial.print("  ");
36
      delay(100);
37
      // Setting Green filtered photodiodes to be read
38
      digitalWrite(S2,HIGH);
39
      digitalWrite(S3,HIGH);
40
      // Reading the output frequency
41
      frequency = pulseIn(sensorOut, LOW);
42
      // Printing the value on the serial monitor
43
      Serial.print("G= ");//printing name
44
      Serial.print(frequency);//printing RED color frequency
45
      Serial.print("  ");
46
      delay(100);
47
      // Setting Blue filtered photodiodes to be read
48
      digitalWrite(S2,LOW);
49
      digitalWrite(S3,HIGH);
50
      // Reading the output frequency
51
      frequency = pulseIn(sensorOut, LOW);
52
      // Printing the value on the serial monitor
53
      Serial.print("B= ");//printing name
54
      Serial.print(frequency);//printing RED color frequency
55
      Serial.println("  ");
56
      delay(100);
57
    }
Code from the first search engine hit:
https://howtomechatronics.com/tutorials/arduino/arduino-color-sensing-tutorial-tcs230-tcs3200-color-sensor/

Reply

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now