Benutzer-Werkzeuge

Webseiten-Werkzeuge


t5_electro

IEC62056-CAN-Brücke

Hardware

Atmega328PB (Pololu A* 328PB Micro 5V 16MHz Item #3160, alternativ Wattuino Pro Mini PB 5V/16MHz), MCP2515-Modul schaltbar versorgt über separaten MCP1755T, 2*TEKT5400S, [2*LPT80A].

  1. CAN+9V - 2200uF - CANGND - A*328PB GND - MCP1755T GND, CAN+9V - A*328PB VIN - MCP1755T VIN - 1uF - MCP1755T GND
  2. MCP1755T GND - MCP2515 GND, MCP1755T VOUT - MCP2515 VCC - 1uF - MCP1755T GND
  3. CANL - MCP2515 CANL, CANH - MCP2515 CANH
  4. A*328PB ↔ MCP1755T: VCC5V - 10k - D4 - !SHDN
  5. A*328PB ↔ MCP2515: D20 - CS, D21 - SI, D14 - SO, D15 - SCK, D2 - INT
  6. A*328PB: VCC5V - 1k - D0(RXD0) + BlauWeiss - TEKT5400S ZÜ - Blau - GND
  7. A*328PB: VCC5V - 1k - D12(RXD1) + BraunWeiss - TEKT5400S ZE - Braun - GND
  8. A*328PB: VCC5V - OrangeWeiss - LPT80A ZÜ - Orange - D8 + 100k - GND
  9. A*328PB: VCC5V - GrünWeiss - LPT80A ZE - Grün - D22 + 100k - GND
  10. A*328PB: Serial debug output on D1(TXD0), Debug-Pin D5 (iec_error)

Die TEKT5400S sind in einem Gehäuse zusammen mit einem Magneten an die Zähler angeheftet.

Software

Aktuelle Version

  1. Arduino/t5/t5_electro02
  2. Arduino-Paket für Atmega328PB von Watterott, Anpassung der SPI-Bibliothek nötig
  3. ACAN2515 von Pierre Molinaro, plus eigene Erweiterungen (ACANUtil)
  4. Canboot Anpassungen für SPI1: canboot-m328pb@16mhz-mcp2515@8mhz-spi1.hex

An SML message is (usually) 404 bytes long and takes 420ms to transmit. There is one message every second per meter. Thus, there is a 580ms gap between end of message and begin of next. However, messages of the different meters may overlap, and whilst we can alternate the receptions we have only one single CAN output channel. Our serial channels have a 64 bytes reception buffer each, filled via the UART interrupt mechanism, so we can be busy 64ms before calling recv() again. A single watt report takes 9 CAN frames and 9ms in total. A full report for a single meter takes 90ms.

Our handling is as follows: Once a full correct frame has been received from one of the meters we lock the reception buffer of this meter and signal the buffer ready for transmission. In the CAN loop we check for ready buffers and accordingly emit the CAN watt report, followed every minute by a CAN full report for this meter. During CAN emission we continue to handle serial line data reception, virtually for the locked meter (if any, this should normally not happen) but into the buffer proper for the other meter, again locking the buffer and marking it ready for transmission once a full correct frame has been received.

Vorherige Version

  1. Arduino/Atmega328PB/iec62056_can_bridge
  2. Achtung! Nach dem Endezeichen '!' folgt ohne Zeilenwechsel direkt das Startzeichen '/'. Stimmt nicht!
  3. Achtung! Beim Hager-Zähler scheint die metrologische LED nicht direkt mit den Zählerstandsberichten gekoppelt zu sein.
    1. Fall 1: Metrologische LED leuchtet 12ms vor Start der seriellen Übertragung auf. Serielle Übertragung enthält noch alte Zählerstände, erst die nächste Übertragung (nach 1.7s anstatt der maximalen 4.5s) enthält die Zählerstandserhöhung.
    2. Fall 2: Metrologische LED leuchtet einmal auf, serielle Übertragung danach hat jedoch beide Zählerstände erhöht (sowohl Bezug als auch Lieferung).
    3. Fall 3: Metrologische LED leuchtet statt für ~2ms für ~1s (!) auf. Zählerstände danach ändern sich nicht. Dies scheint also KEINEN Verbrauch von 1/10Wh anzuzeigen, sondern ein Lebenssignal zu sein.
  4. iot/status/8 {"topic":"electro","ms":4542659,"id":12808,"no":8,"sw":"iec62056_can_bridge.ino, Jan 3 2021 17:42:41","hw":"AVR_NANO","iec":1,"iec_ms":4542522,"iec_data":"/EMH5----eHZ-E0028E\r\n\r\n1-0:0.0.0*255(123456-1234567)\r\n1-0:2.8.1*255(049096.9371)\r\n1-0:96.5.5*255(00)\r\n0-0:96.1.255*255(1234567890)\r\n!","iec_pe":0}
  5. iot/status/8 {"topic":"electro","ms":4542878,"id":12808,"no":8,"sw":"iec62056_can_bridge.ino, Jan 3 2021 17:42:41","hw":"AVR_NANO","iec":2,"iec_ms":4542701,"iec_data":"/HAG5eHZ010C_RWE1ZA20\r\n\r\n1-0:0.0.0*255(123456-1234567)\r\n1-0:1.8.1*255(052737.9197)\r\n1-0:2.8.1*255(031442.5865)\r\n1-0:96.5.5*255(82)\r\n0-0:96.1.255*255(1234567890)\r\n!","iec_pe":0}

Referenzen

Messungen Photodiode metrologische LED

An 5V über 100kΩ:

SFH22977W Halogen aus 50cm2,7V27uA
SFH229Zimmerbeleuchtung indirekt13mV130nA
SFH229fast dunkel0,2mV2nA
„wie“ LPT80A77W Halogen aus 50cm4,9V50uA
„wie“ LPT80AZimmerbeleuchtung indirekt1,2V12uA
„wie“ LPT80Afast dunkel4mV40nA
LPT80A77W Halogen aus 50cm1,0V10uA
LPT80AZimmerbeleuchtung indirekt11mV110nA
LPT80Afast dunkel0,2mV2nA
t5_electro.txt · Zuletzt geändert: 2022/12/02 16:57 von sebastian