Tondaj SL-814

From Leo's Notes
Revision as of 06:16, 17 May 2020 by Leo (talk | contribs) (Created page with "The Tondaj SL-814 is a sound level meter with a USB port. I bought this from Deal Extreme back in December 2012 for $12.55 USD when they had the 50% off sale. The product is...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 17 May 2020, at 06:16.

The Tondaj SL-814 is a sound level meter with a USB port. I bought this from Deal Extreme back in December 2012 for $12.55 USD when they had the 50% off sale.

The product is also called a "7-Range Sound and Noise Meter-3085".

USB Connection

The meter has an optional USB cable that can be purchased and used with their proprietary software. However the meter I bought did not come with such a cable. Using an ordinary USB mini cable does not work since the device doesn't show up as a proper USB device when connected. On further research, it appears that the USB port is used to expose the internal serial connection to the microcontroller which can be interfaced with using any TTL UART adapter or module.

The pinouts from the USB port on this device are listed in the table below. Serial is only enabled when the USBOTGID pin is grounded; if you decide to splice a USB mini cable and it doesn't expose 5 wires, you will need to short the USBOTGID pin to ground inside the meter.

USB Mini Pinout:

Pin Connection Description
1 5V Leave disconnected. 5V power supplied by sound meter battery.
2 Serial Rx Connect to Tx on UART module
3 Serial Tx Connect to Rx on UART module
4 USBOTGID Short to ground
5 Ground Connect to Gnd on UART module

Protocol

Communication on the serial line is done at 9600 baud with 8e1 setting (8 data bit, even parity, 1 stop bit). The page at https://sigrok.org/wiki/Tondaj_SL-814 has the specifics on the protocol.

The following python script will poll the meter every half second:

#!/usr/bin/python3
# Tondaj SL-814 sound level meter Python script
# Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
# Released under the terms of the GNU GPL, version 2 or later.

import time
import serial

s = serial.Serial('/dev/ttyUSB0', baudrate=9600, parity=serial.PARITY_EVEN)

while 1:
    # Query
    s.write(bytes([0x30, 0x01, 0x0d]))
    result = s.read(4)
    print('%02x %02x %02x %02x' % tuple(result), end='   -   ')

    # A/C
    ac = (result[0] & (1 << 7)) >> 7
    print('A' if ac == 0 else 'C', end=', ')

    # Slow/Fast
    sl = (result[0] & (1 << 3)) >> 3
    print('Fast' if sl == 0 else 'Slow', end=', ')

    # Level
    factor = (result[0] & ((1 << 5) | (1 << 4))) >> 4
    print('Level: %d' % (40 + (int(bin(factor), 2) * 20)), end=', ')

    # Value
    val = ((result[0] & 0x7) << 8) | result[1]
    tmp_str = '%d' % val
    val_str = tmp_str[:-1] + '.' + tmp_str[-1:]
    print(val_str + ' dB')

    time.sleep(0.5)

s.close()


See Also