BME280 i inne czujniki zmiana pinów w kodzie Arduino

QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

Hej koledzy.

Jak w nowych bibliotekach SD zmienić piny pod, ktróre podłączony jest np BME280 - domyślnie jest pod 4 i 5 - chociaż w kodzie jest tylko adres i te 100 co nie wiem oznacza?:

Code: Select all

new Supla::Sensor::BME280(0x76, 100);
.
Potrzebował bym też biblioteki MAX44009.h na kanale temp pod Arduino - ale to prośba raczej do @klew bo sam sobie nie poradzę

Chcę przetestować działanie BME280 i MAX44009 na układzie GSM bez wifi - jak to będzie działało. Doodatkowo zasilę to z aku 18650 z ładowaniem z soilara\.
Zobaczymy jak długo podziała
jak coś nie działa to włącz zasilanie.....
Antonio
Posts: 140
Joined: Sat Dec 18, 2021 4:15 pm

Post

W testach z aku 18650 2600mAh stabilne połaczenie trzymał 22 godziny, pozom sygnału około 85 %. plik BIN od elemaya.
Zastosowałem taką antene
Screenshot 2022-05-02 at 15-48-54 SIM800L Moduł GSM GPRS Micro SIM Arduino TTL 800L.png

W taryfie na kartę na Orane IoT po 22 godzinach zeżarł 700KB
You do not have the required permissions to view the files attached to this post.
QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

Antonio wrote: Mon May 02, 2022 1:44 pm W testach z aku 18650 2600mAh stabilne połaczenie trzymał 22 godziny, pozom sygnału około 85 %. plik BIN od elemaya.
Zastosowałem taką antene
Screenshot 2022-05-02 at 15-48-54 SIM800L Moduł GSM GPRS Micro SIM Arduino TTL 800L.png


W taryfie na kartę na Orane IoT po 22 godzinach zeżarł 700KB
To mniej więcej wiem ale nie aku był ładowany z panelu słonecznego 30x30cm po oczywiście redukcji zasilania przetwornica step down do 6v wraz z układem ładowania.

Do BME280 MAM JUZ SOFT I DZIALA NA SIM800L BEZ WIFI ALECHCIALEM DORZUCUC MAX44009 DO LUX ale nie potrafię na nowe SD zrobić do niego softu jako SENSOR na kanale Temp w klux aby sprawdzić JAK TAKA STACJA POGODY BEDZIE DZIALAĆ BEZ WIFI A TYLKO NA GSM I AKKU Z LADOWANIEM Z PANELA SLONECZNEGO.
.
Ale jak widać brak zainteresowania i pomocy. Wszyscy tylko chcą aby im dać...na gotowo.
jak coś nie działa to włącz zasilanie.....
Antonio
Posts: 140
Joined: Sat Dec 18, 2021 4:15 pm

Post

Układ z solarem i ładowaniem aku mam zrobione na wifi , solar i ładowarka

https://allegro.pl/oferta/panel-solarny ... d6604cf017

ŁADOWARKA Li-Ion Li-Poly 18650 TP4056 USB-C 1A ZAB

Pomiar napiecia aku zrobiny na ADC, układ stabilnie działa do napiecia ok 3,5 V (pokazuje napiecie ale temperatury juz nie DS18B20)
Przy słonecznych dniach układ daje rade czyli solar naładuje w 100 % aku do 4,2 v

Podobny układ czce wykonac na GSM z racji braku wifi w lokalizacji.

Pomiary zużycia internetu z poprzedniego posta są pobrane z oficjalnej apki Orange (czy prawde pokazuje to inna sprawa)
GSM potestuje cały miesiąc i zobaczę jak z transferem ,oczywiście twoje rozwiązanie jest lepsze bo czujnik cały czas wysyła dane.
Narazie testuje to na taryfie IoT Orange ,ale myślę ze dyskusja otwarta która taryfa najlepsza dla takich rozwiązań

EDIT
W kwestii bibliotek niestety nie pomogę bo sam do końca tego tematu nie ogarniam
Last edited by Antonio on Mon May 02, 2022 3:24 pm, edited 1 time in total.
User avatar
klew
Posts: 13908
Joined: Thu Jun 27, 2019 12:16 pm
Location: Wrocław
Has thanked: 134 times
Been thanked: 137 times

Post

Z tego co przeglądałem na szybko kod do bme, to trzeba by przerobić trochę bibliotekę, aby dało się piny zmienić.

Przyjrzę się temu, ale dopiero po majówce. Teraz czasu brak na siadanie przed kompem ;)
Najlepsze suple dla Twojego domu :mrgreen:
QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

klew wrote: Mon May 02, 2022 3:15 pm Z tego co przeglądałem na szybko kod do bme, to trzeba by przerobić trochę bibliotekę, aby dało się piny zmienić.

Przyjrzę się temu, ale dopiero po majówce. Teraz czasu brak na siadanie przed kompem ;)
BME mam ogarnięte z pinami. WOLĘ MAX 44009 do tesów taką blibliotekę aby chodziło na tych samych co BME280. Sprzęt zmontowany , właśnie wgrywam soft pod BME bez MAX . Podłączę pod panel 30x30cm i dam znać ile wytrzymuje aku 18650 ładowane i rozładowywane przez sim800l wraz z BME.
Potrzebuję jedynie MAX44009.h na kanale Temp jako klux
jak coś nie działa to włącz zasilanie.....
elmaya
Posts: 1485
Joined: Wed Jun 27, 2018 5:48 pm
Location: El Saucejo - Sevilla

Post

BME280 set i2c Gpio.

Code: Select all

/*
  Copyright (C) AC SOFTWARE SP. Z O.O.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
#include <Wire.h>
#include <SuplaDevice.h>
#include <supla/sensor/BME280.h>

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);

// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif


#define SDA_PIN 14  // D5
#define SCL_PIN 12  // D6


void setup() {

  Serial.begin(115200);

  Wire.begin(SDA_PIN, SCL_PIN);


  // Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
  char GUID[SUPLA_GUID_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  /*
     Having your device already registered at cloud.supla.org,
     you want to change CHANNEL sequence or remove any of them,
     then you must also remove the device itself from cloud.supla.org.
     Otherwise you will get "Channel conflict!" error.
  */

  // This example adds BME280 sensor.

  new Supla::Sensor::BME280(0x76, 100); // adres 0x76, meters above sea level = 100)

  /*
     SuplaDevice Initialization.
     Server address is available at https://cloud.supla.org
     If you do not have an account, you can create it at https://cloud.supla.org/account/create
     SUPLA and SUPLA CLOUD are free of charge

  */

  SuplaDevice.begin(GUID,              // Global Unique Identifier
                    "svr1.supla.org",  // SUPLA server address
                    "email@address",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key

}

void loop() {
  SuplaDevice.iterate();
}
QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

elmaya wrote: Mon May 02, 2022 4:24 pm BME280 set i2c Gpio.

Code: Select all

/*
  Copyright (C) AC SOFTWARE SP. Z O.O.

  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version 2
  of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
#include <Wire.h>
#include <SuplaDevice.h>
#include <supla/sensor/BME280.h>

// Choose proper network interface for your card:
#ifdef ARDUINO_ARCH_AVR
// Arduino Mega with EthernetShield W5100:
#include <supla/network/ethernet_shield.h>
// Ethernet MAC address
uint8_t mac[6] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05};
Supla::EthernetShield ethernet(mac);

// Arduino Mega with ENC28J60:
// #include <supla/network/ENC28J60.h>
// Supla::ENC28J60 ethernet(mac);
#elif defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
// ESP8266 and ESP32 based board:
#include <supla/network/esp_wifi.h>
Supla::ESPWifi wifi("your_wifi_ssid", "your_wifi_password");
#endif


#define SDA_PIN 14  // D5
#define SCL_PIN 12  // D6


void setup() {

  Serial.begin(115200);

  Wire.begin(SDA_PIN, SCL_PIN);


  // Replace the falowing GUID with value that you can retrieve from https://www.supla.org/arduino/get-guid
  char GUID[SUPLA_GUID_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  // Replace the following AUTHKEY with value that you can retrieve from: https://www.supla.org/arduino/get-authkey
  char AUTHKEY[SUPLA_AUTHKEY_SIZE] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

  /*
     Having your device already registered at cloud.supla.org,
     you want to change CHANNEL sequence or remove any of them,
     then you must also remove the device itself from cloud.supla.org.
     Otherwise you will get "Channel conflict!" error.
  */

  // This example adds BME280 sensor.

  new Supla::Sensor::BME280(0x76, 100); // adres 0x76, meters above sea level = 100)

  /*
     SuplaDevice Initialization.
     Server address is available at https://cloud.supla.org
     If you do not have an account, you can create it at https://cloud.supla.org/account/create
     SUPLA and SUPLA CLOUD are free of charge

  */

  SuplaDevice.begin(GUID,              // Global Unique Identifier
                    "svr1.supla.org",  // SUPLA server address
                    "email@address",   // Email address used to login to Supla Cloud
                    AUTHKEY);          // Authorization key

}

void loop() {
  SuplaDevice.iterate();
}
A big THANK YOU @elmaya. But after 1.5 hours of research, I found out that we are adding the old way:
#include <Wire.h>
.
.
void setup () {
Wire.begin (12,13); // pin bme 12 and 13 :)
Serial.begin (115200);

I will add MAX in a moment :) because BME already works on GSM :) :) :)
.
IMG_20220502_184957.jpg
You do not have the required permissions to view the files attached to this post.
jak coś nie działa to włącz zasilanie.....
QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

klew wrote: Mon May 02, 2022 3:15 pm Z tego co przeglądałem na szybko kod do bme, to trzeba by przerobić trochę bibliotekę, aby dało się piny zmienić.

Przyjrzę się temu, ale dopiero po majówce. Teraz czasu brak na siadanie przed kompem ;)
Nic nie trzeba przerabiać!!
Dodajesz

Code: Select all

# include < Wire.h>
A w sekcji setup

Code: Select all

Wire.begin(12, 13) gdzie 12 i 13 to gpio dla bme. 
jak coś nie działa to włącz zasilanie.....
QLQ
Posts: 2512
Joined: Sun Sep 03, 2017 9:13 am

Post

Walczę jeszcze z max44009 aby chodziło na kanale temperatury z klux. Jak się jutro nie uda to i tak mam ogarnięty kod do bme280 na GSM BEZ WIFI. Podłącze akku 18650 wraz z panelem i zobaczymy jak długo to podziała ako self charging . Taki mały wklad do samowystarczalnej stacji pogodowej
.
jak coś nie działa to włącz zasilanie.....

Return to “Pomoc”