GithubHelp home page GithubHelp logo

sensirion / raspberry-pi-uart-sfa3x Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 0.0 594 KB

RaspberryPi driver for Sensirion SFA3x sensor module

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.02% C 98.98%
raspberry-pi uart driver gas-sensor sensirion sfa3x sfa30

raspberry-pi-uart-sfa3x's Introduction

Sensirion Raspberry Pi UART SFA3x Driver

This document explains how to set up the SEK-SFA3x evaluation kit to run on a Raspberry Pi using the provided code.

Setup Guide

Connecting the Sensor

Plug the provided USB cable into your Raspberry Pi.

If you don't have a suitable cable at hand, please find the SEK-SFA3x pinout listed below, or in the datasheet:

Pin Name Description Comments
1 VDD Supply Voltage 5V ±10%
2 GND Ground
3 RX UART: Receiving pin for communication
SDA I2C: Serial data input / output
4 TX UART: Transmission pin for communication
SCL I2C: Serial clock input
5 SEL Interface select Leave floating or pull to VDD to select UART
Pull to GND to select I2C
6 NC Do not connect
7 NC Do not connect

Raspberry Pi

  • Install the Raspberry Pi OS on to your Raspberry Pi

  • Download the driver from the Sensirion GitHub Page and extract the .zip on your Raspberry Pi

  • Compile the driver

    1. Open a terminal

    2. Navigate to the driver directory. E.g. cd ~/raspberry-pi-uart-sfa3x

    3. Run the make command to compile the driver

      Output:

      rm -f sfa3x_uart_example_usage
      cc -Os -Wall -fstrict-aliasing -Wstrict-aliasing=1 -Wsign-conversion -fPIC -I. -o sfa3x_uart_example_usage sfa3x_uart.h sfa3x_uart.c sensirion_uart_hal.h sensirion_shdlc.h sensirion_shdlc.c \
       sensirion_uart_hal.c sensirion_config.h sensirion_common.h sensirion_common.c sfa3x_uart_example_usage.c
      
  • Test your connected sensor

    • Run ./sfa3x_uart_example_usage in the same directory you used to compile the driver.

      Output:

      Device marking: 494108010320N020234S
      Formaldehyde concentration: 0.0 ppb
      Relative humidity: 35.35 %RH
      Temperature: 25.28 °C
      Formaldehyde concentration: 0.0 ppb
      Relative humidity: 35.34 %RH
      Temperature: 25.26 °C
      Formaldehyde concentration: 0.0 ppb
      Relative humidity: 35.36 %RH
      Temperature: 25.28 °C
      Formaldehyde concentration: 0.0 ppb
      Relative humidity: 35.34 %RH
      Temperature: 25.28 °C
      ...
      

raspberry-pi-uart-sfa3x's People

Contributors

leoniefierz avatar mbjoern avatar sensirion-bot avatar zifzaf avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

raspberry-pi-uart-sfa3x's Issues

HCHO always zero

Hi, I just received the SFA30 evaluation kit and I ran the code with a raspberry pi for about 8 hours.

Temperature and humidity is correct but HCHO only gives zero:

Screenshot 2021-04-27 at 00 36 13

This is measured in a relatively new office building. At the same time, I also have the SGP30 sensor that shows readings above 100 ppb (the broad peaks are during night when I suspect ventilation is off).
Screenshot 2021-04-27 at 00 31 22
I also have a BME680 sensor and it reports very high bVOCe, in the range of 5000 ppb.

Do you have any thoughts on which of the three scenarios could be happening?

  1. The air is completely devoid of formaldehyde?
  2. The software in this repo contains a bug?
  3. Hardware failure (keeping in mind that the software does not report any error codes..)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.