- Home >> News >> Blog articles >> Internet of things
Intelligent Garbage Bin Hardware Program Design
With the improvement of living standards, people pay more and more attention to the surrounding environmental sanitation and pursue a healthy living environment. Nowadays, more and more attention is paid to the disposal of garbage, and with the advancement of technology, people also require more intelligent garbage cans. The area around the trash can has always been an area we stay away from due to its dirty and smelly nature. There are two main reasons for this: one is that the garbage sorting effect is poor, and all kinds of garbage are mixed and perishable, resulting in odor. The second is that the garbage can is full and has not been cleaned up in time, resulting in garbage overflow. In order to reduce peculiar smell and clean up the trash can in time, this article researched and designed this smart trash can.
1. Hardware design of smart trash can
In addition to the control unit, it mainly includes a display module, an infrared sensor sensing module, a wireless signal transmitting module and a motor driving module. This solution uses Arduino UNO R3 as the core to control the single-chip microcomputer, and controls the coordination and cooperation of various modules to realize the automatic opening of the trash can and the monitoring of the fullness of the garbage. Among them, the pyroelectric infrared sensor is used to detect whether someone is close to throwing garbage, and the infrared ranging sensor is used to detect in real time whether the garbage can exceeds the preset overflow degree. Once the trash can is full, even if someone is detected approaching, the lid will not be opened automatically, and a corresponding prompt message will be given.
1.1 Display module
The display part is divided into text display and light display, mainly composed of a liquid crystal character display (LCD 1602) and two leds (one red and one green). LCD1602 liquid crystal can display 32 characters at the same time, which can be used to display letters, numbers, symbols and so on. For the functions of LCD1602 pins, please refer to the chip manual. In this system, if the trash can is not full, the LED green light will be on, and the LCD display will display "Please throw out garbage by category"; if the trash can is full, the LED red light will be on, and the LCD display will display "The trash can is full, please do not Keep throwing out the trash."
1.2 Infrared sensor sensing module
It uses an infrared obstacle avoidance sensor module and a pyroelectric infrared sensor. The technical specifications of the infrared obstacle avoidance module are as follows: detection distance: 2 ~ 30cm; working voltage: 3.5 ~ 5V; standard current consumption: 33 ~ 50mA; output: analog output, the output voltage is proportional to the detection distance.
The garbage sensing part uses an infrared obstacle avoidance sensor module, which is an infrared distance sensor produced by Taiwei. The infrared distance sensor will provide a voltage output signal that is inversely proportional to the sensed obstacle. When within 10cm, the LED indicator light will be lit as an alarm indication. When the measuring distance is 10cm, the sensor will output a voltage of 2.5V. The human body sensing part adopts pyroelectric infrared sensor HS-SR501. Adjust the distance potentiometer to rotate clockwise, the sensing distance increases (about 7 meters), otherwise, the sensing distance decreases (about 3 meters).
1.3 Wireless transceiver module
The wireless data module has a wide operating voltage range of 3~12V, so that once the voltage changes, the transmission frequency will basically remain unchanged, which is conducive to the stable reception of the receiving module without any adjustment. The 315MHz F05R wireless transceiver module is selected here, which has the characteristics of small size and low power consumption. The working frequency is 315MHz, and the data module adopts ASK modulation to reduce power consumption.
1.4 Motor drive module
The design of the article uses a single-stage stepper motor as the power system, because the stepper motor can better control the rotation angle of the motor than the DC motor. A microcontroller cannot directly drive a motor. Here a TIP130 power transistor is used to drive each coil of the stepper motor. The unipolar drive circuit uses four transistors to drive two sets of phases of the stepping motor. The speed of the motor is determined by the timing of the control signal. It operates in 4-beat mode. First, rotate the first step and delay it for 5 seconds, then Turn the second step and delay for 5 seconds, then turn the third step and delay for 5 seconds, and finally turn the fourth step and delay for 5 seconds.
2. Software Design of Intelligent Trash Can
The software program is mainly written in C language, and the workflow is roughly as follows: when the program starts to execute, firstly initialize the timer and each connection pin, and then check whether the trash can is full, and if it is not full, the green light will be on. When approaching, open the lid of the dustbin and display "Please throw out garbage according to category". If it is detected that the dustbin is full, the red light will be on. Garbage", and the wireless sending module sends out a signal, the environmental sanitation department receives the information and sends someone to dispose of the trash can, and the program returns to the detection of the trash can.
2.1 Infrared sensor subroutine design
First set the sensor signal output pin to low level, that is, to initialize. When the garbage is 10cm away from the probe, the sensor signal output pin is set to a high level, the red light is lit, and relevant information is displayed, and the mark position 1 outputs a high level, and this terminal is connected to the enable terminal of the wireless module; otherwise, the sensor signal output pin Set the low level, turn on the green light, and display relevant information. At the same time, if the pyroelectric sensor detects that someone is throwing garbage, the motor will be driven to open, and the lid of the trash can will be opened, and it will be closed after the person leaves.
2.2 Subroutine design of wireless transceiver module
After initialization, it starts to detect whether the enable signal of the wireless transmitting module is 1, and if it is high, it sends a signal that the trash can is full. It is reminded that the 315M wireless module needs a decoding and decoding module, and this system uses software decoding and decoding.
Summarize
The intelligent garbage can designed in this paper uses the obstacle avoidance and ranging infrared sensor to detect whether the garbage can is full; uses the pyroelectric sensor to detect whether someone wants to throw garbage, and controls the switch of the garbage can lid according to the Sharp infrared detection result, and makes it through the LCD1602 display screen. Prompt, and make real-time monitoring through the 315mhz wireless communication module. Compared with traditional trash cans, it has intelligent reminder and intelligent switch functions, which has certain practical value.
The above is the development example of the smart trash can introduced to you by Shenzhen Zuchuang Microelectronics Co., Ltd. If you have PCBA design and development needs for smart trash cans, you can trust us. We represent a variety of single-chip microcomputers, voice chips, dual-mode Bluetooth ICs, and wifi chips. Brands include Songhan MCU, Yingguang MCU, Jerry Bluetooth, Ankai Bluetooth, Allwinner, and Realtek. Our technical services include: PCB design, microcontroller development, Bluetooth solutions, software and hardware custom development, APP development, small program development, WeChat official account development, etc. It can also undertake the design of intelligent electronic products, the development of living appliances, the research and development of beauty equipment, the application of Internet of things platform, the smart home control system, the development of TWS earphones, Bluetooth earphone speakers, the development of children's educational toys, the design of electronic education products, etc.
Proposal recommendation
- TOP