Digital-Upgrade MeteoStation

Status
Es sind keine weiteren Antworten möglich.

steins-ursel

Aktives Mitglied
Hallo!

Nach langem hin und her, auch ein wenig Hardwareprobleme, läuft nun die MeteoStation rein Digital.
Vorteil: die Sensoren sind vom Werk aus kalibriert, mit geringem Toleranzen. Auch ist der Zoo von 3 Temperaturwerten entfallen.
Der alte bekannte Melexis MLX90614 (I2C) für Infrarot bleibt bestehen.
Neu ist der TSL2591 (I2C) für die Helligkeit (genau genommen Dunkelheit), er ersetzt das Solarpanel (Analog).
Der BME280 (I2C) ist auch ein neues Stück HW. Er ersetzt den Feuchtesensor DHT 22 (1-Wire) und den BMP180 (I2C).
Beim BME290 hatte ich die Probleme, dass nur der von Adafruit sauber an der Station läuft.
Die Grundplatine ist nur um einen I2C Steckplatz erweitert worden, ich kann also jederzeit wieder downgraden.
Anbei ein Auszug der Definitionen in c:
Station mit analog
C:
#include <Adafruit_BME280.h>

/* INDIDUINOMETEO FIRMWARE.
  NACHO MAS 2013. http://indiduino.wordpress.com
  Magnus W. Eriksen 2017 https://github.com/magnue

  Several modifications over indiduinoTemplate:
  .- Include  "i2cmaster.h",  "Adafruit_BMP085.h", "Adafruit_MLX90614.h" and  "dht.h" libraries
   to read the sensors.
  .- Add custimization of pinnumbers, and flags for frezzing and daylight.
  .- Allow user to disable any sensor(s) and its (their) code when compiling.
  .- Several additional functions to read the sensor and calculate flags,
   cloudcover and dew point.
  .- Extend event loop fail checks to awoid reading values from unreadable sensors (IR, P and DHT).
  .- Overwrite firmata TOTAL_ANALOG_PINS and TOTAL_PINS to make room for
   aditional (>6) analog calculate inputs.
  .- Use pullup resitor on inputs for signal flags.
  .- Made new firmware version to make use of recent sensors (BME280 and TSL2591). G. Gagnon 2019
  .- Added BME280 support (BME280 includes Barometric pressure, humidity and temperature sensors)
     -> Removed BMP and DHT G.Gagnon 2019
  .- Added TSL2591 support to replace irradiance sensor. Provides estimate of Sky Quality. G. Gagnon 2019
  .- BME280 and TSL2591 are I2C sensors that connect the same as the MLX90614, through an I2C bus. It is recommended to get
    3.3 volts parts along with the Arduino (Arduino Pro Mini is available in a 3.3V version) to avoid having to use level
    shifters.

  IMPORTANT: Customize following values to match your setup
*/

// Comment out if your setup don't include some sensor.Some sensor combinations are exclusive; BME280 replaces both
// DHT and BMP series sensors, TSL replaces the irradiance sensor but could be used alongside it is the firmware is
// modified appropriately.
#define USE_DHT_SENSOR          //USE DHT HUMITITY SENSOR. Comment if not.
#define USE_MLX_SENSOR            //USE MELEXIS IR SENSOR. Comment if not.
//#define USE_BME_SENSOR            //USE BME280 ENVIRONMENT SENSOR. Comment if not.
//#define USE_TSL_SENSOR            //USE TSL2591 SENSOR. Comment if not.
#define USE_P_SENSOR            //USE BMP085 PRESSURE SENSOR. Comment if not.
#define USE_IRRADIANCE_SENSOR   //USE IRRADIANCE SENSOR (solar cell). Comment if not.

Rein digital neu:
C:
/* INDIDUINOMETEO FIRMWARE.
  NACHO MAS 2013. http://indiduino.wordpress.com
  Magnus W. Eriksen 2017 https://github.com/magnue

  Several modifications over indiduinoTemplate:
  .- Include  "i2cmaster.h",  "Adafruit_BMP085.h", "Adafruit_MLX90614.h" and  "dht.h" libraries
   to read the sensors.
  .- Add custimization of pinnumbers, and flags for frezzing and daylight.
  .- Allow user to disable any sensor(s) and its (their) code when compiling.
  .- Several additional functions to read the sensor and calculate flags,
   cloudcover and dew point.
  .- Extend event loop fail checks to awoid reading values from unreadable sensors (IR, P and DHT).
  .- Overwrite firmata TOTAL_ANALOG_PINS and TOTAL_PINS to make room for
   aditional (>6) analog calculate inputs.
  .- Use pullup resitor on inputs for signal flags.
  .- Made new firmware version to make use of recent sensors (BME280 and TSL2591). G. Gagnon 2019
  .- Added BME280 support (BME280 includes Barometric pressure, humidity and temperature sensors)
     -> Removed BMP and DHT G.Gagnon 2019
  .- Added TSL2591 support to replace irradiance sensor. Provides estimate of Sky Quality. G. Gagnon 2019
  .- BME280 and TSL2591 are I2C sensors that connect the same as the MLX90614, through an I2C bus. It is recommended to get
    3.3 volts parts along with the Arduino (Arduino Pro Mini is available in a 3.3V version) to avoid having to use level
    shifters.

  IMPORTANT: Customize following values to match your setup
*/

// Comment out if your setup don't include some sensor.Some sensor combinations are exclusive; BME280 replaces both
// DHT and BMP series sensors, TSL replaces the irradiance sensor but could be used alongside it is the firmware is
// modified appropriately.
//#define USE_DHT_SENSOR          //USE DHT HUMITITY SENSOR. Comment if not.
#define USE_MLX_SENSOR            //USE MELEXIS MLX90614IR SENSOR. Comment if not.
#define USE_BME_SENSOR            //USE BME280 ENVIRONMENT SENSOR. Comment if not.
#define USE_TSL_SENSOR            //USE TSL2591 SENSOR. Comment if not.
//define USE_P_SENSOR            //USE BMP085 PRESSURE SENSOR. Comment if not.
//#define USE_IRRADIANCE_SENSOR   //USE IRRADIANCE SENSOR (solar cell). Comment if not.

Zum Schluss noch die Änderungen für das Display:
C:
void display(){     //output Display
//skyT, mag_arcsec2,, T, P, HR,, Dew, Clouds,
  if (sw==30*tf) dispside(49);
  else if (sw==36*tf){
      dispinit();
      flout("SkyTemp",skyT,223,67,1);
      flout("SkyQual",mag_arcsec2,109,97,2);
      DOG.position(3,3);
      DOG.string("(mag/arcsec^2)");
  }
  else if (sw==60*tf) dispside(50);
  else if (sw==66*tf){
      DOG.clear_display();
      flout("Temper.",T,223,67,1);
      flout("Pressur",P/100,109,98,2);
      flout("Humid-R",HR,37,32,3);

  }
  else if (sw==90*tf) dispside(51);
  else if (sw==96*tf) {
      DOG.clear_display();
      flout("Dewpoin",Dew,223,67,1);
      flout("Clouds",Clouds,37,32,3);   
      sw = 0;
  } 
  sw++;
}

Viel Spaß beim nachbauen :cool:
 

Anhänge

  • Sensor_alt.JPG
    Sensor_alt.JPG
    409,1 KB · Aufrufe: 194
  • Sensor_neu.JPG
    Sensor_neu.JPG
    335,2 KB · Aufrufe: 166
  • Sensor_neu_side1.JPG
    Sensor_neu_side1.JPG
    149 KB · Aufrufe: 171
  • Sensor_neu_side2.JPG
    Sensor_neu_side2.JPG
    155,5 KB · Aufrufe: 168
  • Sensor_neu_side_3.JPG
    Sensor_neu_side_3.JPG
    159,4 KB · Aufrufe: 172
Hi Thomas

Nice, nice - immer wieder schön anzusehen, was bei dir alles geht :y:

Grüsse, David
 
Hallo,
Ich werde mal schauen, wie ich den gesamten Quelltext hier sinnvoll posten kann.
Sind über 1000 Zeilen, der Großteil ist von Github, Displayteil ist von mir.
 
Hallo!

Anbei der Vollständige Quelltext, Original auf github, Erweiterungen zum Display von mir.
Einfach im Programm Arduino eine neuen Sketch erstellen, Text rein kopieren, speichern, zusätzliche Bibliotheken ziehen und installieren (Adafruit und DOGM), kompilieren (hoffentlich ohne Fehler), hochladen, fertig :)
Da das Ganze über Bluetooth angebunden ist, habe ich die Baudrate auf 9600 eingestellt.
Lässt sich in Zeile 1310 ändern. Die Variable tf erhöht nach einem Connect mit INDI den Durchlauf um den Faktor 15, damit man auch noch was am Display ablesen kann, ansonsten ginge es viel zu schnell.
 

Anhänge

Zuletzt bearbeitet:
Status
Es sind keine weiteren Antworten möglich.
Zurück
Oben