Template: Laser Sensor Arduino Guide
The Arduino example is written for the Arduino UNO. If you want to connect it to other Arduino boards, you may need to change the connection.
Arduino
Hardware connection
Sensor | Arduino | Description |
---|---|---|
VCC | 5V | Power input |
GND | GND | Power ground |
DOUT | D2 | Digital output |
Install the Software
Run the Program
Download the program in the information we provided, unzip it, and then enter the Laser-Sensor-code/Arduino/Laser_Sensor directory.
Double-click to open the Laser_Sensor.ino file.
Select your development board and the corresponding port.
Compile and download, as shown below:
After the download is successful, run SSCOM to connect the Laser module, and you can view the status of the sensor in real-time.
Note
Place the obstacle above the laser sensor, and the signal indicator on the module will be on. When the obstacle is far away from the laser sensor, the signal indicator on the module will be off.
Note: Try to avoid touching the resistors and capacitors on the board when the power is on, to avoid burning out the infrared emitting tube, the laser is harmful to the human eyes, please do not use it to irradiate the human eyes!