Go Down

Topic: TCS34725 RGB Sensor, Arduino Mega 2560 - no connection, not once, defect? (Read 147 times) previous topic - next topic

olafolaf

Hello there,

hope somebody can help.
This belongs not to my first work with the Arduino, so I feel kind of helpless because the Problem seems awkward.


I have an Arduino Mega 2560
and simply tried to connect it to the Adafruit TCS34725 RGB Sensor.

Every time I tested the connection through running the TCS34725 test sketch from this site
https://learn.adafruit.com/adafruit-color-sensors/programming
it showed the "no connection .. " -error.

The LED on the Sensor board works fine.
The wiring is as described in the test sketch comments in the beginning.

if i run the TCS34725autorange sketch
everything i get is:

Code: [Select]
Gain:60x Time:153ms (0xC0)
Raw R:65535 G:65535 B:65535 C:65535
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:29.61 Max lux:737.69
Compensated R:65535 G:65535 B:65535 C:65535
Lux:1531.43 CT:5201.00K

Gain:16x Time:153ms (0xC0)
Raw R:65535 G:65535 B:65535 C:65535
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:7.90 Max lux:2766.32
Compensated R:65535 G:65535 B:65535 C:65535
Lux:5742.88 CT:5201.00K

Gain:4x Time:153ms (0xC0)
Raw R:65535 G:65535 B:65535 C:65535
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:1.97 Max lux:11065.28
Compensated R:65535 G:65535 B:65535 C:65535
Lux:22971.52 CT:5201.00K

Gain:1x Time:153ms (0xC0)
Raw R:65535 G:65535 B:65535 C:65535
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:0.49 Max lux:44261.11
Compensated R:65535 G:65535 B:65535 C:65535
Lux:91886.07 CT:5201.00K

Gain:1x Time:153ms (0xC0)
Raw R:65535 G:65535 B:65535 C:65535
IR:0 CRATIO:0.00 Sat:65535 Sat75:65535
CPL:0.49 Max lux:44261.11
Compensated R:65535 G:65535 B:65535 C:65535
Lux:91886.07 CT:5201.00K


then the message repeats.
... and so on.


whats wrong ?
is there a difference in the pin connections? because its written for the arduino uno.



thanks for your help,
excuse my english,
hope its understandable



olafolaf


knut_ny

Ny

jremington

Did you carefully solder the pins to the sensor board? Double check the wiring?

It is always helpful to have a multimeter to check voltages and wiring continuity.

olafolaf

hey there,

thanks for your answers.


i didn't send code, because i used the exact example code by adafruit for the module.
no changes.


I bought it pre soldered.
i checked the connections, they work fine.
i also checked my cables, they are ok too.

i know, not much information, but the problem starts right at the beginning, so there is no more info's....



have a nice WE,
Olaf

groundFungus

That device uses I2C to communicate.  On a Mega2560 SDA goes to pin 20 and SCL goes to pin 21.  Then use an I2C scanner to see if the I2C address is correct and if the module is able to communicate on the bus.

Code: [Select]
// I2C scanner by Nick Gammon.  Thanks Nick.

#include <Wire.h>

void setup() {
  Serial.begin (115200); //*****  make sure serial monitor baud matches *****

  // Leonardo: wait for serial port to connect
  while (!Serial)
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

olafolaf

Thank you very much.
I've just been hoping for an answer like that.

Totally worked out.
pin A4 and A5 got to be connected to 20 and 21 on the MEGA2560.
It's also marked on the board itself.


Thanks again,
have a nice day!

Go Up