Skip to content

[Feature request] Add VEML7700 ambient light sensor support #2303

@genepool99

Description

@genepool99

Use case

I would like to add support for the VEML7700 I2C ambient light sensor so MeshCore sensor nodes can report ambient light level as telemetry.

This would be useful for:

  • monitoring and troubleshooting solar nodes
  • day/night or room-brightness sensing
  • light-aware automation or alerting on supported sensor builds

Proposed behavior

Add VEML7700 support to the shared environmental sensor path so it behaves like the other supported I2C environmental sensors.

Proposed behavior:

  • compile-time enable with ENV_INCLUDE_VEML7700
  • probe the sensor on the telemetry I2C bus during EnvironmentSensorManager::begin()
  • if detected, publish lux as CayenneLPP luminosity telemetry in EnvironmentSensorManager::querySensors()

Implementation notes

I already have this working on a branch in my fork and verified it on RAK_4631_sensor hardware.

Current implementation:

  • adds shared ENV_INCLUDE_VEML7700 build flag
  • adds Adafruit VEML7700 library dependency
  • probes VEML7700 on the telemetry I2C bus during sensor init
  • publishes lux as CayenneLPP luminosity telemetry

API / code shape

Intended pattern matches the existing shared environment sensor integrations:

#if ENV_INCLUDE_VEML7700
if (VEML7700.begin(TELEM_WIRE)) {
  VEML7700_initialized = true;
}
#endif

and during telemetry collection:

#if ENV_INCLUDE_VEML7700
if (VEML7700_initialized) {
  float lux = VEML7700.readLux();
  telemetry.addLuminosity(next_available_channel, lux);
  next_available_channel++;
}
#endif

If this approach looks good, I can open the PR against dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions