When learning about microcontrollers, we often deal with various modules.Today, we will master the analysis of four sensor modules, which are the infrared obstacle avoidance module, sound control module, and human infrared module.1. Infrared Obstacle Avoidance
Module OverviewThe infrared obstacle avoidance module has a pair of infrared emitting and receiving tubes. The emitting tube emits infrared rays at a certain frequency. When the detection direction encounters an obstacle (reflective surface), the infrared rays are reflected back and received by the receiving tube. After processing by the comparator circuit, the green indicator light will turn on, while the signal output interface outputs a digital signal (a low-level signal). The detection distance can be adjusted through a potentiometer knob, with an effective distance range of 2 to 30 cm. The working voltage is 3.3V to 5V. This sensor’s detection distance can be adjusted via the potentiometer and features low interference, easy assembly, and convenient use.Interface Description
Module Function ImplementationAfter configuring the OUT pin as an input mode, we can determine the high or low level of the IO port to detect whether there is an obstacle. If the read value is 1, it indicates no obstacle. If it is 0, it indicates there is an obstacle.2. Sound Control Module (Sound Sensor Module)
Module Overview1. This sensor can only recognize the presence or absence of sound (based on vibration principles) and cannot recognize the volume or specific frequency of sound. 2. When the environmental sound intensity does not reach the set threshold, the DO output is high level. When the external environmental sound intensity exceeds the set threshold, the module outputs low level; 3. The digital output D0 of the module can be directly connected to the microcontroller to detect high and low levels, thus detecting the environmental sound. 4. The digital output D0 of the module can directly drive a relay module, thus forming a sound control switch.Interface Description
Module Function ImplementationAfter configuring the OUT pin as an input mode, we can determine the high or low level of the IO port to detect whether there is sound. If the read value is 1, it indicates no sound. If it is 0, it indicates there is sound.3. Human Infrared Module (HC-SR501 Thermal Infrared Sensing Module)
Module OverviewHC-SR501 is a human sensing module based on a pyroelectric infrared sensor, capable of sensing the movement of humans or animals within its monitoring area and outputting a high-level signal. It is widely used in smart lighting, security alarms, automatic doors, and other applications.The core of HC-SR501 is based onpyroelectric effect infrared sensing technology. When a human body enters the sensing area, the infrared energy radiated by the body generates an electrical signal in the pyroelectric element. This signal is amplified, filtered, and compared, driving the output pin to output a high level.Interface Description
Module Function ImplementationWhen a human enters the sensing range of the module, the output pin OUT outputs a high level; when the human leaves, it automatically outputs a low level after a delay.As I have recently been learning about voice control, the next microcontroller sensor content will be about the MP3 voice module. Stay tuned!