Skip to content

Commit 6dbed41

Browse files
authored
Merge pull request #175 from matt-sorenson/lolin-c3-mini
Add support for lolin c3 mini on a airgradient-pro
2 parents 43aa1d6 + 706931f commit 6dbed41

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

configuration.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ MQTT support has been mentioned in the AirGradient forums several times. ESPHom
6464
6565
After extensive discussion on the [AirGradient forum](https://forum.airgradient.com/t/concern-about-hijackable-wifi-connection/3845), it may be a good idea to remove the Captive Portal package after initial configuration, as leaving it in will default to enabling the Access Point Mode if WiFi is not available, potentially allowing an external source to reconfigure the device to a new network or upload another firmware file. Can also add a password to the ap if this functionality is desired, but want to secure it.
6666
67+
### Using a lolin-d3-mini in an AG Pro board
68+
69+
The lolin-d3-mini has a similar enough pin configuration that we're able to replace the stock D1 mini
70+
and make some minor config changes and get the benefits of an ESP32-c3 based device without buying a
71+
whole new motherboard.
72+
73+
1. Start with the airgradient-pro.yaml file
74+
2. Under packages, replace 'airgradient_d1_mini_board.yaml' with 'airgradient_lolin-c3-mini_board.yaml'
75+
3. change the `!extend config_button` section to use pin number `4` instead of `D7`
76+
77+
6778
# Home Assistant Automation
6879
6980
Pairing ESPHome with Home Assistant opens a multitude of opportunities to create custom actions tailored to your liking.

packages.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Board configuration for devices based on the D1 Mini chip (AG Basic and AG Pro),
3232

3333
Board configuration for devices based on the ESP32-C3 chip (AG ONE and OpenAir) using the original Arduino framework
3434

35+
## airgradient_lolin-c3-mini_board.yaml
36+
37+
Board configuration for the AG Pro that has been user upgraded to use a lolin-c3-mini
38+
39+
The board is close enough pin configuration that you can directly replace the d1 mini and replace the `board` package in airgradient-pro.yaml, and replace the `D7` under the `!extend config_button` with `4`.
40+
3541
## button_factory_reset.yaml
3642

3743
Enables a button to reset device to factory resets, which erases all nvram and erases all stored preferences.
@@ -53,6 +59,8 @@ binary_sensor:
5359
number: D7
5460
```
5561
62+
If using an AG Pro v4.2 with a user lolin-d3-mini upgrade use pin 4 instead of D7
63+
5664
* Short press - Toggle temperature display between C and F
5765
* Press and hold up to 5 seconds - Initiate Senseair S8 CO2 manual calibration. Ensure device is already outdoors or near an open window for 5+ minutes before initiating
5866
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This is for use with the AirGradient Pro replacing the default
2+
# D1 Mini esp8266 board with a Lolin C3 Mini esp32 board
3+
4+
substitutions:
5+
config_version: 5.3.2
6+
7+
esphome:
8+
name: "${name}"
9+
friendly_name: "${friendly_name}"
10+
name_add_mac_suffix: ${name_add_mac_suffix} # Set to false if you don't want part of the MAC address in the name
11+
platform: ESP32
12+
13+
project:
14+
name: mallocarray.airgradient
15+
version: "$config_version"
16+
min_version: 2025.5.0
17+
18+
esp32:
19+
board: lolin_c3_mini
20+
variant: esp32c3
21+
framework:
22+
type: esp-idf
23+
24+
# Enable logging
25+
# https://esphome.io/components/logger.html
26+
logger:
27+
28+
uart:
29+
- rx_pin: 1
30+
tx_pin: 0
31+
baud_rate: 9600
32+
id: pms5003_uart
33+
34+
- rx_pin: 6
35+
tx_pin: 7
36+
baud_rate: 9600
37+
id: senseair_co2_uart
38+
39+
i2c:
40+
# https://esphome.io/components/i2c.html
41+
sda:
42+
number: 8
43+
# Acknowledging that this is a strapping pin and should not have external pullup/down resistors
44+
# https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
45+
ignore_strapping_warning: true
46+
scl: 10
47+
# 400kHz eliminates warnings about components taking a long time other than SGP40 component: https://github.com/esphome/issues/issues/4717
48+
frequency: 400kHz

0 commit comments

Comments
 (0)