Skip to main content

Omega Smartsensor Python SDK

Project description

Omega Smartsensor Python SDK

This Python SDK allows you to communicate with Omega Smart Sensor devices via I2C interface or Modbus interface and easily integrate them to embedded platform such as Raspberry Pi, etc...


Python 3.5+

Installation & Usage

pip install

The package can be installed by running:

pip install omegasensor
Then import the package:

from omegasensor import *


Clone from repository. And Install via Setuptools from source directory:

python install --user

Getting started

import time
from omegasensor import *  

def main():    
    bus = BusModbus('/dev/ttyUSB0', SMARTSENSOR_MODBUS_ADDR)   # for Modbus interface 
    # bus = BusI2C(1, SMARTSENSOR_I2C_ADDR) # for I2C interface
    ss = Smartsensor(bus)    

    print("Firmware 0x%08x" %    
    print("Device Id 0x%08x" %    
    print("Device %s" %    
    sensor_cnt =    
    print("Onboard %d sensors" % sensor_cnt)    
    print("Onboard %d outputs" %    

    sensor_units = [ss.sensor_unit(i) for i in range(sensor_cnt)]    

    while True:    
        print("Time: ", ss.current_time_str())    
        for i in range(sensor_cnt):    
            print("%0.2f" % ss.sensor_reading(i),    
                  " %s" % sensor_units[i],    
                  "\t", end='')    

if __name__ == "__main__":    


Examples can be found in SDK Example directory

Hardware Setup

Omega BTH-SMP smart probes can be used with the I2C interface. On Raspberry Pi, here are the connections:

Raspberry Pi BTH-SMP
Pin 3 /BCM 2 SDA
Pin 5 /BCM 3 CLK
Pin 1 3.3V
Pin 6 GND

Alternatively, Omega Smart sensor dongle can be used which converts I2C interface to Modbus interface. On Linux system, the dongle will show up as /dev/ttyUSB0 or /dev/ttyACM0 for example.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for omegasensor, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size omegasensor-0.1-py3-none-any.whl (14.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size omegasensor-0.1.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page