Repository navigation
Expand file tree
/
Copy pathhandout.html
More file actions
417 lines (391 loc) · 13.4 KB
/
Copy pathhandout.html
File metadata and controls
417 lines (391 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ESP32 Lab — Show Handout</title>
<style>
@page { size: A4; margin: 12mm 14mm; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 11pt;
color: #111;
background: #fff;
}
/* ── Header ── */
.page-header {
background: #0f172a;
color: #38bdf8;
padding: 12px 16px 10px;
margin-bottom: 10px;
}
.page-header h1 { font-size: 22pt; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.page-header .tagline { font-size: 10.5pt; color: #94a3b8; margin-top: 4px; }
/* ── Intro ── */
.intro {
font-size: 10.5pt;
line-height: 1.6;
color: #1e293b;
margin-bottom: 10px;
padding: 0 2px;
}
/* ── Two-column layout ── */
.columns {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-bottom: 10px;
}
/* ── Sensor list ── */
.section-title {
font-size: 9pt;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.6px;
color: #64748b;
margin-bottom: 6px;
border-bottom: 1px solid #e2e8f0;
padding-bottom: 3px;
}
.sensor-list {
list-style: none;
}
.sensor-list li {
display: flex;
align-items: baseline;
gap: 8px;
padding: 4px 0;
border-bottom: 1px solid #f1f5f9;
font-size: 10pt;
line-height: 1.4;
}
.sensor-list li:last-child { border-bottom: none; }
.sensor-tag {
background: #0f172a;
color: #38bdf8;
font-size: 7.5pt;
font-weight: 700;
padding: 1px 5px;
border-radius: 3px;
white-space: nowrap;
flex-shrink: 0;
}
.sensor-desc { color: #334155; font-size: 9.5pt; }
/* ── Connect box ── */
.connect-box {
background: #f0f9ff;
border: 1px solid #bae6fd;
border-left: 4px solid #38bdf8;
border-radius: 6px;
padding: 10px 12px;
}
.connect-box h3 {
font-size: 9pt;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #0369a1;
margin-bottom: 6px;
}
.connect-step {
display: flex;
align-items: baseline;
gap: 8px;
margin-bottom: 5px;
font-size: 10pt;
line-height: 1.4;
}
.step-num {
background: #0369a1;
color: #fff;
font-size: 8pt;
font-weight: 700;
width: 16px;
height: 16px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.connect-step code {
font-family: 'Courier New', monospace;
background: #e0f2fe;
padding: 1px 5px;
border-radius: 3px;
font-size: 9.5pt;
color: #0c4a6e;
}
.phone-tip {
margin-top: 6px;
font-size: 8.5pt;
color: #64748b;
background: #f8fafc;
border-radius: 4px;
padding: 4px 7px;
line-height: 1.45;
}
/* ── What you can do ── */
.feature-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 6px;
margin-bottom: 10px;
}
.feature {
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 6px;
padding: 7px 9px;
}
.feature h4 {
font-size: 9pt;
font-weight: 700;
color: #0f172a;
margin-bottom: 3px;
}
.feature p {
font-size: 8.5pt;
color: #475569;
line-height: 1.4;
}
/* ── Wiring reference ── */
.wiring-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px;
margin-bottom: 10px;
}
.wcard {
border: 1px solid #cbd5e1;
border-radius: 6px;
overflow: hidden;
break-inside: avoid;
}
.wcard-head {
padding: 5px 9px;
font-weight: 700;
font-size: 9.5pt;
color: #fff;
}
.wcard-head.blue { background: #0369a1; }
.wcard-head.green { background: #15803d; }
.wcard-head.purple { background: #7c3aed; }
.wcard-head.teal { background: #0f766e; }
.wcard-head small { font-weight: 400; font-size: 8pt; opacity: 0.85; }
.wcard-body { padding: 6px 9px; }
table { width: 100%; border-collapse: collapse; font-size: 9pt; margin-bottom: 4px; }
th { text-align: left; font-size: 7.5pt; text-transform: uppercase; letter-spacing: 0.4px;
color: #64748b; padding: 2px 5px; border-bottom: 1px solid #e2e8f0; }
td { padding: 3px 5px; border-bottom: 1px solid #f1f5f9; font-family: 'Courier New', monospace; font-size: 8.5pt; }
tr:last-child td { border-bottom: none; }
.sp { color: #92400e; }
.arr { color: #94a3b8; padding: 0 3px; font-family: Arial, sans-serif; }
.ep { color: #166534; font-weight: 600; }
.wnote {
font-size: 8.5pt;
color: #475569;
line-height: 1.4;
background: #f8fafc;
border-radius: 3px;
padding: 4px 6px;
}
.wnote strong { color: #dc2626; }
.wnote .ok { color: #166534; font-weight: 600; }
/* ── Footer ── */
footer {
border-top: 2px solid #0f172a;
margin-top: 8px;
padding-top: 8px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.footer-col h4 {
font-size: 8.5pt;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #64748b;
margin-bottom: 5px;
}
.footer-link {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
font-size: 10pt;
color: #0369a1;
text-decoration: none;
}
.footer-link .icon {
font-size: 13pt;
flex-shrink: 0;
}
.footer-link span { font-family: 'Courier New', monospace; font-size: 9.5pt; }
.footer-note {
font-size: 8.5pt;
color: #64748b;
line-height: 1.5;
margin-top: 4px;
}
</style>
</head>
<body>
<!-- ── Header ── -->
<div class="page-header">
<h1>ESP32 Lab</h1>
<div class="tagline">A browser-based sensor platform for ESP32 — no app, no cloud, no accounts</div>
</div>
<!-- ── Intro ── -->
<p class="intro">
<strong>ESP32 Lab</strong> turns a cheap ESP32 development board into a self-contained sensor workbench
you control from any browser. Flash the firmware once, power the board, and connect sensors —
the device hosts its own WiFi hotspot and serves a live web interface. Read temperatures, measure
distances, detect motion, dim LEDs, and more without writing a line of code.
It’s open-source, runs entirely on the device, and costs under £10 in hardware.
</p>
<!-- ── Two-column: sensors + connect ── -->
<div class="columns">
<div>
<div class="section-title">Sensors on display</div>
<ul class="sensor-list">
<li><span class="sensor-tag">DHT11</span> <span class="sensor-desc">Temperature & humidity — single-wire protocol</span></li>
<li><span class="sensor-tag">DS18B20</span> <span class="sensor-desc">Waterproof temperature probe — great for liquids</span></li>
<li><span class="sensor-tag">HC-SR04</span> <span class="sensor-desc">Ultrasonic distance — measures 2 cm to 4 m</span></li>
<li><span class="sensor-tag">PIR</span> <span class="sensor-desc">Passive infrared motion detector — HIGH when triggered</span></li>
<li><span class="sensor-tag">KY-040</span> <span class="sensor-desc">Rotary encoder — turn count & direction</span></li>
<li><span class="sensor-tag">Analog</span> <span class="sensor-desc">Potentiometer, light sensor, 0–3.3 V range</span></li>
<li><span class="sensor-tag">PWM</span> <span class="sensor-desc">LED dimming & buzzer tone via duty-cycle slider</span></li>
<li><span class="sensor-tag">Digital</span> <span class="sensor-desc">Button / switch input — LED / relay output</span></li>
</ul>
</div>
<div>
<div class="connect-box">
<h3>Try it now — connect to the board</h3>
<div class="connect-step">
<div class="step-num">1</div>
<div>On your phone or laptop, join WiFi network <code>ESP32Lab</code><br>
<span style="font-size:9pt;color:#64748b">password: <code>esp32lab</code></span></div>
</div>
<div class="connect-step">
<div class="step-num">2</div>
<div>Open your browser and go to <code>http://192.168.4.1</code></div>
</div>
<div class="connect-step">
<div class="step-num">3</div>
<div>Tap <strong>Sensors</strong>, pick a sensor from the dropdown, and follow the wiring guide</div>
</div>
<div class="connect-step">
<div class="step-num">4</div>
<div>Hit <strong>Read Once</strong> or <strong>▶ Stream</strong> to see live data</div>
</div>
<div class="phone-tip">
<strong>Phone tip:</strong> turn off mobile data first — otherwise Android/iOS stays on 4G and the browser can't reach the device.
</div>
</div>
</div>
</div>
<!-- ── Feature tiles ── -->
<div class="feature-grid">
<div class="feature">
<h4>No app or cloud needed</h4>
<p>Everything runs on the ESP32 itself. The web UI is served directly from the device over its own hotspot or your home network.</p>
</div>
<div class="feature">
<h4>Browser-based OTA updates</h4>
<p>Flash new firmware from the System tab — no USB cable required after the first flash. Works over WiFi from any browser.</p>
</div>
<div class="feature">
<h4>Board auto-detection</h4>
<p>Supports ESP32-C3 Mini and classic ESP32 DevKit. The firmware reads the chip model at boot and configures pins automatically.</p>
</div>
</div>
<!-- ── Wiring quick reference ── -->
<div class="section-title">Wiring quick reference</div>
<div class="wiring-grid">
<div class="wcard">
<div class="wcard-head blue">HC-SR04 — Ultrasonic Distance <small>(5V version)</small></div>
<div class="wcard-body">
<table>
<tr><th>Sensor</th><th></th><th>ESP32</th></tr>
<tr><td class="sp">VCC</td><td class="arr">→</td><td class="ep">5V (USB / VIN)</td></tr>
<tr><td class="sp">GND</td><td class="arr">→</td><td class="ep">GND</td></tr>
<tr><td class="sp">TRIG</td><td class="arr">→</td><td class="ep">GPIO 4 (direct)</td></tr>
<tr><td class="sp">ECHO</td><td class="arr">→</td><td class="ep">GPIO 3 via divider</td></tr>
</table>
<div class="wnote"><strong>5V ECHO pin will damage the ESP32 if connected directly.</strong>
Use a voltage divider: 10kΩ from ECHO to GPIO 3, then 20kΩ from GPIO 3 to GND.
TRIG is fine direct — it accepts 3.3V logic.</div>
</div>
</div>
<div class="wcard">
<div class="wcard-head green">DHT11 — Temperature & Humidity</div>
<div class="wcard-body">
<table>
<tr><th>Sensor</th><th></th><th>ESP32</th></tr>
<tr><td class="sp">VCC</td><td class="arr">→</td><td class="ep">3.3V</td></tr>
<tr><td class="sp">GND</td><td class="arr">→</td><td class="ep">GND</td></tr>
<tr><td class="sp">DATA</td><td class="arr">→</td><td class="ep">GPIO 4</td></tr>
</table>
<div class="wnote">
<span class="ok">✓ 3.3V safe — connect directly.</span><br>
±2°C | ±5% RH | 1 reading/sec max.
Breakout modules include a built-in pull-up; bare sensors need 10kΩ DATA→3.3V.</div>
</div>
</div>
<div class="wcard">
<div class="wcard-head purple">PIR — Motion Sensor</div>
<div class="wcard-body">
<table>
<tr><th>Sensor</th><th></th><th>ESP32</th></tr>
<tr><td class="sp">VCC</td><td class="arr">→</td><td class="ep">5V (most modules)</td></tr>
<tr><td class="sp">GND</td><td class="arr">→</td><td class="ep">GND</td></tr>
<tr><td class="sp">OUT</td><td class="arr">→</td><td class="ep">GPIO 4</td></tr>
</table>
<div class="wnote">OUT goes <strong style="color:#166534">HIGH</strong> when motion is detected, LOW after the delay.
Select <em>Digital Input</em> in the sensor dropdown.
Sensitivity and delay are adjustable via the two trimmer pots on the module.</div>
</div>
</div>
<div class="wcard">
<div class="wcard-head teal">DS18B20 — Waterproof Temp Probe</div>
<div class="wcard-body">
<table>
<tr><th>Sensor</th><th></th><th>ESP32</th></tr>
<tr><td class="sp">Red (VCC)</td><td class="arr">→</td><td class="ep">3.3V</td></tr>
<tr><td class="sp">Black (GND)</td><td class="arr">→</td><td class="ep">GND</td></tr>
<tr><td class="sp">Yellow (DATA)</td><td class="arr">→</td><td class="ep">GPIO 4</td></tr>
</table>
<div class="wnote">
<span class="ok">✓ 3.3V safe.</span>
<strong>Requires a 4.7kΩ pull-up resistor between DATA and 3.3V</strong> — without it the reading will fail.
Uses the 1-Wire protocol; ±0.5°C accuracy.</div>
</div>
</div>
</div>
<!-- ── Footer ── -->
<footer>
<div class="footer-col">
<h4>Find the project online</h4>
<a class="footer-link" href="https://github.com/idltd/esp32lab">
<span class="icon">▶</span>
<span>github.com/idltd/esp32lab</span>
</a>
<div class="footer-note">
Full source code, pre-built firmware binaries, and wiring guides are all on GitHub.
Star the repo to follow updates — new sensor types are added regularly.
</div>
</div>
<div class="footer-col">
<h4>Get in touch</h4>
<a class="footer-link" href="mailto:esp32lab@idltd.com">
<span class="icon">✉</span>
<span>esp32lab@idltd.com</span>
</a>
<div class="footer-note">
Questions about the project, sensor ideas, or building your own kit?
Drop us an email — we’re happy to help.
</div>
</div>
</footer>
</body>
</html>