Eval » Historie » Version 71
Maximilian Seesslen, 10.11.2023 12:30
1 | 1 | Maximilian Seesslen | h1. Eval |
---|---|---|---|
2 | |||
3 | h1. Overall design |
||
4 | |||
5 | * 4 x red+green LEDs for condition |
||
6 | * Restart button |
||
7 | 10 | Maximilian Seesslen | * Iterate over the ADC channels and get Voltage level |
8 | 13 | Maximilian Seesslen | * Self-Calibrating via MOSFET (shortcuit cable interface) |
9 | 30 | Maximilian Seesslen | * draw 100mA. Why? Sonst habe ich keinen Spannungsteiler. Je mehr Strom desto hoeher der Spannungsabfall; optional via mosfet.; 3/0,1= 30 Ohm; 0,3W |
10 | 17 | Maximilian Seesslen | * ADC loesst theoretisch auf "3 / 4096 = approx. 0,0007" Volt auf. |
11 | 4 | Maximilian Seesslen | * Die Kabel haben AWG28, 212.9 Ohm/km, 1.4 A nach erde, 0.23 A versorgung |
12 | 7 | Maximilian Seesslen | * 0,2129 Ohm/m; 1,0645 Ohm/5m; 2,129 Ohm/10m; |
13 | 4 | Maximilian Seesslen | * https://de.wikipedia.org/wiki/E-Reihe#/media/Datei:E12_values_graph.svg |
14 | 20 | Maximilian Seesslen | * Buzzer would be nice for indication; durchklingeln. Da werde ich lieber Multimeter nehmen. Ist aber kein Aufwand. |
15 | * PWM Output |
||
16 | 1 | Maximilian Seesslen | * Pinsocket connected to wires to measure resistance/Voltage directly |
17 | * https://www.aeq-web.com/spannungsteiler-microcontroller-berechnen-und-dimensionieren/ |
||
18 | 39 | Maximilian Seesslen | * Spannungen einzeln schaltbar damit auch kurzschluesse detektiert werden koennen und Kabel-Art. "1:1"; "M" mirrored; "" |
19 | 20 | Maximilian Seesslen | |
20 | 71 | Maximilian Seesslen | h1. Cables |
21 | |||
22 | | 4x0,14mm² | 148Ohm/km (Manufacturer) | |
||
23 | | AWG28 | 212.9 Ohm/km (Norm) | |
||
24 | |||
25 | 19 | Maximilian Seesslen | h1. Schema |
26 | 1 | Maximilian Seesslen | |
27 | 22 | Maximilian Seesslen | <pre> |
28 | 3V |
||
29 | | |
||
30 | | | Cable |
||
31 | |-------------->ADC |
||
32 | | | 30Ohm |
||
33 | | |
||
34 | === |
||
35 | 17 | Maximilian Seesslen | |
36 | 22 | Maximilian Seesslen | </pre> |
37 | 17 | Maximilian Seesslen | |
38 | 50 | Maximilian Seesslen | Der Widerstand sollte so groß sein wie der Widerstand des Sensors in der Mitte des Messbereichs. |
39 | |||
40 | |||
41 | 1 | Maximilian Seesslen | h1. Theoretische Spannungen bei AWG28 |
42 | 13 | Maximilian Seesslen | |
43 | 31 | Maximilian Seesslen | "E-Reihe":https://de.wikipedia.org/wiki/E-Reihe#/media/Datei:E12_values_graph.svg |
44 | |||
45 | 17 | Maximilian Seesslen | theoretically an device that draws 0,1A, 5V and 5m AWG28 cable: |
46 | 13 | Maximilian Seesslen | U2=((5*50)/ (50+1,0645) ) = 4,8957691; that should work |
47 | 1 | Maximilian Seesslen | |
48 | 17 | Maximilian Seesslen | theoretically an device that draws 0,5A, 5V and 10m AWG28 cable: |
49 | 1 | Maximilian Seesslen | U2 = ( (5*10) / (10+2,129) ) = 4,1223514 V |
50 | 17 | Maximilian Seesslen | |
51 | theoretically an device that draws 0,1A, 3V and 5m AWG28 cable: |
||
52 | 27 | Maximilian Seesslen | U2=((3*30)/ (30+1,0645) ) = 2,8971978; that should work; 3 - 2,8971978 = 0,1028022 V = 146 ADC steps |
53 | 17 | Maximilian Seesslen | |
54 | theoretically an device that draws 0,1A, 3V and 10m AWG28 cable: |
||
55 | U2=((3*30)/ (30+2,129) ) = 2,8012076 |
||
56 | |||
57 | theoretically an device that draws 0,25A, 3V and 10m AWG28 cable: |
||
58 | U2= (3 * 12) / (12 + 2,129) = approx. 2,547951 |
||
59 | |||
60 | theoretically an device that draws 0,5A, 3V and 10m AWG28 cable: |
||
61 | U2= (3 * 6) / (6 + 2,129) = approx. 2,2142945 |
||
62 | U2= (3 * 6,8) / (6,8 + 2,129) = approx. 2,2846903 |
||
63 | 13 | Maximilian Seesslen | |
64 | 12 | Maximilian Seesslen | h1. Calculations I |
65 | |||
66 | 4 | Maximilian Seesslen | U2=((U*R2)/R_GES) |
67 | |||
68 | 5 | Maximilian Seesslen | U |
69 | 4 | Maximilian Seesslen | R*I |
70 | |||
71 | 5V/0,1A= 50 Ohm |
||
72 | 5V*0,1A= 0,5 W |
||
73 | |||
74 | 7 | Maximilian Seesslen | 5V/0,5A= 10 Ohm |
75 | |||
76 | 5 | Maximilian Seesslen | RGes = R1+R2 = 50 |
77 | |||
78 | 7 | Maximilian Seesslen | 3V=(5*R2)/50 |
79 | *R2 = (3*50)/5 = 30 -> 27 |
||
80 | R1 = 22* |
||
81 | RGES = 49 |
||
82 | 1 | Maximilian Seesslen | |
83 | U2 = 5*27/49 = 2,755102 |
||
84 | |||
85 | h1. Calculations II |
||
86 | 12 | Maximilian Seesslen | |
87 | 1 | Maximilian Seesslen | * Ein Kabel >= 10m soll durchfallen. Koennen trotzdem groessere Wiederstaende verwendet werden? |
88 | |||
89 | 13 | Maximilian Seesslen | Ohne Widerstand: |
90 | 1 | Maximilian Seesslen | |
91 | 13 | Maximilian Seesslen | U2 = 2,755102 |
92 | 1 | Maximilian Seesslen | |
93 | 13 | Maximilian Seesslen | Obige werte 1fach, 10m Kabel: |
94 | |||
95 | R2 = 27 |
||
96 | R1 = 22 |
||
97 | mit 10m |
||
98 | U2 = (5*27)/(49+2,129) = 2,6403802 |
||
99 | 2,755102-2,6403802=0,1147218 |
||
100 | 0,1147218/0,00073242188 = 156,6335 |
||
101 | |||
102 | Obige werte 10fach, 10m Kabel: |
||
103 | |||
104 | R2 = 270 |
||
105 | R1 = 220 |
||
106 | mit 10m |
||
107 | U2 = (5*270)/(490+2,129) = 2,7431832 |
||
108 | |||
109 | Bei 12Bit ADC: 3 / 4096 = approx. 0,00073242188 V pro ADC-Wert. |
||
110 | 2,755102-2,7431832=0,0119188 |
||
111 | 0,0119188 / 0,00073242188 = approx. 16,273135. Thats not super much |
||
112 | |||
113 | 16 | Maximilian Seesslen | h1. Calculations III |
114 | |||
115 | 64 | Maximilian Seesslen | 0,2129 Ohm/m; |
116 | |||
117 | 65 | Maximilian Seesslen | U2=(U*r2)/(r1+r2) |
118 | =3*1000/(1000+2,129) |
||
119 | |||
120 | U1=(R1*U2)/R2 |
||
121 | R1=(r2*u1)/u2 |
||
122 | |||
123 | u2*(r1+r2)=r2*u |
||
124 | r1+r2=r2*u/u2 |
||
125 | r1=(r2*u)/u2-r2 |
||
126 | |||
127 | 67 | Maximilian Seesslen | 3*12 / (12+0,2129) |
128 | (3-2,9477028) / (3/4096) = 71 |
||
129 | Theoretisch sind es bei 12 Ohm als R2 und einem 1m Kabel noch 71 ADC-Steps |
||
130 | |||
131 | 65 | Maximilian Seesslen | |
132 | 64 | Maximilian Seesslen | |
133 | 10 | Maximilian Seesslen | h1. Keyfeatures |
134 | |||
135 | * Cable checker |
||
136 | * Buzzer Durchgangspruefer |
||
137 | * PWM Output |
||
138 | 7 | Maximilian Seesslen | |
139 | 1 | Maximilian Seesslen | h1. MCU |
140 | 2 | Maximilian Seesslen | |
141 | 1 | Maximilian Seesslen | * "stm32f051c4":https://www.mouser.de/datasheet/2/389/stm32f051c4-1851079.pdf |
142 | ** I have 17; |
||
143 | 2 | Maximilian Seesslen | ** 16 ADC channels |
144 | 25 | Maximilian Seesslen | ** 3.06 ab 10 Stueck |
145 | 28 | Maximilian Seesslen | ** habe 17 |
146 | 34 | Maximilian Seesslen | ** No USB |
147 | * "STM32G030C8T6":https://www.st.com/resource/en/datasheet/stm32g030c8.pdf |
||
148 | 3 | Maximilian Seesslen | ** nearly same specs but smaller footprint; LQFP 48 |
149 | 1 | Maximilian Seesslen | ** 2,68€ inc. Mwst. |
150 | 13 | Maximilian Seesslen | ** ADC faster |
151 | 29 | Maximilian Seesslen | ** Mentions an 16Bit ADC value via oversampling, but thats complicated: adding white noise in order to calculate further 2 bits by software. |
152 | 28 | Maximilian Seesslen | ** Habe 10 |
153 | 35 | Maximilian Seesslen | ** No USB |
154 | 21 | Maximilian Seesslen | |
155 | * 4 ADC IN |
||
156 | * 4 Spannungs schalten |
||
157 | * 4 Kalibrierung schalten |
||
158 | * 2 LED Heartbeat/User |
||
159 | * 4 LED kabel ROT |
||
160 | * 4 LED kabel Gruen |
||
161 | * 4 LED kabel Orange |
||
162 | * 1 Input button |
||
163 | * 2 Output PWM |
||
164 | 23 | Maximilian Seesslen | |
165 | h1. Bauteile |
||
166 | 1 | Maximilian Seesslen | |
167 | 25 | Maximilian Seesslen | * Widerstaende: WF25P-6R8-5%; SP12-12R; |
168 | 32 | Maximilian Seesslen | ** SMD2512-12R-1% |
169 | 33 | Maximilian Seesslen | |
170 | h1. Display |
||
171 | |||
172 | LED-Bar? Display? |
||
173 | 40 | Maximilian Seesslen | Ohne Display ists bloed. |
174 | Via CAN/CANDis auch bloed wegen verkabelung. |
||
175 | Kleines OLED Display waer schon nice. |
||
176 | |||
177 | "DEP096064B1-Y" |
||
178 | 41 | Maximilian Seesslen | "Datasheet":https://www.tme.eu/Document/7d80b9024b2a78272b470cfa0544c783/DEP096064B1-Y.pdf |
179 | 9.11 Euro; grafisch, brauch ich Schriftart; nicht monierbar |
||
180 | |||
181 | "REX128128HWAP3N0" |
||
182 | |||
183 | 42 | Maximilian Seesslen | I2C Text displays; |
184 | 41 | Maximilian Seesslen | |
185 | 42 | Maximilian Seesslen | Ein kleines TFT-RGB Display schon fast billiger; 6,77€ |
186 | 60 | Maximilian Seesslen | |
187 | 43 | Maximilian Seesslen | "DEM096160ATMH-PWN":https://www.tme.eu/Document/938d60856f558016147975bdab4acc3c/DEM096160ATMH-PWN.pdf |
188 | 96x160 (RGB); da brauch ich mit LCD nicht anfangen |
||
189 | Dann passt der STM32G030C8 auch perfeckt. 64KB Flash |
||
190 | |||
191 | 44 | Maximilian Seesslen | * 12pin, 3V, Backlight 2,8V; 20mA |
192 | * "GC9107":https://cdn.hackaday.io/files/1881838051221472/GC9107%20DataSheet%20V1.2.pdf |
||
193 | * FH12-12S-0.5SH-55 |
||
194 | 45 | Maximilian Seesslen | * 12x20 Chars; |
195 | ** "1: 72987 Ohm" |
||
196 | ** "2: 72987 Ohm" |
||
197 | ** "3: 72987 Ohm" |
||
198 | ** "4: 72987 Ohm" |
||
199 | ** "------------" |
||
200 | ** "Type: 1:1 " |
||
201 | ** "Status: " |
||
202 | ** " Good " |
||
203 | 60 | Maximilian Seesslen | |
204 | "DEM080160BVMH-PWN":https://www.tme.eu/Document/6a8f456ac28caf9a0c7ea4be0ef0b282/DEM080160BVMH-PWN.pdf |
||
205 | 61 | Maximilian Seesslen | 80x160; IPS; 7.83€ |
206 | 62 | Maximilian Seesslen | 3,1V fuers Backlight sind halt doof. |
207 | 44 | Maximilian Seesslen | |
208 | 36 | Maximilian Seesslen | h1. USB |
209 | |||
210 | Ohne Display und USB ist es irgendwie doof. Eine schoene Gui haette schon was. |
||
211 | STM32F042C6U6 mit CAN: CANDis kann das anzeigen. |
||
212 | Wie wird dsa normal gepowert? Ohnehin USB. |
||
213 | |||
214 | STM32F042C6U6 haett ich noch |
||
215 | * UFQFPN48 |
||
216 | * Reicht 32K fuer USB? |
||
217 | 38 | Maximilian Seesslen | * STM32F042C6U6 is already one of the cheapest USB; 3,15€ |
218 | 1 | Maximilian Seesslen | * STM32L151C6U6: 3,33€ |
219 | 46 | Maximilian Seesslen | |
220 | h1. Schalten |
||
221 | |||
222 | R_DS ist ca. 50 milli Ohm bei 2V |
||
223 | Mit Kalibrier-Kanal i.O. |
||
224 | 47 | Maximilian Seesslen | -> Nur mit P-MOSFET schalten, on per default ist ok. |
225 | 48 | Maximilian Seesslen | -> 10K PD; 0,3mA * 5 -> 15mA |
226 | -> internal pulldowns of STM32 are 40K, so 47K should also be fine |
||
227 | 49 | Maximilian Seesslen | -> Theoretically resistors are not decessary during runtime at all. |
228 | |||
229 | 52 | Maximilian Seesslen | h1. Consumtion |
230 | |||
231 | Accidantly all 5 channels could be active; |
||
232 | |||
233 | 53 | Maximilian Seesslen | 250mA * 5; 1,25 ampere would flow. The LDO has to be powerfull. |
234 | 52 | Maximilian Seesslen | |
235 | 54 | Maximilian Seesslen | Is there any use to power it via USB? Directly 3V? |
236 | 55 | Maximilian Seesslen | I have this small 3V JST-USB adapters. |
237 | 54 | Maximilian Seesslen | |
238 | 56 | Maximilian Seesslen | 1mm trace width in power supply should be ok, around 15°C temperature rise with all 2,5A. |
239 | |||
240 | 49 | Maximilian Seesslen | h1. Vorwiederstand ADC |
241 | |||
242 | Ist der ADC aus versehen als ausgang und LOW geschaltet, liegen an diesem direkt 3V an, zumindest wenn das zu messende Kabel perfekt bzw. gebrueckt ist. |
||
243 | 1 | Maximilian Seesslen | The maximum current for any one pin is 25 mA sink or source. |
244 | 63 | Maximilian Seesslen | An resistor of min 120Ohm (25mA) is needed. 240Ohm @ 3,6V: 15mA |
245 | |||
246 | 51 | Maximilian Seesslen | h1. Schematics |
247 | 1 | Maximilian Seesslen | |
248 | 66 | Maximilian Seesslen | V_REF+ is connected via 33uH to VDD; 100nF |
249 | 70 | Maximilian Seesslen | BOOT0-Pin is not used as default. No interest in serial bootloader at the moment. |
250 | |||
251 | |||
252 | 66 | Maximilian Seesslen | |
253 | 57 | Maximilian Seesslen | h1. Order |
254 | 1 | Maximilian Seesslen | |
255 | 69 | Maximilian Seesslen | * Display; DEM096160ATMH-PWN |
256 | 68 | Maximilian Seesslen | * LEDs; LTST-C155KGJRKT |
257 | * Surpressor Diode 3,5PTV; UCLAMP3301D.TCT |
||
258 | 57 | Maximilian Seesslen | * SMD2512-12R-1% |
259 | 58 | Maximilian Seesslen | * FPC connector |
260 | 68 | Maximilian Seesslen | * Spule 33µH; NLV10KTC330 |