Sensors not working properly with different board

So I got an UV radiation sensor (UV sensor) and a humidity sensor (Humidity sensor) which both work well with my arduino uno but when I try them with a different board they simple don't work (I'm using the libraries included in the links). All I get is a message saying the sensors weren't detected.

The board I'm using is based on the Atmega 2560 micro controller and everything else about it works well except for those sensors. I couldn't find any reference to the board it self online but it is basically an arduino mega 2560.

I cant use any other board as this is for a competition where we are restricted to the one they give us.

Thanks in advance and sorry if this isn't the correct section couldn't find one that fitted the problem.

They are two different sensors, the UV sensor is I2C and the DHT<something> has its own protocol.

Which pins do you use for the I2C ? Did you run the i2c_scanner ?

Do you use a pullup resistor for the DHT<something> ?

The ATmega2560 is older than the ATmega328P. The ATmega2560 needs at least 4.5V, but if they both run at 5.0V there should be not a big difference.

I'm guessing that the board you got the sensors working on was an UNO and the one that "fails" is a mega. This will be due to the pins for I2C being different. I'd also hazard a guess that the humidity sensor you're using is one of those I2C variants so you have the same problem here too.

Doubt we'll ever get to the bottom of this unless you furnish details, but I suspect that you've already realised your mistake so we're unlikely to hear any more about it.

thanks for replying. Yes I used a pullup resistor for the humidity sensor and wired all the sensors correctly I think but here's the information they provide about the board:

So I wired the humidity sensor to dp4 and the sda and scl to dp32 and 33 is there any mistake with the wiring??

I will try the i2c_scanner when I get home and see if I get any luck.

Is it running at 16MHz ?
This is the Arduino pinmapping :

yup it is running on 16mhz.
I going to try the i2c_scanner now lets see...

yup it detects the uv sensor.
Can it be the libraries I m using that aren't compatible with this board??

Any ideas??

I read your Reply #5 before you added the text. When you added the text, I was not notified for a new post. ::slight_smile:
I was notified with your Reply #6 :smiley:

This is the page for it : SI1145 Digital UV Index / IR / Visible Light Sensor : ID 1777 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
This is the library for it : GitHub - adafruit/Adafruit_SI1145_Library: Arduino library for the SI1145 sensors in the Adafruit shop

It uses I2C and there is nothing strange in the source code. I think it will work on a ATmega2560.
Did you try the example with that library ? I mean: just the example, no other code.

It is possible that the i2c_scanner detects a I2C device, but due to bad power supply of the sensor it does not work when used in a normal way. That situation is very exceptional, maybe if you have a bad breadboard, or very long wires.

Yup, I tried the example that came with the library.

I even tried powering the uv sensor with an external power supply without any luck.

Thats very strange, I can not see something in the code that would not work on the Mega.
The UV sensor GND is connected to the Mega GND ?
And the UV sensor Vin to the Mega 5V ?
And you use Arduino IDE 1.6.0 ?
And you don't use a flat ribbon cable for I2C ? because the I2C bus doesn't like that.

I have no more ideas. Sorry.
It is almost impossible that it is something in the bootloader.
What did the example say ? I guess "Adafruit SI1145 test", and after that ? "Didn't find Si1145" or "OK!" ?
You could make a photo of it, perhaps we can see something that is odd.

I cant imagine whats going wrong either! I have been playing with arduinos for about 3 to 4 years and have never experienced nothing like this.
Here are some photos of the wiring and the serial output:

thanks any way for your time. If I find any solution I will give news.

There is still hope my IDE is 1.0.6 I though it was 1.6.0 lets see if with the newer version this gets fixed!! Fingers crossed!

I cant download the arduino ide for windows neither the installer nor the zip, is it my problem or it is simply a bug on the site??

EDIT: Now the downloads are working fine, lets see.

Hmm arduino 1.6.0 doesnt even has the tminus board but it is properly installed at my documents\arduino\hardware...

Thanks for the photos, everything seems okay.
Can you measure the 5V with a multimeter ?
Can you try a different location on the breadboard, they can have bad contacts.

The ID is read from the UV sensor.

uint8_t id = read8(SI1145_REG_PARTID);
if (id != 0x45) return false; // look for SI1145

You could try to print the ID that is returned. I didn't find that it was changed, so it must be 0x45, but perhaps it is always 0x00 or 0xFF.

By now I should have an idea in which direction to look for the problem. But I have no idea. It is very strange.

I had already measured the 5V and just measured now to confirm got 4.97v.
Changed the bread board location still "no sensor found".
So I changed the library to output the id and it printed 64, so changed:

uint8_t id = read8(SI1145_REG_PARTID);
if (id != 0x45) return false; // look for SI1145


uint8_t id = read8(SI1145_REG_PARTID);
if (id != 64) return false; // look for SI1145

And it started to print values but they weren't making much sense so I tried it with the uno and the values didnt match up so it wasnt solved. While using the uno the sensor id outputed by the library mod I did was 69 but why does it changes?? Is the tminus board requesting a different byte??

No. The I2C is always the same.
0x45 = 69 and 64 = 40.
That is missing two bits of the SDA. The SDA is kept too low for too long ? Or there are wrong spikes on the SCL line.
Is one of the wires broken or half-broken ?
Or the SI1145 is damaged ?

SI1145 cant be damaged as it works with the uno right?? I also used the same wires with the uno so they aren't the problem.
So how do I know if the SDA is kept too low for too long ? Or there are wrong spikes on the SCL line?

Have you tried putting pullup resistors on your scl and sca signals?

Here is another photo, but not the same layout:

The Adafruit board has pullup resistors on both sides of the onboard level shifter. Two times 10k, that is about 5k for each. There could be a fault with those pullup resistors, so you can try extra 4k7 or 10k pullup resistors.

Finally I have a good idea: I think 10% chance that there is not enough decoupling of the 5V of the ATmega2560 and 20% chance the ATmega2560 has damaged I2C pins. Perhaps you have to give up on this board.
Could you add capacitors to the 5V and GND pins. Small ones 100nF but also larger ones, 22uF to 1000uF.
You also need another board to test the I2C, that is the only way to determine if the I2C pins are damaged.

It is not enough to test the output and input function of the I2C pins, because there is also I2C hardware inside the ATmega2560 chip.

Tested the i2c pins with my uno everything worked fine using the tminus board as slave or master.

I dont have capacitors so cant add then to 5v and gnd.

I will try to see if I can get the uv intensity from the sensor without using the library, wish me luck!