当前位置:网站首页>Design and manufacture of simple digital display electronic scale
Design and manufacture of simple digital display electronic scale
2022-07-01 09:08:00 【FmixZA】
Course design of sensor and detection technology 【 Case study 1】—— Design and manufacture of simple digital display electronic scale
List of articles
Mission objectives
Weighing technology is widely used in industry , Agriculture , traffic , Important technologies in the fields of trade and scientific research , And social development 、 Industrial production is closely related to people's life , Electronic scales belong to electronic scales , The level of technology , It directly affects the quality of production and life and the development of economic benefits .
| Technical indicators | requirement |
|---|---|
| range | 0-10kg |
| The resolution of the | 1g |
| Maximum reference error | <0.1% |
| Absolute error | <5g |
The following is the main body of this article , Cases can be used for reference
One 、 Working principle of digital display electronic scale
The electronic scale adopts a single-chip microcomputer processing system , The measured signal is converted into an electrical signal by a load cell , After processing and analyzing the sampled signal , Realize weight signal acquisition and conversion , And the single-chip microcomputer system is used for calculation and analysis , Finally, display through the display device , Can achieve fast , Convenient weight information display .
The overall design scheme is shown in the figure below :
Two 、 Design of each module
1. Strain sensors
Sensor module is selected 10kg Range resistance strain type pressure sensor , Internal integrated Wheatstone bridge . The physical drawing and specific technical parameters are shown in the figure below .

The sensor sensitivity is 1mV/V, If the excitation voltage of the bridge is 10V, Then the voltage difference at full scale is 10mV, It is assumed that the voltage difference is linear with the force on the pressure sensor , Rate of change 1uV/g. The wiring between the sensor module and the signal processing circuit is as follows :

2. Signal processing circuit

The signal conditioning circuit can be roughly divided into bridge differential amplification 、 Follower 、 Reverse magnification 、 Low pass filtering four parts .OPA2333 Build bridge amplifier ,AAD227 Build a secondary amplifier .
| Schematic diagram | |
|---|---|
![]() | First, through differential amplification , The bridge difference is obtained by the differential connection method and amplified to a suitable value . Set the magnification according to the chip data manual, about 100 times |
![]() | Voltage follower can be used as isolator in circuit , It has the characteristics of high input impedance and low output impedance , It can prevent the front and rear circuits from interfering . Due to the characteristics of the chip , The input current shall not be greater than 20mA, Therefore, a in-phase terminal is connected in series 5kΩ resistance . This resistance has no effect on the magnification . |
![]() | Because the difference of the front bridge is negative voltage , The inverter needs to be connected to convert the voltage into a positive voltage that can be measured by the single chip microcomputer , At the same time, the differential amplifier circuit restricted by the amplifier performance can be further amplified to make the measurement range large enough . Amplification factor of inverting amplifier Au = - ( Rf / Rin ) |
Final magnification = (R2/(R1+350))(IN2-IN1)1(-R7/R6)≈300
3. SCM and AD sampling
The single-chip microcomputer is selected STM32F103C8T6 Minimum system board , Commonly used , Easy to write quickly .
Due to the need to collect uv Level signal , The chip comes with 12 position ad Not competent for the task , To write SPI signal communication 24 position AD modular ADS1256.
Driver reference -》ADS1256 drive
The main program code is as follows ( Example ):
#include "led.h"
#include "delay.h"
#include "sys.h"
#include "key.h"
#include "usart.h"
#include "exti.h"
#include "ADS1256.h"
#define Au 300.0
int KeyState = 0;
char str[15],str2[15];
void Delay(vu32 nCount)
{
for(; nCount != 0; nCount--);
}
// Timer 3 500ms An interruption
void TIM3_Int_Init(u16 arr,u16 psc)
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); // Clock enable
TIM_TimeBaseStructure.TIM_Period = arr; // Set the value of the auto reload register cycle for the next update event load activity Count to 5000 by 500ms
TIM_TimeBaseStructure.TIM_Prescaler =psc; // Set as TIMx Prescaled value of clock frequency divisor 10Khz The counting frequency of
TIM_TimeBaseStructure.TIM_ClockDivision = 0; // Set the clock split :TDTS = Tck_tim
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIM Upcount mode
TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); // according to TIM_TimeBaseInitStruct The parameter specified in TIMx Unit of time base
TIM_ITConfig( // To enable or disable specified TIM interrupt
TIM3, //TIM2
TIM_IT_Update ,
ENABLE // Can make
);
NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; //TIM3 interrupt
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; // Take precedence 0 level
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 3; // From the priority 3 level
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQ The channel is energized
NVIC_Init(&NVIC_InitStructure); // according to NVIC_InitStruct The parameter specified in NVIC register
TIM_Cmd(TIM3, ENABLE); // Can make TIMx peripherals
}
void TIM3_IRQHandler(void) //TIM3 interrupt
{
if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) // Check the specified TIM Whether the interruption occurs or not :TIM Interrupt source
{
TIM_ClearITPendingBit(TIM3, TIM_IT_Update ); // eliminate TIMx Interrupt pending bit of :TIM Interrupt source
printf(str);
}
}
int main(void)
{
long double vr,vout,vsum,v[50];
unsigned char i=0,j=0;
long ulResult;
long double ldVolutage;
delay_init(); // Delay function initialization
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);// Set interrupt priority group 2
uart_init(9600); // The serial port is initialized to 9600
LED_Init(); // Initialization and LED Connected hardware interface
LEDx=0; // Lighten up LED
EXTIX_Init(); // External interrupt initialization
printf("OK\r\n");
Init_ADS1256_GPIO(); // initialization ADS1256 GPIO Pin
Delay(0x1ffFF);
GPIO_SetBits(GPIOB, GPIO_Pin_11 );
ADS1256_Init();
TIM3_Int_Init(4999,7199);//10Khz The counting frequency of , Count to 5000 by 500ms
for(i = 0;i < 20;i++) v[i]=0;
while(1)
{
for(i = 0;i < 1;i++)
{
ulResult = ADS_sum( (i << 4) | ADS1256_MUXN_AINCOM);
//ulResult = ADS_sum( ADS1256_MUXP_AIN0 | ADS1256_MUXN_AINCOM);
if( ulResult & 0x800000 )
{
ulResult = ~(unsigned long)ulResult;
ulResult &= 0x7fffff;
ulResult += 1;
ulResult = -ulResult;
}
ldVolutage = (long double)ulResult*0.59604644775390625;
//printf(" The first %d passageway :",(i & 0x07)?(i & 0x07) - 1:7);
//sprintf(str,"%lf\r\n",ldVolutage); //double
//printf("uV\r");
//printf("%x",(unsigned long)ulResult);//16
Delay(0x3fFFF);
}
vsum = 0;
for(i = 1;i < 20;i++)
{
v[i] = v[i-1];
vsum += v[i];
vsum /= 2.0;
}
v[0] = ldVolutage;
vsum += v[0];
vsum /= 2.0;
if(j<20)
{
vr = vsum;
j++;
}
vout = (vsum - vr) / Au;///20.0;
sprintf(str,"%.0lf -> ",vsum);
sprintf(str2,"%.0lf g\r\n",vout);
}
}
//END
The filtering algorithm adopts continuous sampling 20 It's worth ( Small sample ) Averaging , The actual performance is good .
3、 ... and 、 Simulation and testing
1. Hardware simulation

The magnification of the scheme during simulation is 240, After that, the actual scheme is modified to 300
| Bridge output voltage (mv) | Corresponding object weight | Analog output voltage |
|---|---|---|
| 0.001 | 1g | 241.999uV |
| 0.01 | 10g | 2.402mV |
| 0.1 | 100g | 24.001mV |
| 1 | 1kg | 239.997V |
| 10 | 10kg | 2.4V |
2. Actual test
3. Improve and optimize
a) It can be considered to modify the scheme of three operational amplifiers to build differential instrument amplification .
b) The test accuracy is improved by fitting the actual test data .
……
summary
This paper simply introduces the design and manufacture of simple digital display electronic scale , It provides samples and cases for the follow-up of other teaching projects .
边栏推荐
- How to manage fixed assets efficiently in one stop?
- Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)
- 【ESP 保姆级教程 预告】疯狂Node.js服务器篇 ——案例:ESP8266 + MQ系列 + NodeJs本地服务 + MySql存储
- Nacos - 服务发现
- [ESP nanny level tutorial preview] crazy node JS server - Case: esp8266 + DS18B20 temperature sensor +nodejs local service + MySQL database
- FreeRTOS学习简易笔记
- Shell script case in statement
- It is designed with high bandwidth, which is almost processed into an open circuit?
- Nacos - gestion de la configuration
- Programming with C language: calculate with formula: e ≈ 1+1/1+ 1/2! …+ 1/n!, Accuracy is 10-6
猜你喜欢

2.3 【kaggle数据集 - dog breed 举例】数据预处理、重写Dataset、DataLoader读取数据

Redis -- lattice connects to redis cluster
![[interview brush 101] linked list](/img/52/d159bc66c0dbc44c1282a96cf6b2fd.png)
[interview brush 101] linked list

Reproduced Xray - cve-2017-7921 (unauthorized access by Hikvision)

2.4 激活函数
![[MFC development (16)] tree control](/img/b9/1de4330c0bd186cfe062b02478c058.png)
[MFC development (16)] tree control

Dynamic proxy

Ranking list of domestic databases in February, 2022: oceanbase regained the "three consecutive increases", and gaussdb is expected to achieve the largest increase this month

FAQ | FAQ for building applications for large screen devices

Bimianhongfu queren()
随机推荐
NiO zero copy
Flink面试题
Input标签的type设置为number,去掉上下箭头
Shell脚本-特殊变量:Shell $#、$*、[email protected]、$?、$$
如何做好固定资产管理?易点易动提供智能化方案
【pytorch】transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
【pytorch】softmax函数
2.4 激活函数
Jetson Nano 安装TensorFlow GPU及问题解决
序列化、监听、自定义注解
Shell脚本-echo命令 转义符
FreeRTOS学习简易笔记
Shell script case in and regular expressions
Shell脚本-while循环详解
jeecg 重启报40001
Shell script - string
Nacos - service discovery
Ranking list of domestic databases in February, 2022: oceanbase regained the "three consecutive increases", and gaussdb is expected to achieve the largest increase this month
Nacos - 服务发现
Installing Oracle EE


