This instructable is to build up a laser driver from an Arduino based board for a 5 mW Adafruit laser. I chose an Arduino board as I might want to control the laser remotely from my computer in the future. I'll also use the sample Arduino code to show how someone with little programming experience can get up and running quickly. For this example, I have an Intel® Galileo Gen2 board based around the Arduino Uno chip.
Step 1: Laser Safety and Precautions
It's important to note some general laser safety precautions before we get started. Never look directly at a laser beam head on, or one which is being reflected from a mirror. Never look at a laser source head on (or reflected) that is connected to power. When experimenting with coherent light sources, especially when working with non-visiable light, it's possible to not realize a device is luminating and damage one's eyes. This instructable will only be working with visible light at very low power so it's extremely unlikely to damage human tissue, however precautions must be stated and adhered.
Safety googles rated for the laser wavelength, in our case 650 nm wavelength, are required.
Step 2: Gather All the Componets and Software
Gather all the components onto a clean static free surface.
1 Arduino base board and proper power cables
1 usb cable to transmit data from the Arduino board to the controlling computer (in my case: USB male to micro male cable)
1 push button
1 laser source
Laser mounting hardware (some kind of laser stand, stage mount, or bicycle light holder.)
1 set of googles (per person)
Install the Arduino IDE or configure the necessary software to control the Arduino board (Intel Galileo Gen 2) and laser source.
- I'm using the desktop IDE running on High Sierra with an Intel Core i7.
Configure the Arduino IDE to run in a web browser: https://create.arduino.cc
- I wasn't successful to get the web IDE to compile and send the app to the board. It kept throwing compiler errors most likely related to the Galileo board.
Step 3: Test the Connection From the Arduino Board and Computer
- Start the Arduino IDE
- Connect the USB cable from your computer to the Arduino board.
- Select the board and appropriate serial port if necessary.
- Select Tools and the Board pull down -> Board manager
- type Intel Galileo and it should automatically pull up the latest libraries for the board. Select Install, then Close.
- Load the button tutorial.
- From the desktop IDE, select the File menu -> Examples -> 02.Digital -> Button
- Hit the check button to verify, then the -> arrow button to upload the new code to the Arduino.
If successful, you should see the buttons flash and blink.
Step 4: Assemble the Hardware Circuit
Push Button test:
This is to test that the basic circuit works before adding the laser.
Plug the jumper from the 5 Volt side and attach it to one side of the push button.
Plug the the black wire to the ground and attach it to the other side of the push button.
If you're using a breadboard, it can look as simple as this.
Step 5: Add the Laser to the Circuit
To drive the laser, I've used this code: button code extended from the example. This sample code is also saved as an attachment to this step.
Once you know everything is working as intended, you can power off the device and connect up the laser.
Wire it like the schematic above or found here. Plug the laser inline between the push button and ground.
Step 6: Start the Laser!
Select upload in the IDE and deploy the Arduino code to the board.
You should see a message that says transfer complete and the laser will light.
This code set the laser to light on every third button press, as shown in the video.
Thank you for watching and reading about how to use an Intel Galileo Gen 2 prototyping board to drive a small laser source. Happy making!