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