Difference between revisions of "APC7921-esp"

From Technologia Incognita
Jump to: navigation, search
(Iteration 1)
(Steps to be taken)
Line 43: Line 43:
  
 
= Steps to be taken =
 
= Steps to be taken =
 +
 +
* Experiment with [[https://esphome.io/components/sensor/ct_clamp.html ESPHome Current-clamp sensor support]] using onboard Current-transformer(s)
 +
* Check function of relay board with 3.3V IO
 +
* Work on approach for driving LED-display OR replace with TFT/OLED (all supported by ESPHome)
 +
* Produce some extra 2mm->2.54mm convertor-cables for experimentation/splicing
 +
* PCB design, first steps
 +
** Make PCB-template for KiCad based on measurements
 +
** Produce BOM for essential components; headers, jacks, PSU, Schottky-diodes, ESP32-module (suggested: with uFL)
 +
* Field-test Ethernet-functionality of ESP32/ESPHome based on ordered Lan8720 modules (6 arriving end of Oct)
  
 
= Archived/past iterations =
 
= Archived/past iterations =

Revision as of 14:18, 14 October 2020

Introduction

Update history

  • Iteration 2 PoC @ 20201007

First steps

A single NodeMCU and diode is enough
Spaghetti for dinner

The APC7921 controls the relays via an I2C bus which is supplied via a flatcable from the controller-board.

By putting an intermediate board between the controller and the relay-board, we are able to take over the i2c handling, but leave the rest (PSU, etc) to the controller-board to handle for now.

Iteration 1

An initial test for the principle was hacked together in about 2 hours; with the hardest part being to figure out what are the right pins on the esp8266 for i2c (and, to find the right reference which lists the correct order for SDA and SCL... first google-hit was wrong...) The only other 'smart' thing is to add an 1n4148 diode in line with the VCC line as the controller supplies 3.5-3.6volts, which is still within spec, but at the edge of what the esp8266 should be fed with. With the diode in series, Vcc is now at the low-side of the spec: 2.6-2.7 volt. A good thing is that it's well within tolerances for the Vih (high-level input threshold voltage) for the PCF8574 fed on 3.5V; so no issues are to expected with having to level-shift. Obviously, production-model should just run all of it on 3.3V; unless that voltage is not enough to drive the base of the switching-transistor that drives the relay-coil. This is however quite unlikely to be the case as hFE is 35 at worst case, 100 typical.



[Video proof here]

Iteration 2

Before extending the prototype software with HTTP/JSON/MQTT functionality, I drank a Flora Mate and realized that probably the [ESPHome] software had a way to control pcf8574 , and indeed it did. This resulted in the second iteration of the PoC board to have:

  • All 8 relays working
  • Have HTTP control interface
  • Be able to provide control via API
  • Work with HomeAssistant
  • Have MDNS announcing

and next to that, ESPHome also:

  • Has support for the likely candidate chipset for ethernet-functionality (LAN8720)
  • supports using Current Transformers
  • Knows how to drive led-displays
  • Provides handling of buttons , with automations (resets?)
  • Is able to do OTA upgrades

[Video prooof here]

Steps to be taken

  • Experiment with [ESPHome Current-clamp sensor support] using onboard Current-transformer(s)
  • Check function of relay board with 3.3V IO
  • Work on approach for driving LED-display OR replace with TFT/OLED (all supported by ESPHome)
  • Produce some extra 2mm->2.54mm convertor-cables for experimentation/splicing
  • PCB design, first steps
    • Make PCB-template for KiCad based on measurements
    • Produce BOM for essential components; headers, jacks, PSU, Schottky-diodes, ESP32-module (suggested: with uFL)
  • Field-test Ethernet-functionality of ESP32/ESPHome based on ordered Lan8720 modules (6 arriving end of Oct)

Archived/past iterations