I am working on an automatic data acquisition system that uses the BME280 to measure temperature, pressure and humidity.
I have been primarily constructing the project on an Arduino Mega, and was having trouble interfacing with the BME chip, hooked up in the configuration outlined below (BME280 Pinout:Arduino Mega)
I get an output of "Sensor not working, check connections" on the serial monitor.
When I run the same code on an Arduino Uno, with
Vin:3.3V
GND:GND
SDA:Analog 4
SCL:Analog 5
It works. What can I try to solve this? I found this on Stack Overflow:
"Might not be working and would need reprogramming. See the Programming section on the info page, you will need the firmware and Atmel-compatible DFU (device firmware update) software on your computer to reflash the target."
But I am unfamiliar with what this even means.
Wolframore, please see attached images of my wiring schematics. I have tried both 3.3V and 5V for Vin as the BME chip I am using has a built in voltage regulator.
Riva, I know the chip has a built in regulator, not sure if that is the level shifter you are referring to.
GolamMustafa, I am using the same BME sensor, I could get it to work running 3.3V to it. I just tried 5V from the Mega and got the same output.
The SDA/SCL pins on the sensor are connected to the SDA/SCL ports on the MEGA respectively. Unless the Sensor SDA should be going to the Mega SCL and vice versa.
GodOfHammers: @Riva, it does, at address 0x76, which is what I have been specifically assigning to the sensor in my sketch
That's good. It means your connected and the module responds okay using I2C on the Mega (assuming you did the test on the Mega) so the problem is somewhere in the code.
Maybe try the Sparkfun library for the BME280 to see if it fairs better.
If you search for this then do you see an image that looks correct?
wolframore:
Reread Golam’s reply. He has the BME working on his Mega using 5v.
Yes I had read it, hence the 'Good point' statement. I was just point out what I was hoping to be the problem.
If the OP has tested the module on the Mega with the I2C scanner and found it I can think of no other sensible reason for it not to work on the Mega but work on the UNO.
GolamMostafa: 2. This is the BME280 which I am using; it has a built-in 5V/3.3V regulator. So, it has to be operated from 5V and not from 3.3V.
It seems to me that the module your picture shows has neither a 3.3V regulator nor any level shifting.
Do you have a picture of the backside of the module to support your claim "it has a built-in 5V/3.3V regulator"?