Page last edited July 12, 2012
Text editor powered by tinymce.
Page last edited July 12, 2012
Text editor powered by tinymce.
If you are trying to connect to a microcontroller/microcomputer, you can use a male DB-9 and then use a MAX232 or similar to convert from the +-10V inverted serial that comes out of the cable and convert it to plain 3.3-5V TTL serial
The bottom has two removable plates. One reveals a 9V battery (you can turn this into a portable scale but we think the 9V plug works best) and the other reveals some THM PCB. Not really sure what that's for but perhaps during test they use it?
Page last edited July 12, 2012
Text editor powered by tinymce.
First | Last | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Lbs/Oz. | 0x02 | 0x0B | 0x80 | 0x80 | lb1 | lb2 | lb3 | oz1 | oz2 | 0x0D |
Grams | 0x02 | 0x0C | 0x80 | 0x80 | g1 | g2 | g3 | g4 | g5 | 0x0D |
For example, if we are weighing a box that is 1 lb 4.1 oz this is the output:
Note that the weight shows up in ascii character format (so its 0x31 0x34 0x31 not 0x01 0x04 0x01) If you need to convert to raw number, just subtract hex 0x30
Grams is a little simpler since its metric. It weighs about 390 grams.
SERIALPORT = "COM1" # this uses pySerial found here http://pyserial.sourceforge.net/ # it currently exists for python 2.5 import serialser = serial.Serial(SERIALPORT, 2400, timeout=1) while True: while True:x = ser.read() if (ord(x) == 13): breakstart = ord(ser.read()) # this is always 2 if the scale is on (i think - not totally sure what this is) mode = ord(ser.read()) # 176 = oz/lbs #192 = grams nonce1 = ord(ser.read()) nonce2 = ord(ser.read()) if start != 2 or nonce1 != 128 or nonce2 != 128: continue value0 = int(ser.read()) # only used for lbs * 10 value1 = int(ser.read()) value2 = int(ser.read()) value3 = int(ser.read()) value4 = int(ser.read()) if mode == 176: #oz weight = ((value0 * 10 + value1) * 16) + (value2 * 10 + value3) + (value4 * 0.1) unit = 'oz' elif mode == 192: #grams weight = value1 * 1000 + value2 * 100 + value3 * 10 + value4 unit = 'g' print str(weight) + unit ser.close(
SERIALPORT = "COM1" # this uses pySerial found here http://pyserial.sourceforge.net/ # it currently exists for python 2.5 import serialser = serial.Serial(SERIALPORT, 2400, timeout=1) while True: while True:x = ser.read() if (ord(x) == 13): breakstart = ord(ser.read()) # this is always 2 if the scale is on (i think - not totally sure what this is) mode = ord(ser.read()) # 176 = oz/lbs #192 = grams nonce1 = ord(ser.read()) nonce2 = ord(ser.read()) if start != 2 or nonce1 != 128 or nonce2 != 128: continue value0 = int(ser.read()) # only used for lbs * 10 value1 = int(ser.read()) value2 = int(ser.read()) value3 = int(ser.read()) value4 = int(ser.read()) if mode == 176: #oz weight = ((value0 * 10 + value1) * 16) + (value2 * 10 + value3) + (value4 * 0.1) unit = 'oz' elif mode == 192: #grams weight = value1 * 1000 + value2 * 100 + value3 * 10 + value4 unit = 'g' print str(weight) + unit ser.close(
Page last edited July 12, 2012
Text editor powered by tinymce.
Page last edited July 12, 2012
Text editor powered by tinymce.
The format of the HD-150 is different than that of the smaller scale. By default the scale is in WorldShip mode (a piece of UPS software). Its not a great format, and you need to press the Data button to have the transmisison occur. We suggest putting it into SCI.3 mode which is continuous data transmission with higher resolution. Check the manual in the download section for how to get it into that mode
You will then be able to read from the data stream at 9600 baud, 8N1 no flow control.
First | Last | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
: | W | ' ' or '-' | lb1 | lb2 | lb3 | '.' | lb5 | lb6 | l | b | S if stable | L if lowbatt | 0x0D |
: | W | ' ' or '-' | kg1 | kg2 | kg3 | '.' | kg5 | kg6 | k | g | S if stable | L if lowbatt | 0x0D |
Basically, its ":W" followed by a space or minus sign, then 3 digits of whole lb/kg, a decimal point and two fractional digits. The data format scale is indicated by two characters, lb or kg' and then two status characters that will indicate if the reading has Stabilized and if the battery/power is Low
We don't have this scale with example code yet but you can probably adapt the python code above for the HD-150 or HD-300 without too much difficulty (and if you do please edit the wiki page to add it!)
Page last edited July 12, 2012
Text editor powered by tinymce.
Page last edited July 12, 2012
Text editor powered by tinymce.