BurningSmell.org logo
RSS Links Projects Misc News

sensor8

sensor8 is a utility for communicating with the DLP-IO8 USB data-acquisition module in Linux.

Said module is cheap, well documented, and fully functional in Linux. Each of the 8 I/O pins can read a voltage with 10-bit ADC, read logic level input, read temperature from a Maxim© 1-wire DS18B20 thermometer, or drive a TTL high/low signal. The program provides an interface for all this functionality.

In this implementation, ADC values are byte-swapped and temperature values are not, the opposite is needed for a big-endian system.

UPDATE: 0.0.2 has improved temperature handling, and by default will wait 600 milliseconds for a valid temperature if a DS18B20 sensor is detected. If no sensor is detected it won't wait at all.

UPDATE: 0.0.3 has an important bugfix preventing the program from quitting prematurely when it can't read from a temperature sensor.

UPDATE: 0.0.4 has much better error detection for invalid temperatures, and can take multiple readings from one temperature sensor in a row then choose the median, to better deal with single-bit errors and the like.

$ ./sensor8 --help
sensor8, utility to talk to a DLP-I08 module
Written 2010 Tyler Montbriand.  Freeware.

Usage:  ./sensor8 ...
        --device(-d)    -d /dev/ttyUSB0
        --mode(-m)      -m 115200N81 (- means leave alone)
        --verbose(-v)   Enables debug output
        --help(-h)      Shows this listing
        --raw(-r)       Outputs raw bytes
        --tempms(-m)    Milliseconds between temp read retries
        --retries(-n)   Max # of tries to read a temp from a pin, default 1
        --count(-c)     Min # of valid temp reads per sensor, 1-7, default 1
        --lock(-l)      Enables cooperative locking

Valid commands:
        [0-7]           ex. 7, reads logic value on pin 7
        V[0-7]          ex. V3, reads voltage on pin 3
        T[0-7]          ex. T5, reads Celsius on pin 5
        F[0-7]          ex. F3, reads Fahrenheit on pin 3
        [0-7]:[01]      ex. 1:0, sets logic 0 on pin 1
        Z[0-7]          ex. Z2, tristates pin 2
        ACK             Pings device, waits for reply
        D[0-9]+         ex. D100, delays 100 milliseconds
        U[0-9]+         ex. U1000, delays 1000 microseconds

        ./sensor8 ACK 1:1 D100 T0 Z1
                ...will try to ACK the device, set pin 1 to logic high,
                sleep 100 milliseconds, read temp from pin 0, then
                tristate pin 1.

sensor8-0.0.5.tar.gz (9.3K)

sensor8-0.0.4.tar.gz (9.0K)

sensor8-0.0.3.tar.gz (8.4K)

sensor8-0.0.2.tar.gz (8.5K)

sensor8-0.0.1.tar.gz (7.8K)

Comments
Author Message
Tyler Montbriand on 2011-02-07 12:21:28 0.0.5 released, now supports locking(-l) to prevent multiple instances interfering with each other.
Tyler Montbriand on 2010-11-24 07:15:54 0.0.4 released. Can take several temperature readings and give the median. It no longer prints units, just values.
Tyler Montbriand on 2010-11-01 10:34:08 0.0.3 released, including a fix that prevents premature exit on sensor error.
Tyler Montbriand on 2010-10-20 09:50:41 The comments page is now OPEN.
[Use Any Browser]
Contact
Linux User #348010