From efd30cdf8ac8aa1ff1b28bcad5c00aa9993ca7c9 Mon Sep 17 00:00:00 2001
From: Benjamin Koch <bbbsnowball@gmail.com>
Date: Mon, 1 May 2023 18:04:11 +0200
Subject: [PATCH] add some thoughts on which signal to put on which wire

---
 README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 95 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 3f7fed7..e2b6833 100644
--- a/README.md
+++ b/README.md
@@ -64,8 +64,6 @@ RP2040 microcontroller (like Raspberry Pico), power supply, terminal block and m
 
 [PDF with rendering of PCB layers](./c3pb-heizung/generated/PCB/PDF/c3pb-heizung-assembly.pdf)
 
-![Verbindungsdose als Gehäuse, https://www.spelsberg.de/verbindungsdosen/innenbereich-bis-252/33291201/](img/csm_33291201_V1_0629111c9b.webp)
-
 Anschlussklemmen: Es gibt leider kein Bild in richtig herum. Man kippe sie im Kopf um 90 Grad nach links-oben und die Kabel kommen dann von links-oben.
 ![Anschlussklemmen, auf der Seite liegend - danke LCSC](img/20230317_Cixi-Kefa-Elec-KF250T-5-0-2-13P_C976547_front.jpg)
 
@@ -120,6 +118,101 @@ e.g. with suitable slots in the case instead of making a complete hole for the b
 how well touch is working.
 
 
+Gehäuse
+-------
+
+![Verbindungsdose als Gehäuse, https://www.spelsberg.de/verbindungsdosen/innenbereich-bis-252/33291201/](img/csm_33291201_V1_0629111c9b.webp)
+
+Die meisten Maße stehen im Datenblatt, aber für uns ist auch die Materialstärke vom Deckel relevant. Die scheint 1.5 mm zu sein bzw. 1.2 mm
+an den dünneren Stellen (gemessen mit der Mikrometerschraube von Paulimot). Das wäre deutlich dicker als die LEDs, d.h. man könnte versuchen,
+die nicht ganz durch zu fräsen.
+
+tioan war nicht wirklich glücklich mit der Wahl, aber das war die einzig sinnvolle beim Hornbach (Preis, Größe und Form). Für zukünftige
+Projekte ggf noch mal mit ihm reden - er meinte, im Großhandel gibt's bessere zur Auswahl.
+
+
+Kabel
+-----
+
+fxk8y hatte [Helukabel 18090](https://www.tme.eu/de/details/liyy7x0.5/mehraderleitungen-ohne-abschirmung/helukabel/18090/) vorgeschlagen
+(aber nicht bei TME kaufen - ist woanders günstiger). 7-polig ist wohl recht üblich. Das sind 0.5 mm². Laut Faustregel kann es grob 5 A
+und laut Hersteller 6 A (aber ggf. sollten wir ein Derating anwenden je nach Art der Verlegung). Wir planen je zwei Adern für 24V und GND
+zu nehmen, d.h. 10-12 A. Die Klemme kann 12 A, das PCB hoffentlich auch.
+
+There doesn't seem to be any standard coloring for the wires of RS485 so we rather
+arbitrarily choose [this](https://www.baranidesign.com/faq-articles/2020/3/23/meteotemp-meteowind-rs485-wire-colors-and-electrical-connection)
+because it somewhat matches our intuition. Furthermore, we should satisfy these conditions:
+
+1. RS485 A and B next to each other.
+2. Wires around RS485 have symmetric influence, e.g. 24V next to A and GND next to B would
+   be bad because current flows in the opposite direction and will create an unbalanced
+   voltage in the RS485 lines.
+3. WS2812 next to signals that balance each other out, e.g. both RS485 lines are fine but
+   not only one of them.
+
+Option 1: This is similar to our first, intuitive idea but with two power lines swapped to satisfy condition 2:
+
+<table style="border: none !important; border-collapse: separate; text-align: center">
+<tr>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: green solid 0.5em; border-radius: 2em; background: none;" colspan="2">A+</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: #fb0 solid 0.5em; border-radius: 2em; background: none;" colspan="2">B-</td>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none; padding:  0px;">&nbsp;</td>
+</tr>
+<tr>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: brown solid 0.5em; border-radius: 2em; background: none;" colspan="2">24V</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: blue solid 0.5em; border-radius: 2em; background: none;" colspan="2">GND</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: gray solid 0.5em; border-radius: 2em; background: none;" colspan="2">24V</td>
+</tr>
+<tr>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: white solid 0.5em; border-radius: 2em; background: none;" colspan="2">GND</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: pink solid 0.5em; border-radius: 2em; background: none;" colspan="2">WS</td>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none; padding:  0px;">&nbsp;</td>
+</tr>
+<tr>
+  <!-- dummy line to force columns to the right width -->
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+</tr>
+</table>
+
+Option 2: WS2812 signal on center wire. This is not such a good match for intuition (blue is a signal and pink is GND) but all influences should cancel out and the central wire is not a power wire (i.e. doesn't get warm). This makes the most sense from a technical perspective.
+
+<table style="border: none !important; border-collapse: separate; text-align: center">
+<tr>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: green solid 0.5em; border-radius: 2em; background: none;" colspan="2">A+</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: #fb0 solid 0.5em; border-radius: 2em; background: none;" colspan="2">B-</td>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none; padding:  0px;">&nbsp;</td>
+</tr>
+<tr>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: brown solid 0.5em; border-radius: 2em; background: none;" colspan="2">24V</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: blue solid 0.5em; border-radius: 2em; background: none;" colspan="2">WS</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: gray solid 0.5em; border-radius: 2em; background: none;" colspan="2">24V</td>
+</tr>
+<tr>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: white solid 0.5em; border-radius: 2em; background: none;" colspan="2">GND</td>
+  <td style="width: 3em; height: 3em; padding: 0px; margin: 0.1em; border: pink solid 0.5em; border-radius: 2em; background: none;" colspan="2">GND</td>
+  <td style="width: 1.5em; height: 3em; padding: 0px; margin: 0.1em; border: none; padding:  0px;">&nbsp;</td>
+</tr>
+<tr>
+  <!-- dummy line to force columns to the right width -->
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+  <td style="width: 1.5em; height: 0.1em; padding: 0px; margin: 0.1em; border: none;">&nbsp;</td>
+</tr>
+</table>
+
+
 Zusätzliche Nutzung
 ===================
 
-- 
GitLab