Git Product home page Git Product logo

sps30's Introduction

sps30

Control program for the senirion sps30 particle matter sensor (I²C interface)

Hardware/OS

  • Raspberry Pi (Zero/w)
  • Sensirion SPS30
  • Raspbian Stretch Lite (version: Nov 2018)

Pi - I²C (Inter-Integrated Circuit / i2c)

activate i2c with the raspi-config

sudo raspi-config

enter rapsi config menu navigate to 5. Interfacing Options raspi-config1

go to P5 I2C and enable it

raspi-config2

double check the config.txt

in /boot/config.txt

Add the correct clock rate for 200kHz.
(NOTE: rPI clock speed is CPU bound and very inaccurate so i set it to 230000)

dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=230000

GPIO Pins

gpio_i2c

NOTE: powering off the PI before connect the cables to the GPIO.
NOTE: i2c is not suitable for long wirings keep the wires as short as possible (not longer than 10cm / 4inches)

Test

install i2c-tools via apt:

sudo apt update
sudo apt install i2c-tools

after that, check if the sensor is reachable:

i2cdetect -y 1

the output should look like this:

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

0x69 is the i2c address from the sps30 - sensor

Libaries

  • libcurl-dev

we just need the <curl/curl.h>

sudo apt-get install libcurl4-openssl-dev

Compile

execute the build script

./build

Execute

The final binary is ./bin/sps30

[TODO: add more here]

sps30's People

Contributors

brannow avatar benlemasurier avatar

Watchers

James Cloos avatar

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.