AirGradient Forum

MallocArray firmware with DIY kit, TVOC Sensor, no temp/humidity reading

I have a AirGradient pre-solderd DIY kit (v3.3) that did not come with a TVOC sensor. I recently purchased said sensor from the AirGradient store and installed it into my unit. I was using the MallocArray ag-basic YAML on my device prior to installing the sensor and that was working fine however it does not contain the configuration for the TVOC sensor. Looking at the ag-pro YAML, it does contain the config for this sensor. After installing this on my device I am no longer seeing data from the temp/humidity sensor on the display or in the logs.

The following errors can be seen in the logs files:

[20:47:43][W][senseair:030]: Invalid preamble from SenseAir! 00b710fe 04080000 00000001 02
[20:47:43][E][sensirion_i2c:026]: CRC8 Checksum invalid at pos 1! 0xFF != 0xAC
[20:47:43][D][sht4x:080]: Sensor read failed

I did some research and found a few posts regarding removing pull up resistors from the temp/humidity sensor when the TVOC sensor is installed however the AirGradient store states that the TVOC sensor does not have pull up resistors so I am unsure if I need to remove the ones from the temp/humidity sensor since the TVOC sensor does not have them. Also, is this the cause of my main issue?

As you saw, the TVOC sold by AirGradient should not need any resistor changes. Just double checking, your temp sensor is installed in the lower left corner slot, and the TVOC in the upper spot, correct? It shouldn’t have any impact on it detecting the sensor or not, but it is common for people to install them in the wrong location which results in higher temp readings.

You could try reseating the temp sensor, and if you didn’t move it at all as part of this, it shouldn’t be related to it being installed backwards or anything.

Also, fully remove the power again and let it sit for 30 seconds and then plug it in again. Sometimes some really odd issues can be resolved with that.

The temp sensor is in the bottom connector, the TVOC is in the upper 3.3v connector. I am getting readings from the TVOC sensor, just not from the temp sensor.

I’ve reseated the sensors and left the unit unpowered for a day and the result is the same.

After a comparing the two YAML files in a code editor over a few beers I was able to find a difference in the code with the temp sensor. The pro code uses a sht4x while the basic code uses sht3xd. My unit works with the sht3xd sensor.

I have updated my code to use the sht3xd and also removed the following as it was not supported on this temp sensor:

precision: High
heater_power: High
heater_time: Long
heater_max_duty: 0.0

And added the following from the basic code:

heater_enabled: false

I can happily report that all sensors are now working as expected.

1 Like

Are you using the full_config files? If so, that would make sense.

If you are using airgradient-pro.yaml from the root of the project, it is a more modular approach, so you would just swap
temp_humidity: github://MallocArray/airgradient_esphome/packages/sensor_sht40.yaml
to
temp_humidity: github://MallocArray/airgradient_esphome/packages/sensor_sht30.yaml
and it should be good to go. The full configs expand all of the available options, but the packages method just has what is necessary and ESPHome figures out the rest, so the heater power and stuff would only apply to the SHT40

I was using the full configs yes. I’ll swap over to the yaml file from the project root as that seems to be the better approach. Appreciate your assistance with this and for the work you’ve done on this project.