Hi, I'm trying to create a weather station with Arduino uno, shield ethernet and bme280 but it won't work.
If you want more than just sympathy, you will have to post a whole lot more detail than that.
Just keep in mind that we can't see what you can, and we don't know what "won't work" means to you.
I don't have a BMP280, but have had great success with its predecessor the BMP180, basically using the adafruit example code. What code are you using?- adafruit has a tutorial and code for the 280 here.
Just for interest, the pic shows my output fed to adafruit's IoT MQTT site, using a nodemcu.
francesco28:
Hi, I'm trying to create a weather station with Arduino uno, shield ethernet and bmp280 but it won't work.
I expect there's a problem with the code you're using or the way you have things connected. But it's just a guess.
Do you want to give us a bit more information to go on?
Steve
I connected the pin of the bmp280 sensor like this:
- VCC-->3,3V
- GND-->GND
- SCL-->12
- SDA-->11
- SDO-->GND
And this is the code:
#include "ThingSpeak.h"
#include <Wire.h>
#include <Adafruit_BMP085.h> // la libreria Adafruit BMP085 funziona anche per il sensore BMP180
#include <SPI.h>
#include <Ethernet.h>
#define USE_ETHERNET_SHIELD
Adafruit_BMP085 bmp;
// Configurazione indirizzo mac della Ethernet shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
EthernetClient client;
// inseriamo i valori del nostro canale Thingspeak
unsigned long myChannelNumber = ******;
const char * myWriteAPIKey = "********";
void setup() {
// inizializziamo le componenti
Ethernet.begin(mac);
ThingSpeak.begin(client);
bmp.begin();
}
void loop() {
//ThingSpeak.setField(1,bmp.readTemperature());
float temperatura = bmp.readTemperature();
Serial.print("Temperatura");
Serial.println(temperatura);
ThingSpeak.setField(1,temperatura);
float pressure_mb = (bmp.readPressure())/100; // diviso 100 per avere la lettura in millibar
ThingSpeak.setField(2,pressure_mb);
// Manda i valori che hai impostato tutti in una sola volta.
ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
delay(20000); // ThingSpeak accetterà solo aggiornamenti ogni 15 secondi.
}
There's something wrong with it?
I connected the pin of the bmp280 sensor like this:
VCC-->3,3V
GND-->GND
SCL-->12
SDA-->11
SDO-->GND
Those aren't I2C pins on a Uno, which are A4 (SDA) and A5 (SCL). Also duplicated next to the reset button.
Ok, now I changed the pin connection
VCC-->3,3V
GND-->GND
SCL-->A5
SDA-->A4
Now Arduino gives in output 0°C and 0 pressure
Does the board have level shifters on it? It is hard to tell from only a rear-view.
How long are the wires? I2C cannot go long distances. More than 3 feet will require some effort.
. . .
#include <Adafruit_BMP085.h> // la libreria Adafruit BMP085 funziona anche per il sensore BMP180
. . .
Wouldn't you have more luck with the Adafruit BMP280 library?
Don
I did everything suggested and all my ESPNodeMCU and Wemos D1 mini pros have errors. If I change the BMP Arduino.h to 0x76 it craps out. If I try and run I2c nothing shows up. I think I might move some sketches that work and then uninstall ALL Arduino and start over. Ughhh
Why have you touched Arduino.h ?