Description
Product Description
Title goes here.
describe: The output of the object is 0, and the output 1 is not sensitive. It is directly connected to the 3V and 5V IO ports of the single-chip microcomputer. 2-40cm sensing distance, long distance, good anti-interference ability. (Note: The infrared sensor cannot detect all objects to get the same distance. Objects of different colors reflect objects of different colors. The darker black distance is the detected distance. The sensor measures 2-40 cm against a white wall) Speed, suitable for smart car obstacle avoidance, black and white line tracking, fall prevention, product counter, cutting line, liquid level detection. The sensor is made of black and white lines to track the driving of cars. There is no black line on white paper. It can be used in complex yellow concrete environments, such as black line patrol tracks. As long as the surrounding black lines are slightly lighter than black, it saves traditional actions and makes environmentally friendly design easier. The sensor provides a wide range of 3-6V and is suitable for 3V and 5V MCU systems. After activation, the EN terminal is equal to "1" when the sensor is not working, and equal to "0" when the sensor is working. Jump the EN sensor end cap over the EN ground plug (EN "0"). Use the EN pin when removing the jumper cap. The frequency modulation potentiometer is used to adjust the transmission frequency of the infrared transmitting tube, because the integral receiver 38KHZ is especially sensitive when the transmission frequency is the most sensitive. Resistor 502 is adjusted clockwise (that is, the brightness of the emission tube is maximum), and then the resistor 103 is adjusted on the white wall until the detection distance is the highest. At present, the sensor is working in the best state. Working voltage: DC 3.3V-5V Working current: 20mA Working temperature: -10 degrees +50 degrees Induction distance: 2-40cm IO interface: 4 wires (-/+/S/EN) Output signal: TTL level Adjustment method: multi-resistance adjustment Effective angle: 35° Size: 4.5x1.1cm (approximately) Here we use the obstacle avoidance module and the digital interface 13 with LED to build a simple circuit to make the obstacle avoidance warning light on, and connect the obstacle avoidance sensor to the digital interface 3. When the obstacle avoidance sensor detects the signal, the LED light is on, otherwise, it turns off . code: int Led = 13;/define LED interface int buttonpin = 3;/define obstacle avoidance interface int val;/define numeric variable val Empty setting () PinMode(Led, output); //Define LED as output interface PinMode(button, input); //Define obstacle avoidance as output interface Empty loop () val = digitalRead(button); //Read the values of 3 digital interfaces to val If (val = HIGH)/When the obstacle avoidance sensor detects a signal, the LED flashes Digital writing (LED high); add Digital writing (low LED);