Electronic Scale 1.0

1.Electronic scale information

Electronic scale information table

Host Model

D1w

Measuring range

100g-15kg/30kg(Double range)

Certified division value

5g/10g

Safe overload (%FS)

120

Destroy overload (%FS)

150

Working temperature (℃)

-10℃~40℃

Working humidity

10%~85% No condensation

Creep(%FS/30min)

+-0.02

Equipment dealer/model

W23

Porter rate

9600

Access mode

Serial(/dev/ttyS4)

3.Electronic scale software development

The method of application

Link Electronic scale sdk downloads

Binding the electronic scale service to obtain relevant data for the electronic scale

Initialization

Open the serial port and obtain the net weight and state of the electronic scale by means of an interface callback

 1Electronic mElectronic = new Electronic.Builder()
 2//default path
 3.setDevicePath(“/dev/ttyS4”)
 4//default porter rate
 5.setBaudrate(9600)
 6.setReceiveCallback(new ElectronicCallback {
 7@Override
 8public void electronicStatus(String weight, String weightStatus) {
 9//Callback in child thread
10  ...
11}})
12 .builder()
Electronic Parameters

Parameters

Description

Weight

Unit(kg)

scale state

46:overweight, 53:Normal, 55:unstable, 56:Successful manual peeling, 57: Failure of manual peeling

Get the function of zero clearing and peeling of electronic scale by direct calling method

  • zero clearing

    mElectronic.turnZero()

  • Weigh with tare removal

    mElectronic.removePeel()

  • Manual peeling

    mElectronic.manualPeel(int peelWeight)

  • Turn off the electronic scale

    mElectronic.closeElectronic()

Hybrid uses WebView to call the scale

JavaScript API to call the scale

iMin provides electronic scale service plug-in, users can search for iMinprinter plug-in through iMin App Store, download and install, and print web content through the browser using the electronic scale function.

Demo Case(You can open your chrome browser and enter the URL below to experience.)

https://mp.imin.sg/ElectronicScale/index.html

Use JavaScript API

Establishing a connection can be done in the following 3 steps:

  1. Download the JS library file Download the JS library

  2. Add the js file to your project

  3. Initialize the connection

  1. Get the scale weight

Function:void electronicScaleGetWeight()

 1//Initialize the connection
 2var IminPrintInstance = new IminPrinter();
 3
 4IminPrintInstance.connect().then(async (isConnect) => {
 5    if (isConnect) {
 6        var weight = 0;
 7        // Get the scale weight
 8        IminPrintInstance.electronicScaleGetWeight(function (data) {
 9            // alignmentMode   Scale status code: 53=normal; 46=overweight; 55=No Stable Weight
10            // weight  The weight of the item that the scale currently weighs
11            if (data.alignmentMode === 53) {
12                weight = data.weight;
13                console.log('weight:'+ weight);
14            } else {
15                if (data.alignmentMode === 46) {
16                    console.log('Exceeding maximum weight');
17                } else {
18                    console.log('The state is unstable');
19                }
20            }
21        })
22    }
23})

parameter:

alignmentMode –> Scale status code: 53=normal; 46=overweight; 55=No Stable Weight weight –> The weight of the item that the scale currently weighs

  1. Electronic scale peeling

Function:void electronicScaleRemovePeel()

1IminPrintInstance.electronicScaleRemovePeel();
  1. Zero the electronic scale

Function:void electronicScaleTurnZero()

1IminPrintInstance.electronicScaleTurnZero();
  1. End of weighing

Function:void electronicScaleEnd()

1IminPrintInstance.electronicScaleEnd();

Electronic Scale 2.0

1. Framework

It adopts built-in electronic scale service and external reference SDK jar package. The functions and compatibility of the electronic scale are adapted by internal services, and the developer only needs to call the standard interface of the jar package. The iterative maintenance of the built-in electronic scale service can be independently upgraded by the platform without additional development by the customer.

2.Electronic scale information

Electronic scale parameter

Host Model

Swan 2 (Scale)

Measuring range

6kg≤Max≤15kg

n(Grade)

3000 (III)

Certified division value

2/5g

Working temperature (℃)

-10℃~40℃

3. Quantitative correlation

#1. Zero

Every time the smart electronic scale is re-powered, the electronic scale will automatically record the initial zero point as a reference for subsequent weighing. The zero point range for a power-on restart is usually 10% of full scale. When the weight exceeds 10% of the full scale, the electronic scale will not be able to find the zero position. For example, for a 15kg electronic scale, if the weight of the pan exceeds 1.5kg when the machine is turned on, the electronic scale will not be able to find the zero position. If the weight is less than 1.5kg, the electronic scale will default to start weighing from zero. We recommend that you empty all the items on the pan before powering it on.

#2. Manually clear/zero Settings

In daily weighing, if you need to return to zero, you can manually clear the zero back to the initial zero position. The range of manual zeroing is 2% of full scale. For a 15kg electronic scale, the range of manual zeroing is 298g. For example, after you clean the pan, the weight may show up as -0.004kg. When you click the Clear button, the weight display will return to "0.000kg". Note: In the case of tare, the Clear button will not work.

#3. Peel/peel

During the weighing process, if the weight of the product packaging needs to be removed, it can be performed by peeling. The weight of the peel will affect the weighing range. For example, if a 15kg electronic scale is set with a tare of 5kg, then the remaining weighing range will be only 10kg. Weighing and peeling: First put the package on the scale, click the peeling button, the weight of the package will be automatically recorded as tare weight; Preset tare if you know the package weight, you can manually enter the tare value; For multi-range electronic scales, the maximum peeling weight is usually Max1-e1. For example, for a 6/15kg electronic scale, the maximum tare is -5.998kg. Note: The value of preset tare must be set accurately. First, the value of the preset tare must be less than the maximum tare; Secondly, the preset tare value must be set according to the correct index value. For example, for a 6/15kg (n=3000) electronic scale, the preset tare value of 6.005kg or 0.019kg is not correct.

#4. Net weight

Net weight refers to the value of the weight that the consumer should pay for the product. If the product comes with packaging, it is necessary to remove the packaging as tare first.

#5. Gross weight

Gross weight = tare + net weight

4. Electronic scale service usage

#1. Downloading the SDK

Link Electronic scale sdk downloads

#2. Initialize SDK

After importing the jar package.

implementation files('libs/iMinEscale_SDK_V1.0.0.13_20250217.jar')

Connect the imin electronic scale service, when the service is connected, you can use the various functions in the SDK.

 1ScaleManager scaleManager =  ScaleManager.getInstance(context);
               2//iMin Scale service
               3scaleManager.connectService(newScaleManager.ScaleServiceConnection() {
               4
               5@Override
               6  public void onServiceConnected() {
               7  //Service binding
               8    }
               9@Override
               10  public void onServiceDisconnect() {
               11  //Service unbundling
               12    }
               13  }             
            

Message warning tips

In order to strengthen the privacy protection policy, Android 11 introduced many changes and restrictions, including changes in package visibility, which will prevent third-party applications from successfully initializing the SDK.

In particular, it should be noted that this change in Android 11 will only affect apps that upgrade targetSdkVersion=30, and apps that have not been upgraded will not be affected for the time being

#3. For more details ,please download the developer document