How to setup Laser module with Orange Pi Zero

Playing with laser is cool and controlling the laser with Linux is uber cool. I have been playing with  45 in 1 sensor kit. As part of it comes the laser module. Its a small laser light which is a equivalent to  a keychain laser light with gpio controllable pinouts. I have already written on how to setup laser with Arduino. Now we will see how to get it working with Orange Pi Zero running armbian Linux.

Hardware required:

For this project you need

https://www.banggood.com/Geekcreit-45-In-1-Sensor-Module-Board-Kit-Upgrade-Version-For-Arduino-p-1137050.html?p=W214159476515201703B

https://www.banggood.com/Orange-Pi-Zero-H2-Quad-Core-Open-source-512MB-Development-Board-p-1110210.html?p=W214159476515201703B

 

Connection:

Orange Pi Pinout is shown below.

Here we are going to use the GND pin and the GPIO PA12 on the top left for controlling the laser.

Code:

 
git clone https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 
cd orangepi_PC_gpio_pyH3 
python setup.py install

Now I used the standard blink led example from the repository to run the blink laser example.

Output:

If you are able to run the above code successfully then you will be controlling laser with Linux 🙂 .

One thought on “How to setup Laser module with Orange Pi Zero

Leave a Reply

Your email address will not be published. Required fields are marked *