Homemade bidirectional reversible length measuring device for rubber tubes
Source: InternetPublisher:Lemontree Keywords: MCU LED Updated: 2024/10/12
1. Working Principle
The circuit of this device is shown in the figure below. The main control chip uses AT89C2051, and its I/O port can absorb 20mA of current. It can be directly connected to the a~g ends of the quadruple common anode digital tube without a driving circuit. LED1 and LED2 are infrared light-emitting diodes, and T1, T2 are silicon photosensitive triodes. When installing, LED1 and T1, LED2 and T2 should be installed in pairs respectively. The light-emitting surface of LED1 and LED2 should face the light-receiving surface of T1, T2, and there should be a spacing of 10mm~15mm between the light-emitting tube and the photosensitive tube so that the code disk can pass through the middle. The shape of the code disk is shown in Figure 2. When making, a fan-shaped hole can be opened on the opaque disc. Figure 2 also shows the installation position of T1 and T2, which are coaxially installed with the code disk on the same code wheel with a circumference of 1 meter. When measuring the length, the conveyor belt contacts the code wheel, driving the code wheel and the code disk to rotate clockwise, and T1 is blocked first. Point A changes from low level to high level. After being inverted and shaped by IC1, P33 changes from high level to low level. Then T2 is blocked, and P31 changes from high level to low level. After the single-chip microcomputer detects this change, it starts the addition program to increase the current count value by 1 and displays it on the digital tube. In this way, the current value automatically increases by 1 when the code wheel rotates one circle. Since the conveyor belt just advances 1 meter when the code wheel rotates one circle, the current value displayed on the digital tube is the length of the conveyor belt, thereby achieving the purpose of measuring the length. When the conveyor belt needs to retreat due to various reasons, the code wheel is driven to reverse (rotate counterclockwise), and T2 is blocked before T1. After the single-chip microcomputer detects this change, it starts the subtraction program to reduce the current count value by 1 and displays it on the digital tube. This ensures that the length displayed on the digital tube is always equal to the length of the conveyor belt entering the packaging machine. The display range is -999~+999. In Figure 1, AN1 is the reset key. It is generally not used. AN2 is the clear key. When you need to clear the current value, just press AN2. Generally, it is necessary to reset the value once at the beginning of each conveyor belt. The method and principle of measuring the hose are the same as those of the conveyor belt.
2. Software Design
This device adopts modular programming. The timer T0 interrupt is used to scan and display the digital tube: the external interrupt INT1 is used to determine whether the conveyor belt or hose is moving forward or backward, so as to call the addition or subtraction program for counting. The system has strong anti-interference ability. The whole program consists of initialization program, display program, interrupt program, addition program, subtraction program, binary-to-decimal conversion program, delay program, etc.
3. Other issues
The device has no special requirements for the size of the code disc when it is made. When programming, in order to pursue the simplicity of the program and the rapid response, no unit conversion, magnification correction and other contents are added. Therefore, it is necessary to ensure that the circumference of the code wheel in contact with the conveyor belt or hose is exactly 1 meter. The accuracy of the circumference will directly affect the accuracy of the measurement. In use, due to different working locations, the code wheel with a circumference of 1 meter may sometimes appear too large. At this time, the code disc shown in Figure 3 can be used, that is, 10 fan-shaped holes are symmetrically opened on an opaque disc. The circumference of the code wheel connected to it is 0.1 meter. When working, the last digit of the digital tube display value is a decimal, and the maximum measurement length is 99.9 meters, which is sufficient for general applications. When making, the code disc and the code wheel can also be combined into one. To reduce the difficulty of making. In addition to being suitable for the rubber hose and belt industry, this device can also be widely used in plastics, cables, textiles, food and other occasions where length measurement and counting are required.
- Hardware interface circuit between CH375 and single chip microcomputer
- How to make a numeric keyboard using XIAO RP2040
- How to use ESP8266 to make a mini fully functional clock
- How to make a super solar tracker using ESP8266
- Make a capacitive soil moisture sensor using ESP32
- Serial debugger circuit implemented with several discrete components
- p4 478 chip pin distribution diagram
- ID card attendance machine circuit
- Interface circuit between digital measuring tool and 51 microcontroller
- Communication conversion circuit diagram of RS232 and RS485
- MAX8630Y/ MAX8630Z driving white LED circuit diagram
- Circuit diagram of a high-brightness and energy-saving LED lamp cup
- Op amp driving LEDs
- LED backlight driver module design circuit
- Three-phase phase loss alarm light circuit
- Working principle of single touch mode light switch
- CdS photoresistor as electronic photometric element circuit diagram
- 3W high power LED drive circuit diagram
- Power outage sound and light alarm circuit
- Digital camera flash control circuit