Technology

cách sử dụng cân điện tử tính tiền

cách sử dụng cân điện tử tính tiền
cách sử dụng cân điện tử tính tiền | SiamCafe Blog
2025-10-30· อ. บอม — SiamCafe.net· 2,070 คำ

เครื่องชั่งดิจิทัลคิดเงิน — ระบบ POS สำหรับร้านค้า

เครื่องชั่งดิจิทัลคิดเงิน (Electronic Price Computing Scale) เป็นอุปกรณ์ที่รวมฟังก์ชันการชั่งน้ำหนักและคำนวณราคาสินค้าอัตโนมัติ ใช้กันแพร่หลายในตลาดสด ร้านผลไม้ ร้านอาหาร และร้านค้าปลีก เครื่องชั่งรุ่นใหม่สามารถเชื่อมต่อกับระบบ POS (Point of Sale) พิมพ์ใบเสร็จ และส่งข้อมูลยอดขายไปยังระบบหลังบ้านได้แบบ real-time บทความนี้อธิบายวิธีใช้งาน ประเภทเครื่องชั่ง การเชื่อมต่อกับระบบ IT และการพัฒนาซอฟต์แวร์สำหรับเครื่องชั่งดิจิทัล

ประเภทเครื่องชั่งดิจิทัล

# scale_types.py — Digital scale types
import json

class DigitalScaleTypes:
    TYPES = {
        "price_computing": {
            "name": "เครื่องชั่งคิดราคา (Price Computing Scale)",
            "function": "ชั่งน้ำหนัก + คำนวณราคาอัตโนมัติ (น้ำหนัก × ราคา/กก.)",
            "use": "ตลาดสด ร้านผลไม้ ร้านขายเนื้อ",
            "price": "2,000-15,000 บาท",
            "features": ["หน้าจอ LED/LCD", "ปุ่มตั้งราคาสินค้า", "พิมพ์สติกเกอร์ราคา"],
        },
        "counting": {
            "name": "เครื่องชั่งนับจำนวน (Counting Scale)",
            "function": "ชั่งน้ำหนักรวม + คำนวณจำนวนชิ้น",
            "use": "โรงงาน คลังสินค้า ร้านขายส่ง",
            "price": "3,000-20,000 บาท",
            "features": ["นับชิ้นงาน", "ตั้ง unit weight", "เชื่อมต่อ RS232"],
        },
        "pos_integrated": {
            "name": "เครื่องชั่ง POS (POS Integrated Scale)",
            "function": "เชื่อมต่อระบบ POS + barcode + receipt printer",
            "use": "ซูเปอร์มาร์เก็ต ร้านสะดวกซื้อ",
            "price": "15,000-80,000 บาท",
            "features": ["Label printer", "Barcode scanner", "Ethernet/WiFi", "Touch screen"],
        },
        "bench": {
            "name": "เครื่องชั่งตั้งโต๊ะ (Bench Scale)",
            "function": "ชั่งน้ำหนักทั่วไป ความแม่นยำสูง",
            "use": "ห้องปฏิบัติการ ร้านทอง ร้านยา",
            "price": "1,500-50,000 บาท",
            "features": ["ความละเอียดสูง (0.01g-0.1g)", "Calibration", "RS232/USB"],
        },
    }

    def show_types(self):
        print("=== Digital Scale Types ===\n")
        for key, scale in self.TYPES.items():
            print(f"[{scale['name']}]")
            print(f"  Function: {scale['function']}")
            print(f"  Use: {scale['use']}")
            print(f"  Price: {scale['price']}")
            print()

scales = DigitalScaleTypes()
scales.show_types()

วิธีใช้งานเครื่องชั่งคิดราคา

# usage.py — How to use price computing scale
import json

class ScaleUsage:
    BASIC_STEPS = {
        "step1": {"name": "1. เปิดเครื่อง", "detail": "กด ON/OFF รอหน้าจอแสดง 0.000 kg"},
        "step2": {"name": "2. ตั้งค่าหน่วย", "detail": "เลือก kg หรือ g (กด UNIT)"},
        "step3": {"name": "3. Tare (หักน้ำหนักภาชนะ)", "detail": "วางภาชนะ → กด TARE → หน้าจอกลับ 0"},
        "step4": {"name": "4. ตั้งราคาต่อ kg", "detail": "กดตัวเลขราคา เช่น 120 = 120 บาท/kg"},
        "step5": {"name": "5. วางสินค้า", "detail": "วางสินค้าบนถาด → เครื่องแสดง น้ำหนัก + ราคา"},
        "step6": {"name": "6. บันทึก/สะสม", "detail": "กด M+ (Memory Plus) เพื่อสะสมหลายรายการ"},
        "step7": {"name": "7. ยอดรวม", "detail": "กด TOTAL เพื่อดูยอดรวมทั้งหมด → เก็บเงิน"},
        "step8": {"name": "8. เคลียร์", "detail": "กด C/CE เพื่อเริ่มรอบใหม่"},
    }

    TIPS = [
        "วาง scale บนพื้นราบ เสมอกัน — ไม่เอียง",
        "Calibrate ทุก 3-6 เดือน ด้วยน้ำหนักมาตรฐาน",
        "อย่าวางของเกิน Max capacity (overload = เสีย)",
        "ทำความสะอาดถาดชั่งทุกวัน",
        "ตรวจสอบ Tare ก่อนชั่งทุกครั้ง",
        "เก็บรักษาที่แห้ง ไม่โดนน้ำ (ยกเว้นรุ่น IP65 waterproof)",
    ]

    PRICE_MEMORY = """
    Price Memory (PLU — Price Look Up):
    
    ปุ่ม M1-M99: บันทึกราคาสินค้าล่วงหน้า
    
    ตั้งค่า:
    1. กด SET → M1 → ใส่ราคา 120 → ENTER
    2. กด SET → M2 → ใส่ราคา 85 → ENTER
    
    ใช้งาน:
    - วางสินค้า → กด M1 → แสดงราคาอัตโนมัติ
    - ไม่ต้องกดราคาทุกครั้ง → เร็วขึ้น ลดผิดพลาด
    
    ตัวอย่าง:
    M1 = มะม่วง 120 บาท/kg
    M2 = ส้ม 85 บาท/kg
    M3 = แต่งโม 35 บาท/kg
    """

    def show_steps(self):
        print("=== Basic Usage Steps ===\n")
        for key, step in self.BASIC_STEPS.items():
            print(f"[{step['name']}]")
            print(f"  {step['detail']}")

    def show_tips(self):
        print(f"\n=== Tips ===")
        for tip in self.TIPS[:5]:
            print(f"  • {tip}")

    def show_plu(self):
        print(f"\n=== PLU Memory ===")
        print(self.PRICE_MEMORY)

usage = ScaleUsage()
usage.show_steps()
usage.show_tips()
usage.show_plu()

เชื่อมต่อระบบ POS

# pos_integration.py — POS system integration
import json

class POSIntegration:
    PROTOCOLS = {
        "rs232": {
            "name": "RS-232 (Serial Port)",
            "description": "การเชื่อมต่อแบบ serial ผ่านสาย COM port",
            "speed": "9600-115200 baud",
            "use": "เครื่องชั่งรุ่นเก่า ระบบ legacy",
        },
        "usb": {
            "name": "USB (HID / Serial)",
            "description": "เชื่อมต่อ USB เป็น keyboard input หรือ serial",
            "speed": "12 Mbps (USB 2.0)",
            "use": "เครื่องชั่งรุ่นใหม่ทั่วไป",
        },
        "ethernet": {
            "name": "Ethernet / WiFi",
            "description": "เชื่อมต่อผ่าน network ส่งข้อมูลแบบ TCP/IP",
            "speed": "100 Mbps+",
            "use": "POS integrated scales, cloud POS",
        },
        "bluetooth": {
            "name": "Bluetooth",
            "description": "เชื่อมต่อไร้สายกับ tablet/smartphone POS",
            "speed": "2 Mbps",
            "use": "Mobile POS, ร้านค้าเคลื่อนที่",
        },
    }

    PYTHON_SERIAL = """
# scale_reader.py — Read weight from scale via Serial
import serial
import time

class ScaleReader:
    def __init__(self, port='COM3', baudrate=9600):
        self.ser = serial.Serial(
            port=port,
            baudrate=baudrate,
            bytesize=serial.EIGHTBITS,
            parity=serial.PARITY_NONE,
            stopbits=serial.STOPBITS_ONE,
            timeout=1,
        )
    
    def read_weight(self):
        # Send weight request command (varies by brand)
        self.ser.write(b'W\\r\\n')  # Common command
        time.sleep(0.1)
        
        response = self.ser.readline().decode('ascii').strip()
        # Parse response: "ST, GS,  0.500 kg" (format varies)
        try:
            parts = response.split(',')
            weight_str = parts[-1].strip().replace('kg', '').strip()
            weight = float(weight_str)
            return weight
        except (ValueError, IndexError):
            return None
    
    def continuous_read(self, callback, interval=0.5):
        print("Reading scale... (Ctrl+C to stop)")
        try:
            while True:
                weight = self.read_weight()
                if weight is not None:
                    callback(weight)
                time.sleep(interval)
        except KeyboardInterrupt:
            print("Stopped.")
    
    def close(self):
        self.ser.close()

# Usage
def on_weight(w):
    price_per_kg = 120
    total = w * price_per_kg
    print(f"  Weight: {w:.3f} kg | Price: {total:.2f} บาท")

reader = ScaleReader('COM3')
reader.continuous_read(on_weight)
"""

    def show_protocols(self):
        print("=== Connection Protocols ===\n")
        for key, proto in self.PROTOCOLS.items():
            print(f"[{proto['name']}]")
            print(f"  {proto['description']}")
            print(f"  Use: {proto['use']}")
            print()

    def show_python(self):
        print("=== Python Serial Reader ===")
        print(self.PYTHON_SERIAL[:500])

pos = POSIntegration()
pos.show_protocols()
pos.show_python()

ระบบ POS สำหรับร้านชั่งขาย

# pos_system.py — POS system for weighing shops
import json
import random
from datetime import datetime

class WeighingPOS:
    FEATURES = {
        "weight_pricing": "ชั่งน้ำหนัก + คำนวณราคาอัตโนมัติ",
        "barcode_label": "พิมพ์ barcode label สำหรับติดสินค้า",
        "receipt": "พิมพ์ใบเสร็จรับเงิน",
        "inventory": "ติดตาม stock สินค้า",
        "reports": "รายงานยอดขายรายวัน/เดือน",
        "multi_payment": "รับชำระ: เงินสด, PromptPay, บัตรเครดิต",
    }

    POS_CODE = """
# simple_pos.py — Simple POS with scale integration
from datetime import datetime

class SimplePOS:
    def __init__(self):
        self.products = {}
        self.cart = []
        self.transaction_id = 0
    
    def add_product(self, code, name, price_per_kg):
        self.products[code] = {
            "name": name,
            "price_per_kg": price_per_kg,
        }
    
    def add_to_cart(self, code, weight_kg):
        if code not in self.products:
            print(f"Product {code} not found")
            return
        
        product = self.products[code]
        total = weight_kg * product["price_per_kg"]
        
        item = {
            "code": code,
            "name": product["name"],
            "weight": weight_kg,
            "price_per_kg": product["price_per_kg"],
            "total": round(total, 2),
        }
        self.cart.append(item)
        print(f"  Added: {item['name']} {weight_kg:.3f}kg × {product['price_per_kg']} = {total:.2f} บาท")
    
    def get_total(self):
        return sum(item["total"] for item in self.cart)
    
    def checkout(self, payment):
        self.transaction_id += 1
        total = self.get_total()
        change = payment - total
        
        print(f"\\n{'='*40}")
        print(f"  Transaction #{self.transaction_id}")
        print(f"  Date: {datetime.now().strftime('%Y-%m-%d %H:%M')}")
        print(f"{'='*40}")
        for item in self.cart:
            print(f"  {item['name']:<15} {item['weight']:.3f}kg  {item['total']:>8.2f}")
        print(f"{'='*40}")
        print(f"  Total: {total:>25.2f} บาท")
        print(f"  Payment: {payment:>22.2f} บาท")
        print(f"  Change: {change:>23.2f} บาท")
        
        self.cart = []
        return {"id": self.transaction_id, "total": total, "change": change}

# Usage
pos = SimplePOS()
pos.add_product("M01", "มะม่วง", 120)
pos.add_product("S01", "ส้ม", 85)
pos.add_product("W01", "แต่งโม", 35)

pos.add_to_cart("M01", 1.250)  # มะม่วง 1.25 kg
pos.add_to_cart("S01", 0.800)  # ส้ม 0.8 kg
pos.checkout(300)
"""

    def show_features(self):
        print("=== POS Features ===\n")
        for key, feature in self.FEATURES.items():
            print(f"  [{key}] {feature}")

    def show_pos_code(self):
        print(f"\n=== Simple POS Code ===")
        print(self.POS_CODE[:600])

    def daily_report(self):
        print(f"\n=== Daily Sales Report ===")
        products = [
            {"name": "มะม่วง", "qty_kg": random.uniform(20, 80), "revenue": 0, "price": 120},
            {"name": "ส้ม", "qty_kg": random.uniform(15, 60), "revenue": 0, "price": 85},
            {"name": "แต่งโม", "qty_kg": random.uniform(30, 100), "revenue": 0, "price": 35},
            {"name": "องุ่น", "qty_kg": random.uniform(5, 30), "revenue": 0, "price": 180},
        ]
        total_revenue = 0
        for p in products:
            p["revenue"] = p["qty_kg"] * p["price"]
            total_revenue += p["revenue"]
            print(f"  {p['name']:<10} {p['qty_kg']:>6.1f} kg × {p['price']:>3} = {p['revenue']:>8,.0f} บาท")
        print(f"  {'Total':>30} {total_revenue:>8,.0f} บาท")

wpos = WeighingPOS()
wpos.show_features()
wpos.show_pos_code()
wpos.daily_report()

การเลือกซื้อเครื่องชั่ง

# buying_guide.py — Scale buying guide
import json

class BuyingGuide:
    CRITERIA = {
        "capacity": {
            "name": "Capacity (พิกัดน้ำหนัก)",
            "guide": "เลือกให้เกินน้ำหนักที่ชั่งปกติ 20-30%",
            "examples": "ผลไม้: 30kg | เนื้อ: 15kg | ทอง: 500g | อุตสาหกรรม: 150-300kg",
        },
        "division": {
            "name": "Division (ความละเอียด)",
            "guide": "ยิ่งละเอียดยิ่งแม่นยำ แต่ capacity จะต่ำลง",
            "examples": "ตลาดสด: 5-10g | ร้านทอง: 0.01g | ห้องแล็บ: 0.001g",
        },
        "connectivity": {
            "name": "Connectivity",
            "guide": "เลือกตาม POS system ที่ใช้",
            "examples": "RS232: legacy POS | USB: modern POS | WiFi: cloud POS | Bluetooth: mobile",
        },
        "waterproof": {
            "name": "Waterproof (IP Rating)",
            "guide": "ถ้าใช้ในที่เปียก/ล้างน้ำ ต้อง IP65+",
            "examples": "ตลาดปลา: IP67 | ร้านผลไม้: IP54 | ห้องแล็บ: ไม่จำเป็น",
        },
        "certification": {
            "name": "Certification (มอก./OIML)",
            "guide": "ถ้าใช้ค้าขาย ต้องผ่านมาตรฐาน มอก. หรือ OIML",
            "examples": "มอก. 2009 (เครื่องชั่งชนิดไม่อัตโนมัติ)",
        },
    }

    BRANDS = {
        "cas": {"name": "CAS", "origin": "Korea", "range": "2,000-50,000 บาท", "popular": "ตลาดสด ร้านค้า"},
        "jadever": {"name": "Jadever", "origin": "Taiwan", "range": "3,000-30,000 บาท", "popular": "อุตสาหกรรม"},
        "ohaus": {"name": "OHAUS", "origin": "USA", "range": "5,000-100,000 บาท", "popular": "ห้องแล็บ"},
        "and": {"name": "A&D", "origin": "Japan", "range": "5,000-80,000 บาท", "popular": "ความแม่นยำสูง"},
    }

    def show_criteria(self):
        print("=== Buying Criteria ===\n")
        for key, c in self.CRITERIA.items():
            print(f"[{c['name']}]")
            print(f"  {c['guide']}")
            print(f"  Examples: {c['examples']}")
            print()

    def show_brands(self):
        print("=== Popular Brands ===")
        for key, b in self.BRANDS.items():
            print(f"  [{b['name']}] {b['origin']} | {b['range']} | {b['popular']}")

guide = BuyingGuide()
guide.show_criteria()
guide.show_brands()

FAQ - คำถามที่พบบ่อย

Q: เครื่องชั่งดิจิทัลคิดราคาใช้ยังไง?

A: 1. เปิดเครื่อง รอหน้าจอแสดง 0 2. กด TARE หักน้ำหนักภาชนะ 3. ใส่ราคาต่อ kg (เช่น 120) 4. วางสินค้า → แสดงน้ำหนักและราคาอัตโนมัติ 5. กด M+ สะสมหลายรายการ 6. กด TOTAL ดูยอดรวม ตั้ง PLU (Price Look Up) สำหรับสินค้าที่ขายบ่อย → ไม่ต้องกดราคาทุกครั้ง

Q: เครื่องชั่งดิจิทัลเชื่อมต่อ POS ได้ไหม?

A: ได้ ผ่าน RS-232 (Serial), USB, Ethernet หรือ Bluetooth ขึ้นอยู่กับรุ่น ต้องเลือกเครื่องชั่งที่มี interface ตรงกับ POS software ที่ใช้ POS software ยอดนิยม: Loyverse, Vend, Square, หรือพัฒนาเอง Python + pyserial สามารถอ่านค่าน้ำหนักจากเครื่องชั่งได้

Q: เครื่องชั่งราคาเท่าไหร่?

A: เครื่องชั่งคิดราคาทั่วไป: 2,000-5,000 บาท เครื่องชั่งพิมพ์สติกเกอร์: 8,000-20,000 บาท เครื่องชั่ง POS integrated: 15,000-80,000 บาท เครื่องชั่งอุตสาหกรรม: 3,000-50,000 บาท เลือกตาม: capacity, ความละเอียด, connectivity, waterproof

Q: Calibrate เครื่องชั่งทำอย่างไร?

A: 1. เตรียมน้ำหนักมาตรฐาน (certified test weight) 2. เข้า calibration mode (กดปุ่ม CAL ค้าง) 3. วางน้ำหนักมาตรฐานตามที่เครื่องแสดง 4. ยืนยัน → เครื่องปรับค่า calibrate ทุก 3-6 เดือน หรือเมื่อย้ายเครื่อง ซื้อน้ำหนักมาตรฐานจากร้านขายเครื่องชั่งหรือ online

📖 บทความที่เกี่ยวข้อง

máy tính tiền điện tửอ่านบทความ → cân điện tử tính tiền 5kgอ่านบทความ → 1 cửa điện tử tiền giangอ่านบทความ → cách nộp tiền thuế điện tử mới nhấtอ่านบทความ → cân điện tử tính tiềnอ่านบทความ →

📚 ดูบทความทั้งหมด →