Home

Awesome

Sensirion Raspberry Pi UART SVM4X Driver

The repository provides a driver for setting up a SVM4X evaluation kit to run on a Raspberry Pi over UART using the SHDLC protocol.

<img src="images/svm4x.png" width="300px">

Click here to learn more about the Sensirion SVM4X evaluation kit.

The SVM4x evaluation kit covers evaluation of the SGP40 and SGP41 sensors. This driver supports SVM4x firmware version 3.1.0 and above.

Connect the sensor

<details><summary>Connecting the Sensor over USB</summary> <p> This is the recommended way to connect your sensor. Plug the provided USB cable into your Raspberry Pi and sensor. </p></details> <details><summary>Connecting the Sensor over UART Pins</summary> <p>

Use the following pins to connect your SVM4X to your Raspberry Pi:

<img src="images/svm41-pinout-uart.png" width="300px">
Pin SVM4XCable ColorNamePin Raspberry PiDescriptionComments
1redVDDPin 2Supply Voltage3.3 or 5V
2blackGNDPin 6Ground
3greenRXPin 8UART: Transmission pin for communication
4yellowTXPin 10UART: Receiving pin for communication
5blueSELPin 4Interface selectLeave floating or pull to VDD to select UART
<img src="images/raspi-uart-pinout-5V.png" width="400px">

Note: Make sure to configure your hardware serial interface on your Raspberry Pi.

Note: Make sure to connect serial pins as cross-over (RX pin of sensor -> TX on Raspberry Pi; TX pin of sensor -> RX pin of Raspberry Pi)

</p></details>

Quick start example

Troubleshooting

Building driver failed

If the execution of make in the compilation step 3 fails with something like

 make: command not found

your RaspberryPi likely does not have the build tools installed. Proceed as follows:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential

Contributing

Contributions are welcome!

We develop and test this driver using our company internal tools (version control, continuous integration, code review etc.) and automatically synchronize the master branch with GitHub. But this doesn't mean that we don't respond to issues or don't accept pull requests on GitHub. In fact, you're very welcome to open issues or create pull requests :)

This Sensirion library uses clang-format to standardize the formatting of all our .c and .h files. Make sure your contributions are formatted accordingly:

The -i flag will apply the format changes to the files listed.

clang-format -i *.c *.h

Note that differences from this formatting will result in a failed build until they are fixed.

License

See LICENSE.