Comprehensive moisture tester for cotton, rapeseed and grain based on HMS87C1408B

Publisher:mancozcLatest update time:2012-07-13 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

When purchasing seed cotton, rapeseed and grain, it is usually necessary to test their moisture content or regain to assess their grade. There are two ways to measure moisture content: the oven method and the impedance method. Although the oven method has good accuracy, it is time-consuming and not suitable for real-time measurement. The seed cotton, rapeseed and grain moisture comprehensive tester introduced in this article uses the method of measuring impedance or conductivity to obtain the moisture content of the object being measured. That is, two electrodes with a fixed distance are inserted into the object being measured, and the impedance between the two electrodes is converted into voltage. Then the moisture content of the object being measured can be obtained by looking up the table, and the result is displayed on the LCD screen after a series of processing such as temperature compensation. The seed cotton, rapeseed and grain moisture comprehensive tester uses HMS87C1408B as the main control chip, external impedance converter and voice circuit , which can test the moisture or regain of seed cotton, rapeseed and grain (including rice, corn, wheat) in real time, and provide full voice prompts and voice reporting.

2 Features of HMS87C1408B

The main parameters and performance of HMS87C1408B are as follows:

8KB OTPROM, 192 bytes on-chip RAM (including stack);

At 8 MHz, the instruction cycle is O.25 μs;

Working voltage 2.5 V ~ 5.5 V;

8-bit bidirectional multifunctional I/O port, can directly drive LED;

8-channel 8-bit A/D converter ;

1 8-bit time interval timer;

4 8-bit timer/counters;

2 10-bit high-speed PWM ;

Watchdog timer;

1 8-bit SPI serial interface;

12 interrupt sources;

1 programmable buzzer drive port;

Support power saving mode ST OP ;

Optional RC oscillator.

The four timers/counters of HMS87C1408B can not only be used as four 8-bit timers/counters, but also can be made to work in seven other timing modes by setting the relevant bits of the timing mode registers TM0, TM1, TM2, and TM3. For T0 and T1, there are:

8-bit counter and 8-bit capture mode; 8-bit capture mode and 8-bit comparison output mode; 8-bit timer/counter and 10-bit PWM mode; 16-bit timer mode; 16-bit counter generation; 16-bit capture mode; 16-bit comparison output mode. The T2 and T3 timer/counters can also be combined into the above 7 working modes.

In addition to the four timers T0, T1, T2, and T3, HMS87C1408B also has a time interval timer BITR, which will keep running and cannot be stopped as long as it is powered on. Its clock source can be an RC oscillator or a signal divided by a preset frequency division coefficient. As long as the BTCL bit in the CKCTLR register is set to 1, BITR can be cleared and counted up again. When the count reaches FF and overflows, a BIT interrupt is generated. It can be used as an on-chip wake-up timer in STOP mode, as a watchdog timer, or as other timers.

The 12 interrupts of HMS87C1408B are 4 external interrupts, 4 timer interrupts, ADC interrupt, WDT interrupt, BIT interrupt and SPI interrupt. These interrupts have their own priorities and interrupts can be nested.

The buzzer output function of HMS87C1408B allows users to select a passive buzzer. By setting the RBFUN and BUR registers, the RBl pin outputs an alternating square wave to drive the buzzer. The frequency of the square wave f=fxin/(2x frequency division coefficient×(BUR+1)), and the frequency division coefficient and BUR value are determined by the BUR register.

In addition to the watchdog circuit on the chip, the on-chip power drop detection (PFD) circuit is a unique feature of the HMS87C1408B. By properly setting the PFDR register, if the Vdd voltage drops to 2.5 V to 3.5 V, or lasts for more than 50 ms within the range of 2.0 V to 3.0 V, the power drop detection circuit resets the MCU. The drop level is determined by the PFD bit of the CONFIG register during OTP programming. This feature improves the anti-interference and anti-crash capabilities of the HMS87C1404.

The instruction system of HMS87C1408B is similar to that of Motorola, with a total of 202 instructions. The instruction system is extremely versatile and easy to use. It not only includes multiplication and division instructions, but also has 7 16-bit operation comparison instructions (ADDW dp, CMPW dp, DECW dp, INCW dp, LDYA dp, STYAdD, SUBW dp). It greatly simplifies some complex and multi-byte operations and operation programming, and improves programming efficiency.

3 System Design of Comprehensive Tester

The system block diagram of the comprehensive moisture tester for seed cotton, rapeseed and grain is shown in Figure 1.

System block diagram of comprehensive tester [page]

The impedance converter converts the impedance between the two electrodes into voltage and sends it to HMS87C1408B for A/D conversion. HMS87C-1408B processes the converted value and sends it to LCD display, and the voice circuit outputs the reporting information or over-limit prompt. Since the tester often needs to be operated outdoors in the sun and in the evening, the automatic backlight control circuit can be used to automatically adjust the brightness of the LCD display. The automatic backlight senses the light intensity of the external environment through the photoresistor and converts it into a voltage to directly control the current of the backlight source to achieve automatic backlight control. The buttons are used to set the type or variety of the object to be tested, select the voice prompt or voice reporting method, the over-limit threshold, the value that needs to be corrected due to temperature changes, and display the average value through the buttons, etc. The power supply circuit is used to convert the 6 V battery voltage into a 3.9 V system power supply. When the battery voltage drops to 4.5 V, the low voltage detection circuit detects and provides a level conversion signal to the main control chip, and the main control chip broadcasts the "Please change the battery" voice through the voice circuit.

Impedance Converter

4 Impedance Transformer

The impedance converter circuit is an important circuit in this system. Its performance is related to the accuracy of the test data and the effective range of the test data. This system selects a single-power supply, low-drift, high-impedance operational amplifier TLC27L2B combined with peripheral resistors to form an impedance converter circuit. The input impedance of TLC27L2B is as high as 1012 Ω, while the impedance range of the measured cotton, rapeseed and grain (including rice, corn, wheat) is from several hundred KΩ to 10 GΩ. Therefore, TLC27L2B is suitable for use as an impedance converter, and its power consumption is extremely low. The impedance converter circuit is shown in Figure 2. It is actually a voltage follower circuit. The voltage follower has the characteristics of high impedance input and low impedance output, and its gain is:
formula

Rc and Rd are the differential input resistance and common-mode input resistance of 运放\'); companyAdEvent.show(this,\'companyAdDiv\',[5,18])"> the op amp respectively ; K is the open-loop gain of the op amp.

Output voltage :
formula

Rm is the measured impedance. When the electronic switch Kd is closed, R12=R1//R2. When Kd is open, R12=R1. Kd is used to adjust the range of the measured impedance. When R1 is selected as 30 MΩ, the measured impedance can be as high as 10 GΩ. Usc is sent to the main control chip for A/D conversion after voltage division to obtain the water content.

5 Software driven LCD

The integrated tester requires low cost and small size. This system directly drives the LCD from the main control chip through software, eliminating the LCD driver chip. Since the LCD must be driven by AC, it is necessary to generate alternating positive and reverse drive voltages on each segment of the LCD. The LCD of the integrated tester has a three-digit display, with a total of 8x3=24 display segments. It is configured as 4 com and 6 seg for dynamic scanning.

Figure 3 uses the inputs of coml and segl, com2 and segl to illustrate whether the corresponding display segments are displayed. If you want the display segments corresponding to coml and segl to light up, and the display segments corresponding to com2 and segl to go out, coml and segl should have opposite output levels, and vice versa, com2 and segl should have the same output level. The synthesized waveform is shown in the third row of Figure 3. The threshold of the LCD display should be set slightly larger than Vdd/2 to reduce or eliminate possible ghosting. The com port l/2 level is generated by the main control chip setting the I/O port as an input port, and is divided by the external pull-up and pull-down resistors.

coml and segl

6 Voice Circuit

The comprehensive tester for moisture content of seed cotton, rapeseed and grain provides full voice prompts and voice reporting. AP8842 with 32-segment voice storage capacity is selected for voice reporting. Since there are many voices to be broadcast, all the voices to be broadcast must be decomposed into 32 independent voice segments and stored in the AP8842 voice circuit. When broadcasting is needed, the relevant voice segments are connected one by one to form sentences. For example: "Seed cotton", "water content", "two", "ten", "one", "point", "five" are synthesized by 7 independent voice segments. In this way, the sentences that can be broadcasted are much more than 32 sentences.

The call of a certain voice segment of the AP8842 voice circuit is realized through a 5-bit address (S1~S5) line and a STB line. When the 5-bit address line output is stable, when STB jumps from low to high, the voice segment signal corresponding to the 5-bit address is amplified and sent to the speaker for broadcast through the COUT pin output. When this voice segment is broadcast, if necessary, another 5-bit address and a STB are output to broadcast the next voice segment. The corresponding relationship between the input call and the output waveform is shown in Figure 4.

Correspondence between input call and output waveform

7 Conclusion

The comprehensive moisture tester for seed cotton, rapeseed and grain uses HMS87C1408B as the main control chip. After A/D conversion and related processing of the voltage signal output by the impedance converter, the moisture content is displayed on the LCD, and the corresponding information is broadcast through the voice circuit. Its moisture content is accurate to 0.1%, the performance is stable, the repeatability is good, and there are many varieties that can be tested, which is popular among users.

Reference address:Comprehensive moisture tester for cotton, rapeseed and grain based on HMS87C1408B

Previous article:Development of Calibration Device for Integrated Operational Amplifier Parameter Tester
Next article:Design of human skin measuring instrument based on DSP

Recommended ReadingLatest update time:2024-11-16 15:35

W806+ST7735R+tftLCD program development
**This article uses the following environment: Computer: WIN10 Development board: W80X (w806 w801 w800 air101 air 103) Platform: CDK Display: openmv 1.8-inch SPI display 128X160 (st7735r, program compatible with st7735s) Display screen information: https://openmv.io/products/lcd-shield (128 RMB, I don’t understand w
[Microcontroller]
W806+ST7735R+tftLCD program development
Low-level driver for segment LCD display
This task uses Ruisai MCU R7C004 to drive customized segment LCD, 4COM, 18seg, 1/3 bias. Since the MCU itself has segment LCD driver, its working process and control method can be known according to the data sheet. The process consists of two steps: 1. Configure the hardware driver register. 2. According to the spec
[Microcontroller]
Nuvoton M051 drives LCD12864 LCD screen program
Share a C language program for the Xintang M051 microcontroller to drive the LCD12864 LCD screen with font library:  #include "SmartM_M0.h"   #define LCD12864_RS_PIN   0 #define LCD12864_RW_PIN   1 #define LCD12864_EN_PIN   2 #define LCD12864_MD_PIN   3   #define LCD12864_RS(x)     {if((x))P0_DOUT|=  1
[Microcontroller]
ATMEGA16 four-line driver LCD display time-DS1302
#include #include macros.h #define uchar unsigned char #define uint unsigned int //Define the port application of LCD1602 #define RS_CLI PORTB&=~BIT(PB1) #define RS_SEI PORTB|=BIT(PB1) #define RW_CLI PORTB&=~BIT(PB2) #define RW_SEI PORTB|=BIT(PB2) #define EN_CLI PORTB&=~BIT(PB3) #define EN_SEI PORTB|=BIT(
[Microcontroller]
The world's first LCD screen fingerprint solution is released! Expected to be launched in 2020
As we all know, with the maturity of under-screen fingerprint technology, the threshold for use must have dropped a lot, and it has become a standard feature of mainstream mobile phones today. However, careful friends can find that most of the under-screen fingerprint solutions in the industry are optical under-screen
[Mobile phone portable]
The world's first LCD screen fingerprint solution is released! Expected to be launched in 2020
Understand LCD1602 liquid crystal display module in 10 minutes
1. Introduction to LCD1602 Liquid Crystal Module What does LCD1602 mean? LCD stands for Liquid Crystal Display, and 1602 means that 16 characters can be displayed in one line, and there are two lines in total. The actual picture is as follows: 2. Thinking Analysis LCD1602 is a display module, and its main function
[Microcontroller]
Understand LCD1602 liquid crystal display module in 10 minutes
1602LCD liquid crystal reverse display program based on 51 single chip microcomputer
/*1602LCD demonstration program*/ /*MCU model: AT89S51*/ /*Crystal: 11.0592MHZ*/ /*Author: http://www.51hei.com */ /*Compilation environment: Keil 7.50A*/ /****Include header file*****/ #include reg51.h #include intrins.h /******************Port definition can be modified accor
[Microcontroller]
Display the light intensity value on LCD1602 based on MSP430F149 and BH1750FVI
BH1750FVI is a digital light intensity sensor integrated circuit based on IIC bus protocol. The following is its program: #include "io430x14x.h" typedef unsigned int uint; typedef unsigned char uchar; #define SCL_H P3OUT |= BIT6 //This IO needs to be changed on the hardware #define SCL_L P3OUT &= ~BIT6 #define
[Microcontroller]
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号