Electronic scale capable of recording reading and weighing method
By integrating an OLED display, a load sensor, and a data storage module into an electronic scale, and using a microcontroller for data processing and transmission, it solves the time-consuming and error-prone problems of manual data recording with traditional electronic scales, and realizes automated data recording and management. , improving data accuracy and work efficiency.
Patent Information
- Application Number
- CN202410845678.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-27
AI Technical Summary
Traditional electronic scales require manual recording of weighing data, which is time-consuming and error-prone, and cannot meet the needs of modern data processing.
An electronic scale including an OLED display, a load cell, a data storage module and a microcontroller is designed. The microcontroller smoothly processes the weighing data and transmits it to the data storage module and display, supporting communication with third-party devices. Serial port connection enables automated data recording and management.
It improves data accuracy and work efficiency, reduces manual recording errors, and realizes automated management and real-time transmission of data. It is suitable for daily experimental arrangements in schools and scientific research institutes.
Smart Images

Figure CN118548969A
Abstract
Description
Technical Field
[0001] The invention relates to an electronic scale for recording readings and a weighing method, in particular to the technical field of electronic scale reading processing. Background Art
[0002] Electronic scales are widely used in industry, commerce and home to weigh various items. Traditional electronic scales usually only display the weighing results, and users need to record the data manually. This method is not only time-consuming, but also prone to errors, especially when a large amount of data needs to be recorded. The manual recording process not only consumes human resources, but may also lead to problems with data accuracy and consistency. With the increase in data processing needs, users are in urgent need of an electronic scale that can automatically record weighing data to improve work efficiency and data accuracy.
[0003] In the prior art, some electronic scales also have data storage functions, but their data storage is often limited to the internal device, and users still need to manually export data to a computer or other device for processing. Although this method is better than completely manual recording, it still has many inconveniences and cannot meet the needs of modern data processing. Summary of the invention
[0004] The invention provides an electronic scale for recording readings and a weighing method, which solves the problem in the prior art that manual recording of a large amount of data is cumbersome and prone to errors.
[0005] In order to solve the above technical problems, the present invention provides an electronic scale for recording readings, comprising:
[0006] The OLED display screen, weighing sensor, data storage module and digital display screen are connected to the microcontroller respectively.
[0007] The display screen is used to display the serial port connection status and weight data of the microcontroller, and the serial port connection status is used to understand whether a third-party device is connected, the connection signal and the transmission speed;
[0008] The weighing sensor is used to obtain the weight data of the object.
[0009] The data storage module is used to store the weight data transmitted by the microcontroller.
[0010] The digital display screen is used to display the weight data of the item.
[0011] After receiving the weight data from the weighing sensor, the microcontroller performs smoothing processing on the weight data, and transmits the processed weight data to the data storage module for storage and to the display screen and the digital display screen for display.
[0012] Furthermore, the weighing sensor and the microcontroller are sequentially connected to a differential amplifier, a filter circuit module and an ADC module;
[0013] The differential amplifier is used to amplify the analog signal of the weight data of the item obtained by the weighing sensor; the bandwidth of the differential amplifier is 1, 10MHz, the slew rate is 35V / us, and the gain range is 2-10000 times;
[0014] The filtering circuit module is used to filter the analog signal of the weight data;
[0015] The ADC module is used to convert the analog signal of weight data into a digital signal.
[0016] Furthermore, the data storage module is connected to a microcontroller for recording weight data after weighing, and the microcontroller is connected to a power module via a power switch for controlling access to the power module.
[0017] Furthermore, the microcontroller is also connected to the third-party device through the communication module through the serial port. The microcontroller calls the weight data stored in the data storage module and sends it to the third-party device through the serial port for storage, reading and writing. The third-party device can also transmit the written weight data back to the display screen for display.
[0018] Furthermore, the microcontroller is also connected to three buttons, including: a confirmation button, an on / off button and a peel button.
[0019] The confirmation button is used to confirm the currently measured weight data and store it in the data storage module.
[0020] The power key turns the electronic scale from off state to on state.
[0021] The Tare key removes the weight of the "massless" weighing item on the scale pan.
[0022] In a second aspect, the present invention provides a weighing method of an electronic scale based on the above-mentioned recorded readings, comprising the following steps:
[0023] Check whether all components of the electronic scale are normal, and connect the power supply to ensure that the electronic scale is powered on normally;
[0024] Start and initialize the electronic scale, turn on the Bluetooth or WiFi function on the external third-party device, search for and connect to the communication module of the electronic scale, so that the external third-party device can recognize the electronic scale;
[0025] After the weighing sensor is calibrated, the object to be measured is placed on the weighing platform of the electronic scale for weighing. After signal amplification, filtering, and digital-to-analog conversion, the microcontroller smoothes the data and outputs the value of the smoothed weight data to the digital display screen for display. After the value is stable, the confirmation key is used to confirm, and the value of the weight data is transmitted to the data storage module for storage;
[0026] The confirmed weight data is transmitted to the third-party device through the communication module, so that the weight data of the object to be measured is recorded in the Excel file of the third-party device;
[0027] The third-party device establishes a corresponding database based on the received weight data of the object to be tested, saves the corresponding weight data in the local database according to the timeline, and transmits the Excel table recording the weight data of the object to be tested to the display screen for display.
[0028] Further, the starting and initializing the electronic scale includes:
[0029] The microcontroller calls the system clock, GPIO module, USART module and ADC module functions and sets the ADC module sampling channel to complete the startup and initialization of the electronic scale, including:
[0030] The microcontroller calls the HAL_Init() function to initialize the HAL library;
[0031] The microcontroller calls the SystemClock_Config() function to configure the system clock;
[0032] The microcontroller calls the MX_GPIO_Init() function to initialize the GPIO module;
[0033] The microcontroller calls the MX_USART2_UART_Init() function to initialize the USART module;
[0034] The microcontroller calls the MX_ADC1_Init() function to initialize the ADC module.
[0035] Furthermore, the microcontroller performs program filtering on the data, and outputs the numerical value of the weight data after program filtering to a digital display screen for display, including:
[0036] The microcontroller starts the ADC module by calling the HAL_ADC_Start() function in the HAL library, and calls the HAL_ADC_PollForConversion() function in the HAL library to wait for the ADC module to convert the analog signal of the weight data of the object to be measured, and then calls the HAL_ADC_GetValue() function in the HAL library to obtain the ADC value of the weight data of the object to be measured. ;
[0037] in: is the t-th test weight data of the i-th item to be tested, t≥2;
[0038] To obtain Processing, setting the initial state estimate and the error covariance matrix To simplify the initial conditions and facilitate recursive operations, as the iterative process is updated, the initial state is gradually corrected by the new measurement value, thus converging to the true state;
[0039] Set the state transfer equation f() and measurement equation h() according to the current state:
[0040]
[0041]
[0042] in, is the weight data of the i-th item to be tested at time t+1, is the error covariance matrix of the i-th item to be tested at time t, W i is the process noise, V i is the measurement noise;
[0043] Based on the current state at time t, predict the state at the next time t+1.
[0044]
[0045]
[0046] Among them, F t is the Jacobian matrix of the state transfer equation f(), represents the state prediction of the weight data of the i-th object to be tested at time t+1, and is based on the state estimation at time t;
[0047] represents the state prediction of the error covariance matrix of the i-th object to be tested at time t+1, and is based on the state estimation at time t;
[0048] Then update the state to calculate the gain Kt :
[0049]
[0050] According to the predicted value X i Update the state estimate:
[0051]
[0052] Update the error covariance matrix:
[0053]
[0054] in: represents the state estimate at time t, combining the prediction and actual measurement at time t,
[0055] h is the measurement matrix of h(), which is usually the identity matrix;
[0056] According to the above steps Convert to estimate , and the estimated value The data is transported to the data storage module for storage and transmitted to the display screen and digital display screen for display.
[0057] Furthermore, the confirmed weight data is transmitted to the third-party device through the communication module so that the third-party device records the weight data of the object to be measured in the Excel file, including:
[0058] The microcontroller communicates with the third-party device through the communication module, encrypts the confirmed weight data using AES encryption, and sends it to the third-party device through UART;
[0059] Define a 16-byte AES key through a third-party device and use the decrypt_data function to decrypt the encrypted data into editable weight data;
[0060] By introducing the pandas.mysql database to configure parameters, the third-party device is connected to Excel and the database. Then an empty dateframe is created to store the decrypted weight data, and pd.excelWrite() is used to write the weight data. Finally, the corresponding weight data appears in the Excel table.
[0061] The present invention provides an electronic scale and weighing method for recording readings, which adopts the range of a high-precision weighing sensor, converts a weight signal into an electrical signal, and can be filtered by a microcontroller to improve its accuracy, thereby ensuring its precision and accuracy.
[0062] The weighing method of the present invention reduces the influence of various interference factors in the measurement process, such as environmental vibration, electronic noise, etc., which cause the measurement data to fluctuate and become unstable. By combining multiple measurements and predicting and updating according to the state of the system, these fluctuations are smoothed, providing a more stable weight estimate and improving the measurement accuracy.
[0063] The weighing method of the present invention can transmit the weighing data to the Excel data recording software on the external device in real time through the wireless communication module, thereby realizing the automatic recording and management of the data. The electronic balance has a high degree of intelligence, is stable and reliable, and has high precision. It can meet the daily experimental arrangements of schools, scientific research institutes, etc., has good development prospects, and can be promoted on a large scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A principle block diagram for the implementation of the present invention;
[0065] Figure 2 Schematic diagram of the process for implementing the present invention. DETAILED DESCRIPTION
[0066] Combine the following Figure 1 The present invention is described in detail so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0067] like Figure 1 An embodiment shown in the figure provides an electronic scale for recording readings, comprising: a display screen 1, a weighing sensor 2, a data storage module 4 and a digital display screen 6 respectively connected to a microcontroller 3; the display screen 1 is a 5-inch OLED touch screen, which is an integrated display screen; the microcontroller 3 used is STM32F103C8T6,
[0068] The display screen 1 is used to display the serial port connection status of the electronic scale and the final weighing result in real time and sort them in the weighing order for users to view;
[0069] The weighing sensor 2 is used to obtain the weight data of the item; the high-precision weighing sensor 2 is located at the geometric center of the electronic scale, the range of the high-precision weighing sensor is 5kg, and it converts the weight signal into an electrical signal. The surface material of the electronic balance is aluminum alloy, and the surface of the electronic scale working area is a square area of 100mm*100mm;
[0070] The weighing sensor 2 and the microcontroller 3 are electrically connected to a differential amplifier 10, a filter circuit module 11, and an ADC module 12 in sequence; the differential amplifier 10 is used to amplify the analog signal of the weight data of the item obtained by the weighing sensor 2; the bandwidth of the differential amplifier 10 is 1, 10MHz, the slew rate is 35V / us, and the gain range is 2-10000 times; the filter circuit module 11 is used to filter the analog signal of the weight data; the ADC module 12 is used to convert the analog signal of the weight data into a digital signal; the microcontroller 3 is connected to the power module 9 through the power switch 7, which is used to control the access of the power module 9 to provide power for the entire system, and the microcontroller 3 completes the startup work by initializing its internal system clock, GPIO module, USAR module T and ADC module and starting the ADC module to set the sampling channel;
[0071] The power module 9 is a rechargeable lithium battery. In order to extend the use time, the electronic scale can be designed with a low power consumption mode, and will automatically enter a sleep state when not used for a long time.
[0072] The data storage module 4 is used to store the weight data transmitted by the microcontroller 3. The data storage module can be a built-in memory with a size of 1GB, which can effectively record the measured data content; the data storage module 4 is connected to external devices through the communication module 5, and the microcontroller 3, the data storage module 4 and the communication module 5 can be integrated in the PCB. The communication module 5 can be a Bluetooth module or a WiFi6 module, which greatly improves the reliability of its transmission. By confirming the weighed data and uploading the processed data to a third-party device through the wireless WiFi module, the electronic scale can be connected to the computer through a smart phone or a computer to receive and view the weighing data in real time. Its anti-interference, stability and transmission rate are all in a leading position.
[0073] The digital display screen 6 is used to record the weight data of the item and can be displayed intuitively; the digital display screen 6 is an LCD digital display screen with the characteristics of low energy consumption, high brightness, long life, etc., and can display 1 decimal place. There is a calculation icon on the left side of the display screen 1. The calculation icon flashes when weighing, and the icon stops flashing when the weighing is completed. Press the confirmation key to confirm the data and transmit it to Excel of the third-party device through the WiFi serial port.
[0074] The microcontroller 3 is also connected to three buttons 8, including a confirmation button, an on / off button and a tare button.
[0075] The confirmation key is used to confirm the current measurement data and store it in the data storage module 4. The power key turns the electronic scale from the off state to the on state. The tare key removes the weight of the "weightless" weighing object on the scale pan to ensure the accuracy of the weighing result.
[0076] Embodiment 2:
[0077] like Figure 2 An embodiment shown in the figure provides a weighing method of an electronic scale based on the above-mentioned recorded readings, comprising the following steps:
[0078] Check whether all components of the electronic scale are normal, and connect the power supply to ensure that the electronic scale is powered on normally;
[0079] Start and initialize the electronic scale. The microcontroller calls the HAL_Init() function to initialize the HAL library; the microcontroller calls the SystemClock_Config() function to configure the system clock; the microcontroller calls the MX_GPIO_Init() function to initialize the GPIO module; the microcontroller calls the MX_USART2_UART_Init() function to initialize the USART module; the microcontroller calls the MX_ADC1_Init() function to initialize the ADC module;
[0080] Turn on the Bluetooth or WiFi function on the external third-party device, search for and connect to the communication module of the electronic scale, so that the external third-party device can recognize the electronic scale;
[0081] Calibrate the load cell, which usually involves placing a standard weight and adjusting the calibration parameters of the microcontroller so that the weight reading on the display is consistent with the weight of the standard weight;
[0082] After calibration, the object to be tested is placed on the weighing platform of the electronic scale. After signal amplification, filtering, and digital-to-analog conversion, the microcontroller performs smoothing processing.
[0083] The smoothing process specifically includes:
[0084] The microcontroller starts the ADC module by calling the HAL_ADC_Start() function in the HAL library, and calls the HAL_ADC_PollForConversion() function in the HAL library to wait for the ADC module to convert the analog signal of the weight data of the object to be measured, and then calls the HAL_ADC_GetValue() function in the HAL library to obtain the ADC value of the weight data of the object to be measured. ;
[0085] in: is the t-th test weight data of the i-th item to be tested, t≥2;
[0086] To obtain Processing, setting the initial state estimate and the error covariance matrix To simplify the initial conditions and facilitate recursive operations, as the iterative process is updated, the initial state is gradually corrected by the new measurement value, thus converging to the true state;
[0087] Set the state transfer equation f() and measurement equation h() according to the current state:
[0088]
[0089]
[0090] in, is the weight data of the i-th item to be tested at time t+1, is the error covariance matrix of the i-th item to be tested at time t, W i is the process noise, V i is the measurement noise;
[0091] In this process, the state is the true weight of the weighed object and the random noise introduced during the measurement process, and the state at time t is the true weight of the object at the tth measurement plus the measurement error;
[0092] Based on the current state at time t, predict the state at the next time t+1.
[0093]
[0094]
[0095] Among them, F t is the Jacobian matrix of the state transfer equation f(), represents the state prediction of the weight data of the i-th object to be tested at time t+1, and is based on the state estimation at time t;
[0096] represents the state prediction of the error covariance matrix of the i-th object to be tested at time t+1, and is based on the state estimation at time t;
[0097] The state estimate is a value estimated by filtering, which gradually approaches the true value after multiple measurements and updates;
[0098] Then update the state to calculate the gain K t , which is used to balance the weights between the predicted values and the measured values, so as to obtain the most appropriate state estimate in the updated state:
[0099]
[0100] According to the predicted value Update the state estimate:
[0101]
[0102] Update the error covariance matrix:
[0103]
[0104] in: represents the state estimate at time t, combining the prediction and actual measurement at time t,
[0105] h is the measurement matrix of h(), which is usually the identity matrix;
[0106] According to the above steps Convert to estimate , and the estimated value The data is transmitted to the data storage module for storage and to the display screen and digital display screen for display, which minimizes the influence of various interference factors during the measurement process, such as environmental vibration, electronic noise, etc. These interferences cause the measurement data to fluctuate and become unstable. By combining multiple measurements and predicting and updating according to the system status, these fluctuations are smoothed, providing a more stable weight estimate, improving measurement accuracy, and better coping with different measurement conditions;
[0107] The confirmed weight data is transmitted to the third-party device through the communication module, so that the weight data of the object to be measured is recorded in the Excel of the third-party device, including:
[0108] The microcontroller communicates with the third-party device through the communication module, encrypts the confirmed weight data using AES encryption, and sends it to the third-party device through UART;
[0109] A 16-byte AES key is defined through a third-party device, and the decrypt_data function is used to decrypt the encrypted data into editable weight data. The pandas.mysql database is introduced to configure the parameters so that the third-party device can access Excel and the database. Then an empty dateframe is created to store the decrypted weight data, and pd.excelWrite() is used to write the weight data. Finally, the corresponding weight data appears in the Excel table.
[0110] This embodiment can also sort the data, arrange it by value from small to large, and display its corresponding data number, by using the mysql.connector.connect function to connect to the MySQL database, and the connection parameters include the host, user name, password and database name; use openpyxl.chart.LineChart to create a new line chart, and set the title, style and axis labels of the chart; use the ws.add_chart function to add the chart to the specified position of the worksheet; use the ws.add_chart function to add the chart to the specified position of the worksheet; finally use the wb.save function to save the workbook to the specified Excel file.
[0111] The working principle of the present invention is as follows: when an object is placed on a high-precision weighing sensor 2, pressure is generated on the high-precision weighing sensor, causing its strain to change and causing a change in resistance, thereby generating an analog signal, which is amplified by a signal differential amplifier 10 to reach a level that the circuit can handle, and its data is accurately obtained by a filtering circuit module 11; it is converted into a digital signal by an AD digital-to-analog conversion module 12, and the microcontroller 3 receives the data after program filtering and smoothing, and displays it on a digital display screen 6, and the final reading is confirmed by a confirmation button 8 so that it is recorded in a data storage module 4 and displayed on a display screen 1.
[0112] The electronic balance of the present invention has a high degree of intelligence, is stable and reliable, and has high precision, can meet the test arrangements of daily schools, scientific research institutes, etc., has good development prospects, and can be promoted on a large scale.
[0113] The weighing method of the present invention reduces the influence of various interference factors in the measurement process, such as environmental vibration, electronic noise, etc., which cause the measurement data to fluctuate and become unstable. By combining multiple measurements and predicting and updating according to the state of the system, these fluctuations are smoothed, providing a more stable weight estimate and improving the measurement accuracy.
[0114] The above is a practical implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be thought of by any technician familiar with the field within the scope of the disclosure disclosed by the present invention without creative work should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope defined in the claims.
Claims
1. An electronic scale for recording readings, characterized in that: include: The OLED display, weighing sensor, data storage module and digital display screen are connected to the microcontroller respectively. The display screen is used to display the serial port connection status and weight data of the microcontroller; The weighing sensor is used to obtain the weight data of the item. The data storage module is used to store the weight data transmitted by the microcontroller. The digital display screen is used to display the weight data of the item. After receiving the weight data from the weighing sensor, the microcontroller performs smoothing processing on the weight data, and transmits the processed weight data to the data storage module for storage and to the digital display screen and display screen for display.
2. The electronic scale for recording readings according to claim 1, characterized in that: The weighing sensor and the microcontroller are connected in sequence to a differential amplifier, a filter circuit module and an ADC module; The differential amplifier is used to amplify the analog signal of the weight data of the item obtained by the weighing sensor; The filtering circuit module is used to filter the analog signal of the weight data; The ADC module is used to convert the analog signal of weight data into a digital signal.
3. The electronic scale for recording readings according to claim 1, characterized in that: The data storage module is connected to the microcontroller for recording the weight data after weighing. The microcontroller is connected to the power module via a power switch for controlling the access of the power module.
4. The electronic scale for recording readings according to claim 1, characterized in that: The microcontroller is also connected to a third-party device via a serial port through a communication module. The microcontroller calls the weight data stored in the data storage module and sends it to the third-party device via the serial port for storage, reading and writing. The third-party device transmits the written weight data back to the display screen for display.
5. The electronic scale for recording readings according to claim 1, characterized in that: The microcontroller is also connected to three buttons, including a confirmation button, an on / off button and a tare button. The confirmation button is used to confirm the currently measured weight data and store it in the data storage module. The power key turns the electronic scale from off state to on state. The Tare key removes the weight of the "massless" weighing item on the scale pan.
6. A weighing method based on the electronic scale for recording readings according to any one of claims 1 to 5, characterized in that: The following steps are involved: Start and initialize the electronic scale, turn on the Bluetooth or WiFi function on the external third-party device, search for and connect to the communication module of the electronic scale, so that the external third-party device can recognize the electronic scale; After the weighing sensor is calibrated, the object to be measured is placed on the weighing platform of the electronic scale for weighing. After signal amplification, filtering, and digital-to-analog conversion, the microcontroller smoothes the data and outputs the smoothed weight data value to the digital display screen for display. After the value stabilizes, it is confirmed using the confirmation button and the weight data value is transmitted to the data storage module for storage. The confirmed weight data is transmitted to the third-party device through the communication module, so that the weight data of the measured object is recorded in the Excel file of the third-party device; The third-party device establishes a corresponding database based on the received weight data of the items to be measured, saves the corresponding weight data in the local database according to the timeline, and transmits the Excel table recording the weight data of the items to be measured to the display screen for display.
7. A weighing method according to claim 6, characterized in that: The starting and initializing of the electronic scale includes: The microcontroller calls the HAL_Init() function to initialize the HAL library; The microcontroller calls the SystemClock_Config() function to configure the system clock; The microcontroller calls the MX_GPIO_Init() function to initialize the GPIO module; The microcontroller calls the MX_USART2_UART_Init() function to initialize the USART module; The microcontroller calls the MX_ADC1_Init() function to initialize the ADC module.
8. A weighing method according to claim 6, characterized in that: The microcontroller performs smoothing processing on the data and outputs the numerical value of the smoothed weight data to the digital display screen for display, including: The microcontroller starts the ADC module by calling the HAL_ADC_Start() function in the HAL library, and calls the HAL_ADC_PollForConversion() function in the HAL library to wait for the ADC module to convert the analog signal of the weight data of the object to be measured, and then calls the HAL_ADC_GetValue() function in the HAL library to obtain the ADC value of the weight data of the object to be measured. ; in: The test weight data of the i-th item to be tested at time t, t≥2; According to the current state at time t, the state transfer equation f() and measurement equation h() are set: ; ; in, is the weight data of the i-th item to be tested at time t+1, is the error covariance matrix of the i-th item to be tested at time t, W i is the process noise, V i is the measurement noise; Based on the current state at time t, predict the state at the next time t+1. ; ; Among them, F t is the Jacobian matrix of the state transfer equation f(), represents the state prediction of the weight data of the i-th item to be tested at time t+1, and is based on the state estimation at time t; represents the state prediction of the error covariance matrix of the i-th object to be tested at time t+1, and is based on the state estimation at time t; Then update the state to calculate the gain K t : ; According to X i Update the state estimate: ; Update the error covariance matrix: ; in: represents the state estimate at time t, combining the prediction and actual measurement at time t, h is the measurement matrix of h(); According to the above steps Convert to estimated value , and the estimated value The data is transported to the data storage module for storage and transmitted to the display screen and digital display screen for display.
9. A weighing method according to claim 6, characterized in that: The confirmed weight data is transmitted to the third-party device through the communication module so that the third-party device records the weight data of the item to be measured in Excel, including: The microcontroller encrypts the confirmed weight data using AES encryption and sends it to the third-party device through the communication module; Define a 16-byte AES key through a third-party device and use the decrypt_data function to decrypt the encrypted data into editable weight data; The pandas.mysql database is introduced to configure parameters so that the third-party device can access Excel and the database. Then an empty dateframe is created to store the decrypted weight data, and pd.excelWrite() is used to write the weight data. Finally, the corresponding weight data appears in the Excel table.
