Unni CO2 sensor tinkering/smartification

Hi,

I recently got ahold of a cheap-ish Unni CO2 sensor that displays CO2 (measured by an SCD40-knockoff), humidity and temperature in a nice, big display. Some reverse-engineering I had ChatGPT do and some tinkering lead to a device that can now connect to Home Assistant as well as use Sensirion’s BLE-protocol for their My Ambience-App and the open source “CO2 Sensor” iOS/macOS app, so it can be used stationary or mobile (with a powerbank).

If you connect an ESP32-C3 to the correct testpoints/pads, this can be a cheap little CO2 monitor that’s a lot more accurate than what other 50€-class gadgets can provide (the “eCO2”-measurments from tVOC sensors are ridicoulusly unrealiable).

I will update the readme in the next days to have pictures from the actual modified device. To do this, I had to scrap the battery-powered function from the device as 3 AAA-batteries would be sucked empty by the ESP32 in no time anyway.

In case anyone is interested in this I put it up here, though I don’t expect it will be of much use to anyone. The recerse-engineering and calibration of the temperature/humidity-readout parts was fun and to be very clear:

I haven’t written a single line of code for this. This is all ChatGPT.

Have fun,
Lukas


What you mean with that? Fake? Not passed Sensirion quality control and recovered from trash bean?
In any case it’s likely better than some “eCO2” sensor if CO2 level is in interest.

It seems to use the sensirion protocol, but the PCB containing the sensor is labled “CD40” (note the missing S) and given that thing is a 50€ fully built co2-monitor, I have doubts they used a real Sensirion SCD40 sensor. Might be wrong about that tho. The values it spits out are very much believable, especially compared to eCO2 from tVOC sensors - it follows my opening and closing the windows and seems to measure fine when I slowly breathe on it, unlike the tVOC sensor I have.

Missing S gives strong evidence of non genuine/factory approved Sensirion sensor.
But you never know if it’s fake, out of specs thrash recovery, produced “during night” by official manufacturer or simply mislabeled PCB.

I had chatgpt refactor the code to be more readable and document the ISRs and stuff. Pretty impressive to me as an amateur programmer. The code is now quite readable and well explained.