Which board name to use for Sparkfun ESP32-C3?

Hi all,

This is my first time setting up an ESP32 so apologies if this is a stupid question.

@stevo32792 posted a fantastic guide to get a “dumb” air filter to be “smart”. I have the same air filter (MA-112) and I’m working on following his guide this weekend.

Here’s his post:

I purchased this board:

I’ve got it hooked up to the ESPHome AddOn in HA.

However, in Steven’s example YAML he has:

esp32:
  board: esp32-c3
  framework:
    type: arduino

Would anyone happen to know what I should put for my board name?

Thanks in advance!
Matt

Try the same. It should work

Edit: but the sample in the thread you pointed to uses board: esp32dev

The c3 is single core only. Why anyone buys them, i dunno.

Also, as the docs say, the official list is here PlatformIO Registry

1 Like

@nickrout thank you for the reply!

Do you have a board you prefer? I’m new to it and don’t know the various board options. But I would be happy to try a different one if you think it would be better.

Appreciate your help.

Matt

The most common board Esp Wroom32. With no doubts.

1 Like

Well don’t waste what you have bought, but the straight esp32 is fine. If you want a bit more, use an S3.

See here ESP32 - Wikipedia

1 Like

@nickrout @Karosm I’m having some trouble and I’m sure it’s me doing something stupid.

I tried a few board variants, including:
esp32-s3-devkitc-1

Now, I’m planning to use GPIO pins 0-3 for the connection to the MA-112. @stevo32792 used pins 26, etc - but this board doesn’t have those (pic attached).

I’m getting this error when trying to install:

I’m sure this is something obvious but this is my first time with ESP32 and ESPHome. Might one of you be able to shed a little light?

output:
  - platform: esp32_dac
    pin: 3
    id: fanspeed
  - platform: template
    id: custom_fan
    type: float 
    write_action:
      - if:
          condition:
            lambda: return ((state == 0));
          then:
            # action for off
            - switch.turn_off: power
            - output.turn_off: fanspeed
            - switch.turn_off: ion

      - if:
          condition:
            lambda: return ((state > 0));
          then:
            # action for on
            - switch.turn_on: power
            - output.turn_on: fanspeed
            - output.set_level:
                id: fanspeed
                level: !lambda return (0.48 + (state * 0.13));

fan:
  - platform: speed
    id: ma112
    output: custom_fan
    name: "Fan"
    speed_count: 100

Cheers.
Matt

You are using an s3 board type for a c3. They are comletely different boards.

@nickrout apologies I pasted the wrong one here. I did try the c3 board types with the same result. I’ll keep poking at it.

Try putting the correct board type, and posting your full yaml.

in photo it is ESP32-C3-DevKitC-02
so ESP32-C3 if you don’t find exact variant.
And don’t use GPIO2, it’s strapping pin(like gpio8 and 9).
And define pins always in form GPIOxx, not just number.

1 Like

@Karosm @nickrout I really appreciate both your help.

Here’s my full config. It’s still failing on the Output pin 3, saying that pin 26 and 27 are the only valid options.

substitutions:
  name: esphome-medify-ma-112
  friendly_name: Medify MA-112
  
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}

esp32:
  board: esp32-c3-devkitm-1
  variant: ESP32C3
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: (redacted)

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

captive_portal:

globals:
  - id: filter_time
    type: int
    restore_value: yes
    initial_value: '0'

interval:
- interval: 1min
  then:
    if:
      condition:
        fan.is_on: ma112
      then:
      - lambda: |-
          id(filter_time) += 1;

sensor:
  - platform: pulse_counter
    pin: GPIO0
    name: "Motor RPM"
    update_interval: 1s
  - platform: template
    name: Filter On Time
    id: filter_time_disp
    unit_of_measurement: "minutes"
    device_class: "duration"
    state_class: "measurement"
    accuracy_decimals: 0
    lambda: |-
      return id(filter_time);

binary_sensor:
  - platform: template
    name: "Filter End of Life"
    lambda: |-
      if (id(filter_time) > 180000){
        return true;
      } else {
        return false;
      }

button:
  - platform: template
    name: "Reset Filter Life"
    on_press:
      lambda: |-
        id(filter_time) = 0;

switch:
  - platform: gpio
    pin: GPIO1
    name: "Ion"
    id: ion
  - platform: gpio
    pin: GPIO18
    name: "Power"
    id: power
    internal: true

output:
  - platform: esp32_dac
    pin: GPIO3
    id: fanspeed
  - platform: template
    id: custom_fan
    type: float 
    write_action:
      - if:
          condition:
            lambda: return ((state == 0));
          then:
            # action for off
            - switch.turn_off: power
            - output.turn_off: fanspeed
            - switch.turn_off: ion

      - if:
          condition:
            lambda: return ((state > 0));
          then:
            # action for on
            - switch.turn_on: power
            - output.turn_on: fanspeed
            - output.set_level:
                id: fanspeed
                level: !lambda return (0.48 + (state * 0.13));

fan:
  - platform: speed
    id: ma112
    output: custom_fan
    name: "Fan"
    speed_count: 100

That is a bit misleading, you board doesn’t even have DAC.
Any C3 or S3 doesn’t have.

1 Like

@stevo32792 do you have any idea if there’s an alternate command for my c3? Or if not would you let me know which board you used for your MA 112? Thanks so much.

Normal esp wroom32, the most common board available.
image

Not s3,c3 or c6 or some mini/supermini version.

Otherwise, you could try with high frequency PWM, like LEDC Output component.

1 Like

@Karosm , I just ordered the ESP32 variant of:

https://a.co/d/elo0sEW

It arrives tomorrow. Thank you so much for your help. Will try it tomorrow.

Matt

And now that you have two, keep the other one for prototyping any esphome project you eventually have. When you have working proto, you can play with weird boards. Saving you lot of headache…

1 Like

So far so good with this board, thank you so much @Karosm !

Now to wire it to the actual filter unit.

good luck!

1 Like