Skip to content

A repo containing C drivers and code for Sensirion sensors

License

Notifications You must be signed in to change notification settings

Meapy011/Biomebubble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biomebubble: C code for Sensirion Sensor Read out on Pi Terminal

This document explains how to set up the Sen sensors to run on a Raspberry Pi using the provided code, and printing the readings to the terminal.

Supported sensors

  • SFA3X
  • SCD30
  • SEN44
  • SEN55
  • SEN66

Setup Guide

Connecting the Sensor

The sensor board cable has the five different connectors: VCC, GND, SDA, SCL, GND Use the following pins to connect your Board

Board Raspberry Pi Jumper Wire
VCC Pin 2 (5V) Red
GND Pin 6 Black
SDA Pin 3 Green
SCL Pin 5 Yellow
GND Pin 9 (GND for I2C) Blue

Pin Name Description Comments
1 GND Ground
2 GND Ground
3 SCL I2C: Serial clock input TTL 5V and LVTTL 3.3V compatible
4 SDA I2C: Serial data input / output TTL 5V and LVTTL 3.3V compatible
5 NC Do not connect

Raspberry Pi

  • Install the Raspberry Pi OS on to your Raspberry Pi
  • Enable the I2C interface in the raspi-config
  • Download the driver for the Sensor Board and extract the .zip on your Raspberry Pi
  • Compile the driver
    1. Open a terminal

    2. Navigate to the driver directory. E.g. cd ~/Biomebubble/Sensor-examble

    3. Run the ./Build script to check for updates, make sure Build essential tools are installed and compile the driver

      Output:

      rm -f main.o sensirion_i2c_hal.o sensirion_i2c.o sensirion_common.o sen44_i2c.o scd30_i2c.o sfa3x_i2c.o sen66_i2c.o sen5x_i2c.o test-sensors
      gcc -Wall -O2 -I../include -c main.c -o main.o
      gcc -Wall -O2 -I../include -c ../src/sensirion_i2c_hal.c -o sensirion_i2c_hal.o
      gcc -Wall -O2 -I../include -c ../src/sensirion_i2c.c -o sensirion_i2c.o
      gcc -Wall -O2 -I../include -c ../src/sensirion_common.c -o sensirion_common.o
      gcc -Wall -O2 -I../include -c ../src/sen44_i2c.c -o sen44_i2c.o
      gcc -Wall -O2 -I../include -c ../src/scd30_i2c.c -o scd30_i2c.o
      gcc -Wall -O2 -I../include -c ../src/sfa3x_i2c.c -o sfa3x_i2c.o
      gcc -Wall -O2 -I../include -c ../src/sen66_i2c.c -o sen66_i2c.o
      gcc -Wall -O2 -I../include -c ../src/sen5x_i2c.c -o sen5x_i2c.o
      gcc -Wall -O2 -I../include -o test-sensors main.o sensirion_i2c_hal.o sensirion_i2c.o sensirion_common.o sen44_i2c.o scd30_i2c.o sfa3x_i2c.o sen66_i2c.o sen5x_i2c.o
      # Delete object files after linking
      rm -f main.o sensirion_i2c_hal.o sensirion_i2c.o sensirion_common.o sen44_i2c.o scd30_i2c.o sfa3x_i2c.o sen66_i2c.o sen5x_i2c.o
      
      
  • Test your connected sensor
    • Run ./test-sensors in the same directory you used to compile the driver.

Resources:

About

A repo containing C drivers and code for Sensirion sensors

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors