This package contains the interface software for the CO2 or "breath" detecting sensor of FRANCOR e.V.
The top layer contains the ROS2 package to communicate with the sensor board.
In the folder 'fw' is the STM32CubeIDE project which contains the firmware for the BluePill Board. The sensor is a BME680 environmental sensor from BOSCH.
- STM32 BluePill based on the STM32F103C8T6 MCU
- DFRobot Breakout Board of Bosch BME680 connected to the BluePill via I2C
- Communication with host via USB virtual com port
- STLink Debugger to flash the firmware
- STM32CubeIDE is necessary to build the firmware
The connection between BluePill and the breakout board is shown in the table below
BluePill-Pin | BME680 Module Pin | Function |
---|---|---|
3.3V | I2C-VCC | Power supply |
GND | I2C-GND | Ground |
B6 | I2C-SCL | I2C clock line |
B7 | I2C-SDA | I2C data line |
The breakout board support two interface types: I2C and SPI. Because I2C needs only two data lines we choose I2C over SPI bus.
To build the firmware you have to import the project in the firmware directory into the STM32CubeIDE. You have to use the code generator of CubeMX to generate the driver files, because thei are not checked into this git repository.
Please make sure you have pulled the submodules with:
git submodule update --init --recursive
This is necessary, because the BME680 sensors needs Drivers which are imported as submodule from the official Bosch Sensortec repository.
A problem with man VCP devices is that linux will only increment the path /dev/ttyACM0, /dev/ttyACM1, ... If you have many VCP devices you dont know which device belongs to which board. To be able to distinguish between the serial devices a UDEV-rule is added to this repository. To install it you have to copy the rule into the udev rules folder of you linux distribution:
// Copy udev rules
sudo cp udev/99-francor-co2.rules /etc/udev/rules.d/
// Update udev rules
sudo udevadm control --reload
After installing the udev rule you will find the CO2 sensor always at the path
/dev/ttyCO2Sensor