aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 0bbe5af712e15270456be56bc416f36625d86799 (plain)
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
 
Environmental sensor
 
## Components
 
### CO₂ sensor
 
Sensirion SCD40, via the [SCD41 dev kit](https://sensirion.com/products/catalog/SEK-SCD41/)
 
Using the [Sensirion Arduino library](https://github.com/Sensirion/arduino-i2c-scd4x)
 
connector: JST PH 2.0mm 4 pin
 
* 1 SCL
* 2 GND
* 3 VDD
* 4 SDA
 
### particulate sensor
 
[Sensirion SPS30](https://sensirion.com/products/catalog/SPS30/)
 
Using the [Sensirion Arduino library](https://github.com/Sensirion/arduino-sps)
 
connector: JST ZH 1.5mm 5 pin
 
* 1 VDD
* 2 SDA
* 3 SCL
* 4 SEL → GND (to select I₂C mode)
* 5 GND
 
### main board
 
[LILYGO® TTGO T5 V2.3.1 with 2.13 Inch E-Paper Screen](http://www.lilygo.cn/claprod_view.aspx?TypeId=62&Id=1391&FId=t28:62:28)
 
Using the same Arduino libraries as [the LilyGo
examples](https://github.com/Xinyuan-LilyGO/LilyGo-T5-ink-series)
 
battery connector: JST 1.25mm 2 pin
 
* 21 SDA
* 22 SCL
 
## Software
 
Arduino +
[ESP32](https://docs.espressif.com/projects/arduino-esp32/en/latest/) +
[makeEspArduino](https://github.com/plerup/makeEspArduino/) + a bunch
of libraries; `git submodule init && git submodule update` to get
them.
 
You'll probably need to adjust some paths in the
[`Makefile`](Makefile), then you can `make flash` to build and flash
the software.
 
### Serial protocol
 
`make monitor` (or `make run` if you want to build+flash+monitor)
lets you interact with the serial line.
 
Lines starting with `#` are debug information, lines starting with `!`
are errors / warnings.
 
You can send tagged commands, and get tagged responses. For example,
you write:
 
    1 logwipe
 
and you get back:
 
    # reading
    # 1 logwipe
    # <1|logwipe>
    # file: quality.csv
    1 wiped
 
and the logged data has been removed from the SD card.
 
Then you write:
 
    2 logcat
 
and get:
 
    # reading
    # 2 logcat
    # <2|logcat>
    2 begin
      secs,  co2,  temp, humid,    pm1,  pm2.5,    pm4,   pm10, batt
       162,  639,  18.1,  33.7,    1.1,    0.1,    0.0,    0.0, 4.26
       168,  637,  17.8,  34.2,    1.1,    0.1,    0.0,    0.0, 4.26
       174,  637,  17.8,  34.2,    1.1,    0.1,    0.0,    0.0, 4.26
       180,  637,  17.8,  34.2,    1.1,    0.1,    0.0,    0.0, 4.26
       187,  637,  17.8,  34.2,    1.1,    0.1,    0.0,    0.0, 4.26
       193,  637,  17.8,  34.2,    1.1,    0.1,    0.0,    0.0, 4.26
    2 end
 
which is the whole contents of the data log from the SD card.
 
There's also `setco $int`, to force-calibrate the CO₂ sensor, but I
haven't tested it yet.
 
#### Helper programs
 
If you install `Path::Tiny` and `IO::Termios` on your Perl, you can
use [`utils/get-data`](utils/get-data) to get the logged data off the
sensor.
 
## Enclosure
 
Render with [OpenSCAD](https://openscad.org/), then print.
 
I printed on a Prusa MK3S, with PLA, sliced with PrusaSlicer:
 
* setting "0.20mm speed"
* variable layer height
* "adaptive cubic" fill pattern
* bottom layer of the enclosure:
  * 4 bottom solid layers
  * 2 top solid layers
* middle layer of the enclosure:
  * 2 bottom solid layers
  * 2 top solid layers
* top layer of the enclosure:
  * 4 bottom solid layers (which are, in fact, the top layers of the
    enclosure, because the top is upside-down)
  * 2 top solid layers