Home
Name Modified Size InfoDownloads / Week
README.md 2021-08-13 5.1 kB
minimon-v1.1.zip 2021-01-27 312.4 kB
minimon.py 2020-06-01 6.4 kB
Totals: 3 Items   324.0 kB 0

MiniMon Version 1.1 has been released

MiniMon is a program to read CO2, Temperature, and Humidity data from a CO2-Monitor device distributed by various suppliers.

The program runs under Python and requires Version 3.5 or later. It currently runs only under Linux.

MiniMon was verified to work on a device distributed by TFA Drostmann, obtained from Amazon: https://www.amazon.de/gp/product/B00TH3OW4Q. Other sources are https://www.co2meter.com/products/co2mini-co2-indoor-air-quality-monitor.

The device is used with the Linux HIDRAW (Human-Interface-Device Raw) driver, which is the kernel interface for Raw Access to USB and Bluetooth Human Interface Devices. These drivers are specific to Linux.

MiniMon with a Graphical User Interface

While this MiniMon program is a self-standing version and is used on the command line, the full MiniMon functionality is integrated into program GeigerLog, which in addition to logging also allow graphical presentation and statistical analysis.

See: ** https://sourceforge.net/projects/geigerlog/ **

User information in GeigerLog manual on pages 55 ff.
Manual: https://sourceforge.net/projects/geigerlog/files/GeigerLog-Manual-v1.1.pdf/download

Running MiniMon

Start MiniMon with:

                  ./minimon.py deviceaddr

The deviceaddr is the address of the hidraw driver your MiniMon-device has connected to. Find it out by issuing the following command on the command line, both before and after you plug the MiniMon device USB cord into your computer:

                  ls -al /dev/hidraw*

The newly appearing one is the one to choose, e.g. /dev/hidraw5. Then start MiniMon with:

             e.g. ./minimon.py /dev/hidraw5

Depending on permission settings on your computer, you may have to give this command as sudo (root). To overcome this, put a udev rule on your computer by putting into folder /etc/udev/rules.d a file named 90-co2mini.rules (included in this MiniMon package) with this content: (to do requires root permissions)

   #To activate use command:   sudo udevadm control --reload-rules
   #then unplug and replug MiniMon

   ACTION=="remove", GOTO="minimon_end"

   #Use this line if you have several MiniMons.
   #The name /dev/minimon will be attached with numbers depending on the hidraw dev it is linked to, like: /dev/minimon1, /dev/minimon2, etc
   #SUBSYSTEMS=="usb", KERNEL=="hidraw*", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", GROUP="plugdev", MODE="0660", SYMLINK+="minimon%n", GOTO="minimon_end"

   #Use this line if you have only a single MiniMon
   #The name /dev/minimon will never change
   SUBSYSTEMS=="usb", KERNEL=="hidraw*", ATTRS{idVendor}=="04d9", ATTRS{idProduct}=="a052", GROUP="plugdev", MODE="0660", SYMLINK+="minimon", GOTO="minimon_end"

   LABEL="minimon_end"

Then restart your computer or issue the command:

          sudo udevadm control --reload-rules

Then unplug and replug your MiniMon device.

This will a) allow the group plugdev (change as appropriate, or put your user into that group) access to the device node and b) symlink the hidraw devices of a connected CO₂ monitor always to /dev/minimon.

Multiple MiniMon devices

If you have multiple MiniMon devices, and want to have them connected simultaneously, then comment out the lower SUBSYSTEMS=... line in the udev rules file, and uncomment the upper one. Your devices will then be accessible as /dev/minimonN, with N being a number 0, 1, 2, ...

Finding out which one is which is not so easy. Try blowing against each backside, and see which device responds ;-).

Logging Data

The data will be logged to a CSV (Comma Separated Values) file minimonlog.csv in your current directory. If you want a different one, change the name in the code (approx line 40).

A timestamp is added to the data:

     2020-06-01 16:08:27     CO2: 502 ppm,   T: 28.04 °C,   H: 63 %

Output Examples

Example output in a normal office setting (no H sensor):

   CO2: 501 ppm,  T: 26.29 °C,  H:  0.00 %
   CO2: 501 ppm,  T: 26.29 °C,  H:  0.00 %
   CO2: 502 ppm,  T: 26.29 °C,  H:  0.00 %
   CO2: 502 ppm,  T: 26.29 °C,  H:  0.00 %

After blowing towards the backside of the MiniMon-device you may get this output. The display on the device itself only shows 'Hi' (no numbers) and the red LED is on (no H sensor):

   CO2: 9723 ppm,  T: 26.85 °C,  H:  0.00 %
   CO2: 9723 ppm,  T: 26.85 °C,  H:  0.00 %
   CO2: 7824 ppm,  T: 26.85 °C,  H:  0.00 %
   CO2: 7824 ppm,  T: 26.85 °C,  H:  0.00 %

References:

The reverse engineering of the device and the original software version is done by: Henryk Plötz, (2015): https://hackaday.io/project/5301-reverse-engineering-a-low-cost-usb-co-monitor/log/17909-all-your-base-are-belong-to-us

Some later software with bug fixes is by heinemml: https://github.com/heinemml/CO2Meter

Device documentation: http://co2meters.com/Documentation/AppNotes/AN146-RAD-0401-serial-communication.pdf

An explanation of how an NDIR CO2 Sensor works: https://www.co2meter.com/blogs/news/6010192-how-does-an-ndir-co2-sensor-work

Source: README.md, updated 2021-08-13