Wetterstation HB-UNI-SEN-WEA

Entwicklung und Bau von Hardware aller Art, die im HM-Umfeld eingesetzt werden kann

Moderator: Co-Administratoren

jp112sdl
Beiträge: 12116
Registriert: 20.11.2016, 20:01
Hat sich bedankt: 849 Mal
Danksagung erhalten: 2150 Mal
Kontaktdaten:

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von jp112sdl » 06.02.2019, 20:00

Hmm, dann bin ich auch grad mit meinem Latein am Ende

VG,
Jérôme ☕️

---
Support for my Homebrew-Devices: Download JP-HB-Devices Addon

fanavity
Beiträge: 243
Registriert: 18.07.2017, 16:42
Hat sich bedankt: 63 Mal
Danksagung erhalten: 3 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von fanavity » 06.02.2019, 20:22

Mist. Dann warte ich noch mal ein bisschen ob noch jemand eine Idee hat.

jp112sdl
Beiträge: 12116
Registriert: 20.11.2016, 20:01
Hat sich bedankt: 849 Mal
Danksagung erhalten: 2150 Mal
Kontaktdaten:

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von jp112sdl » 06.02.2019, 20:29

fanavity hat geschrieben:
06.02.2019, 19:52
Die Anfangswerte scheinen nicht ganz plausibel, aber dann kommt es hin.

Code: Alles auswählen

Ambient Light luminance :4792.32 lux
Das ist schon seltsam. Es entspricht irgendwie exakt 0x75000.

Beim Initialisieren des Sensors im SEN-WEA wird 1x mit getLux versucht, die Helligkeit abzufragen.
Ist die Rückgabe fehlerfrei, kommt ein OK.
Offensichtlich funktioniert bei dir diese Abfrage initial nicht korrekt.

Was passiert, wenn du die anderen Sensoren entfernst?

VG,
Jérôme ☕️

---
Support for my Homebrew-Devices: Download JP-HB-Devices Addon

fanavity
Beiträge: 243
Registriert: 18.07.2017, 16:42
Hat sich bedankt: 63 Mal
Danksagung erhalten: 3 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von fanavity » 06.02.2019, 20:47

Nur der Max4406

Code: Alles auswählen

Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :85.68 lux
Ambient Light luminance :79.56 lux
Ambient Light luminance :79.56 lux
Ambient Light luminance :48.96 lux
Mit BME

Code: Alles auswählen

Ambient Light luminance :79.56 lux
Ambient Light luminance :79.56 lux
Ambient Light luminance :79.56 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :45.90 lux
Ambient Light luminance :45.90 lux
Ambient Light luminance :45.90 lux
Ambient Light luminance :45.90 lux
Ambient Light luminance :30.60 lux
Ambient Light luminance :30.60 lux
Ambient Light luminance :3.06 lux
Ambient Light luminance :3.06 lux
Ambient Light luminance :3.06 lux
Ambient Light luminance :3.06 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
mit Veml6070

Code: Alles auswählen

Ambient Light luminance :71.28 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :67.32 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Ambient Light luminance :73.44 lux
Nun scheint es immer zu klappen.

Anschließend nochmal deinen Sketch drauf geschmissen und leider wieder der Fehler:

Code: Alles auswählen

AskSin++ V3.1.1 (Feb  6 2019 20:45:36)
20:46:32.609 -> MAX44009 Sensor Error 2
20:46:32.609 -> BME280 sensor OK
Address Space: 32 - 86
20:46:33.129 -> CC init1
20:46:33.129 -> CC Version: 04
 - ready
20:46:33.164 -> * Config Changed       : List0
20:46:33.164 -> * SENDEINTERVALL       : 10
20:46:33.164 -> * Config changed       : List1
WINDDIR aVal  : 1023 :: tolerance = 10 :: i = 0
20:46:36.161 -> BME280:
20:46:36.161 -> -T    : 224
20:46:36.161 -> -P    : 10008
20:46:36.161 -> -P(NN): 10195
20:46:36.161 -> -H    : 33
20:46:36.161 -> -DP   : 54
<- 1A 01 A0 70 F1D002 4F6DA4 00 E0 27 D3 21 00 00 00 00 00 00 00 00 00 00 00 00  - 3588
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 E0 27 D3 21 00 00 00 00 00 00 00 00 00 00 00 00  - 4237
-> 0A 01 80 02 4F6DA4 F1D002 00  - 4352
20:46:36.969 -> waitAck: 01

EDIT:
Ich habe hier sonst auch noch einen BH1750 liegen. Eventuell könnte ich auch den verwenden?

jp112sdl
Beiträge: 12116
Registriert: 20.11.2016, 20:01
Hat sich bedankt: 849 Mal
Danksagung erhalten: 2150 Mal
Kontaktdaten:

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von jp112sdl » 06.02.2019, 22:56

Hmm... evtl. mal ein paar Debugausgaben in die Max44009.h einbauen, um zu schauen wo es hängt.
Oder die Fehlerprüfung testweise rausschmeißen und schauen, ob plausible Werte gelesen werden.

BH1750 ginge auch, der hat aber halt nicht so einen hohen Messbereich.

VG,
Jérôme ☕️

---
Support for my Homebrew-Devices: Download JP-HB-Devices Addon

fanavity
Beiträge: 243
Registriert: 18.07.2017, 16:42
Hat sich bedankt: 63 Mal
Danksagung erhalten: 3 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von fanavity » 07.02.2019, 07:29

jp112sdl hat geschrieben:
06.02.2019, 22:56
Hmm... evtl. mal ein paar Debugausgaben in die Max44009.h einbauen, um zu schauen wo es hängt.
Oder die Fehlerprüfung testweise rausschmeißen und schauen, ob plausible Werte gelesen werden.
...
Dann werde ich das zuerst probieren. Melde mich heute Abend wieder ;)

spaceduck
Beiträge: 447
Registriert: 02.06.2010, 08:07
Hat sich bedankt: 1 Mal
Danksagung erhalten: 9 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von spaceduck » 07.02.2019, 09:32

Was auch noch ein Thema sein könnte: Auf jedem der 3 Sensor Breakout Boards sind die 10k Pull-up Widerstände für den I2C Bus vorhanden. Die sind dann alle parallel, ich würde die bei 2 Boards entfernen.

spaceduck
Beiträge: 447
Registriert: 02.06.2010, 08:07
Hat sich bedankt: 1 Mal
Danksagung erhalten: 9 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von spaceduck » 07.02.2019, 16:20

Für alle die noch auf der Suche nach einer UV durchlässigen Abdeckung für den VEML6070 sind:
https://www.modulor.de/lichtkuppeln-acr ... arent.html

fanavity
Beiträge: 243
Registriert: 18.07.2017, 16:42
Hat sich bedankt: 63 Mal
Danksagung erhalten: 3 Mal

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von fanavity » 07.02.2019, 17:07

jp112sdl hat geschrieben:
06.02.2019, 22:56
Hmm... evtl. mal ein paar Debugausgaben in die Max44009.h einbauen, um zu schauen wo es hängt.
Oder die Fehlerprüfung testweise rausschmeißen und schauen, ob plausible Werte gelesen werden.
Habe mal ein Paar Ausgabe eingebaut und die Fehlerprüfung entfernt:

Code: Alles auswählen

//
// Main Parts are from
//  AUTHOR: Rob dot Tillaart at gmail dot com
// VERSION: 0.1.9
// PURPOSE: library for MAX44009 lux sensor Arduino
// HISTORY: See Max440099.cpp
//
// Released to the public domain
//
//- -----------------------------------------------------------------------------------------------------------------------
// AskSin++
// 2018-04-03 papa Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
// 2018-07-04 jp112sdl Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//- -----------------------------------------------------------------------------------------------------------------------

#ifndef __SENSORS_MAX44009_h__
#define __SENSORS_MAX44009_h__

#include <Sensors.h>
#include <Wire.h>

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

// REGISTERS
#define MAX44009_CONFIGURATION      0x02
#define MAX44009_LUX_READING_HIGH   0x03
#define MAX44009_LUX_READING_LOW    0x04

// CONFIGURATION MASKS
#define MAX44009_CFG_CONTINUOUS     0x80
#define MAX44009_CFG_MANUAL         0x40
#define MAX44009_CFG_CDR            0x08
#define MAX44009_CFG_TIMER          0x07

namespace as {

template <byte ADDRESS=0x4a, uint8_t CDR=0x01, uint8_t TIM=0x03>
class MAX44009 : public Brightness {
public:
  void init () {
      Wire.begin();
      getLux();
      uint8_t err = getError();
      //if (err == 0) {
        _present = true;
        setContinuousMode();
        setManualMode(CDR, TIM);
        DPRINTLN(F("MAX44009 Sensor OK"));
      //} else {
      //    DPRINT(F("MAX44009 Sensor Error "));DDECLN(err);
      //}
  }
  void measure (__attribute__((unused)) bool async=false) {
    if( present() == true ) {
      _brightness = getLux() / 100;
      uint8_t err = getError();
      if (err != 0) {
        DPRINT("MAX44009 Sensor Error ");DDECLN(err);
      }
	  DPRINTLN(F("MAX44009:"));
      DPRINT(F("-b    : ")); DDECLN(_brightness);
    }
  }
private:
    uint8_t _error;
    uint8_t _data;
    uint32_t getLux(void) {
        uint8_t dhi = read(MAX44009_LUX_READING_HIGH);
        uint8_t dlo = read(MAX44009_LUX_READING_LOW);
        uint8_t e = dhi >> 4;
        uint32_t m = ((dhi & 0x0F) << 4) + (dlo & 0x0F);
        m <<= e;
        uint32_t val = m * 45;
        return val;
    }
    uint8_t getError() {
        uint8_t e = _error;
        _error = 0;
        return e;
    }
    void setConfiguration(const uint8_t value) {
        write(MAX44009_CONFIGURATION, value);
    }
    
    uint8_t getConfiguration() {
        return read(MAX44009_CONFIGURATION);
    }
    
    void setAutomaticMode() {
        uint8_t config = read(MAX44009_CONFIGURATION);
        config &= ~MAX44009_CFG_CONTINUOUS; // off
        config &= ~MAX44009_CFG_MANUAL;     // off
        write(MAX44009_CONFIGURATION, config);
    }
    
    void setContinuousMode() {
        uint8_t config = read(MAX44009_CONFIGURATION);
        config |= MAX44009_CFG_CONTINUOUS; // on
        config &= ~MAX44009_CFG_MANUAL;    // off
        write(MAX44009_CONFIGURATION, config);
    }
    
    void setManualMode(uint8_t _CDR, uint8_t _TIM) {
        if (_CDR != 0) _CDR = 1;
        if (_TIM > 7) _TIM = 7;
        uint8_t config = read(MAX44009_CONFIGURATION);
        config &= ~MAX44009_CFG_CONTINUOUS; // off
        config |= MAX44009_CFG_MANUAL;      // on
        config &= 0xF0; // clear CDR & TIM bits
        config |= _CDR << 3 | TIM;
        write(MAX44009_CONFIGURATION, config);
    }
    
    uint8_t read(uint8_t reg) {
        Wire.beginTransmission(ADDRESS);
        Wire.write(reg);
        _error = Wire.endTransmission();
        if (_error != 0) {
            return _data; // last value
        }
        if (Wire.requestFrom(ADDRESS, (uint8_t) 1) != 1) {
            _error = 10;
            return _data; // last value
        }
#if (ARDUINO <  100)
        _data = Wire.receive();
#else
        _data = Wire.read();
#endif
        return _data;
    }
    
    void write(uint8_t reg, uint8_t value) {
        Wire.beginTransmission(ADDRESS);
        Wire.write(reg);
        Wire.write(value);
        _error = Wire.endTransmission();
    }
};

}

#endif
Das Ergebnis bringt leider nichts :/ Egal ob mit allen 3 Sensoren oder nur mit dem MAX

Code: Alles auswählen

AskSin++ V3.1.1 (Feb  7 2019 17:02:04)
17:05:19.350 -> MAX44009 Sensor OK
17:05:19.350 -> BME280 sensor OK
Address Space: 32 - 86
17:05:19.872 -> CC init1
17:05:19.872 -> CC Version: 04
17:05:19.872 ->  - ready
17:05:19.872 -> * Config Changed       : List0
17:05:19.907 -> * SENDEINTERVALL       : 10
17:05:19.907 -> * Config changed       : List1
WINDDIR aVal  : 1023 :: tolerance = 10 :: i = 0
17:05:22.922 -> BME280:
17:05:22.922 -> -T    : 201
17:05:22.922 -> -P    : 9912
17:05:22.922 -> -P(NN): 10098
17:05:22.922 -> -H    : 33
17:05:22.922 -> -DP   : 34
17:05:22.922 -> MAX44009:
17:05:22.922 -> -b    : 0
<- 1A 01 A0 70 F1D002 4F6DA4 00 C9 27 72 21 00 00 00 00 00 00 00 00 00 00 00 00  - 3590
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 C9 27 72 21 00 00 00 00 00 00 00 00 00 00 00 00  - 4239
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 C9 27 72 21 00 00 00 00 00 00 00 00 00 00 00 00  - 4890
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 C9 27 72 21 00 00 00 00 00 00 00 00 00 00 00 00  - 5539
waitAck: 00
WINDDIR aVal  : 1023 :: tolerance = 10 :: i = 0
17:05:35.535 -> BME280:
17:05:35.570 -> -T    : 201
17:05:35.570 -> -P    : 9912
17:05:35.570 -> -P(NN): 10098
17:05:35.570 -> -H    : 32
17:05:35.570 -> -DP   : 33
17:05:35.570 -> MAX44009:
17:05:35.570 -> -b    : 0
<- 1A 02 84 70 F1D002 4F6DA4 00 C9 27 72 20 00 00 00 00 00 00 00 00 00 00 0B 00  - 16201
Leider finde ich mit Error = 2 auch nichts sinnvolles im Netz.

jp112sdl
Beiträge: 12116
Registriert: 20.11.2016, 20:01
Hat sich bedankt: 849 Mal
Danksagung erhalten: 2150 Mal
Kontaktdaten:

Re: Wetterstation HB-UNI-SEN-WEA

Beitrag von jp112sdl » 07.02.2019, 22:09

Da weiß ich jetzt wirklich nicht mehr weiter

VG,
Jérôme ☕️

---
Support for my Homebrew-Devices: Download JP-HB-Devices Addon

Antworten

Zurück zu „Hardwareentwicklung und Selbstbau von Aktoren und Sensoren“