Wetterstation HB-UNI-SEN-WEA

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

Moderator: Co-Administratoren

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 » 05.02.2019, 20:54

Ich habe da noch mal eine Frage ;)

Es läuft jetzt alles bis auf dem MAX44009 Sensor.

Da erhalte ich beim Initialisieren immer folgenden Fehler:

Code: Alles auswählen

AskSin++ V3.1.1 (Feb  5 2019 20:39:50)
20:40:26.977 -> MAX44009 Sensor Error 2
20:40:26.977 -> BME280 sensor OK
Address Space: 32 - 86
20:40:27.464 -> CC init1
20:40:27.464 -> CC Version: 04
 - ready
20:40:27.498 -> * Config Changed       : List0
20:40:27.533 -> * SENDEINTERVALL       : 10
20:40:27.533 -> * Config changed       : List1
WINDDIR aVal  : 1023 :: tolerance = 10 :: i = 0
20:40:30.537 -> BME280:
20:40:30.537 -> -T    : 179
20:40:30.537 -> -P    : 10093
20:40:30.537 -> -P(NN): 10284
20:40:30.537 -> -H    : 38
20:40:30.537 -> -DP   : 35
<- 1A 01 A0 70 F1D002 4F6DA4 00 B3 28 2C 26 00 00 00 00 00 00 00 00 00 00 00 00  - 3588
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 B3 28 2C 26 00 00 00 00 00 00 00 00 00 00 00 00  - 4237
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 B3 28 2C 26 00 00 00 00 00 00 00 00 00 00 00 00  - 4886
waitAck: 00
<- 1A 01 A0 70 F1D002 4F6DA4 00 B3 28 2C 26 00 00 00 00 00 00 00 00 00 00 00 00  - 5535
waitAck: 00
SENDING EXTRA MESSAGE 1
<- 0D 02 A0 53 F1D002 4F6DA4 41 03 00 00  - 11175
waitAck: 00
<- 0D 02 A0 53 F1D002 4F6DA4 41 03 00 00  - 11812
waitAck: 00
<- 0D 02 A0 53 F1D002 4F6DA4 41 03 00 00  - 12449
waitAck: 00
20:40:40.054 -> <- 0D 02 A0 53 F1D002 4F6DA4 41 03 00 00  - 13086
waitAck: 00
20:40:40.689 -> SENDING EXTRA MESSAGE 0
<- 0D 03 A0 53 F1D002 4F6DA4 41 03 00 00  - 13725
waitAck: 00
20:40:41.347 -> <- 0D 03 A0 53 F1D002 4F6DA4 41 03 00 00  - 14362
waitAck: 00
<- 0D 03 A0 53 F1D002 4F6DA4 41 03 00 00  - 14997
waitAck: 00
<- 0D 03 A0 53 F1D002 4F6DA4 41 03 00 00  - 15634
-> 0A 03 80 02 4F6DA4 F1D002 00  - 15759
20:40:42.774 -> waitAck: 01
20:40:42.774 -> <- 0C 04 A2 41 F1D002 4F6DA4 41 00 C8  - 15792
Der Rest scheint nun problemlos zu funktionieren. Ich habe die Lötstellen nochmal kontrolliert und den Stecker neu gecrimpt. Hat noch jemand eine Idee was ich probieren könnte um den Sensor ans fliegen zu bekommen?

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 » 05.02.2019, 22:29

Der MAX44009 kann mehrere Adressen haben.

Im Sketch wird er standardmäßig mit 0x4a adressiert.

Ggf. findest du mit nem I2C Scanner die richtige Adresse raus https://playground.arduino.cc/Main/I2cScanner

Oder du probierst mal abwechselnd einen H oder L Pegel an A0.
https://www.mikrocontroller.net/topic/399373
Mit der Leitung A0 wählst Du zwischen 4a/4b bzw. zwischen 94/96 aus.

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, 07:39

jp112sdl hat geschrieben:
05.02.2019, 22:29
Ggf. findest du mit nem I2C Scanner die richtige Adresse raus https://playground.arduino.cc/Main/I2cScanner
Vielen Dank, so etwas habe ich gesucht. Werde das nachher mal ausprobieren :)

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, 18:00

Mh. der Testsketch gibt mir folgende Adresse aus: 0x4a

Du sagtest, dass diese bereits Standardmäßig im Sketch verwendet wird. Wo finde ich das denn, wenn ich nach 0x4a suche finde ich nichts im Code.

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, 18:04

Wird im Sketch ohne Parameter initialisiert:
https://github.com/jp112sdl/HB-UNI-Sen- ... A.ino#L325

Somit werden die default Template-Vorgaben genutzt:
https://github.com/pa-pa/AskSinPP/blob/ ... 4009.h#L41

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, 18:09

Ok, vielen Dank für die schnelle Antwort. Gibt es sonst noch Ideen woran es liegen könnte?

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, 18:36

Lad dir mal die Lib und probier den mitgelieferten Testsketch aus.
Wird dann eine Helligkeit angezeigt?
https://github.com/RobTillaart/Arduino/ ... s/Max44009

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, 19:06

Folgender Sketch funktioniert ohne Probleme. Das Modul an sich scheint also i.o. zu sein.

Code: Alles auswählen

// Distributed with a free-will license.
// Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
// MAX44009
// This code is designed to work with the MAX44009_I2CS I2C Mini Module available from ControlEverything.com.
// https://www.controleverything.com/products

#include<Wire.h>

// MAX44009 I2C address is 0x4A(74)
#define Addr 0x4A

void setup()
{
  // Initialise I2C communication as MASTER
  Wire.begin();
  // Initialise serial communication, set baud rate = 9600
  Serial.begin(9600);

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select configuration register
  Wire.write(0x02);
  // Continuous mode, Integration time = 800 ms
  Wire.write(0x40);
  // Stop I2C transmission
  Wire.endTransmission();
  delay(300);
}

void loop()
{
  unsigned int data[2];

  // Start I2C Transmission
  Wire.beginTransmission(Addr);
  // Select data register
  Wire.write(0x03);
  // Stop I2C transmission
  Wire.endTransmission();

  // Request 2 bytes of data
  Wire.requestFrom(Addr, 2);

  // Read 2 bytes of data
  // luminance msb, luminance lsb
  if (Wire.available() == 2)
  {
    data[0] = Wire.read();
    data[1] = Wire.read();
  }

  // Convert the data to lux
  int exponent = (data[0] & 0xF0) >> 4;
  int mantissa = ((data[0] & 0x0F) << 4) | (data[1] & 0x0F);
  float luminance = pow(2, exponent) * mantissa * 0.045;

  // Output data to serial monitor
  Serial.print("Ambient Light luminance :");
  Serial.print(luminance);
  Serial.println(" lux");
  delay(300);
}

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, 19:33

Funktioniert der Sketch genau an dem Pro Mini der Wetterstation inkl. parallel angeschlossenem BME280?

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, 19:52

Jap, habe ihn gerade an der Platine aangeschlossen inkl BME280 und Veml6070. Läuft ohne Probleme. Die Anfangswerte scheinen nicht ganz plausibel, aber dann kommt es hin.

Code: Alles auswählen

Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :4792.32 lux
Ambient Light luminance :0.00 lux
Ambient Light luminance :24.48 lux
Ambient Light luminance :24.48 lux
Ambient Light luminance :24.48 lux
Ambient Light luminance :36.72 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :39.78 lux
Ambient Light luminance :24.48 lux
Ambient Light luminance :24.48 lux
Ambient Light luminance :30.60 lux
Ambient Light luminance :30.60 lux
Ambient Light luminance :30.60 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :244.80 lux
Ambient Light luminance :269.28 lux
Ambient Light luminance :269.28 lux
Ambient Light luminance :269.28 lux
Ambient Light luminance :269.28 lux
Ambient Light luminance :269.28 lux
Ambient Light luminance :269.28 lux
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 :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 :61.20 lux
Ambient Light luminance :61.20 lux
Ambient Light luminance :61.20 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :55.08 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :36.72 lux
Ambient Light luminance :36.72 lux
Ambient Light luminance :36.72 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux
Ambient Light luminance :48.96 lux

Antworten

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