# Laser Dog Goggles

## Overview

https://www.youtube.com/watch?v=1wO61PAX898

Dress your dog up for Halloween! This project mods a pair of Doggles brand dog goggles with a swiveling laser diode for targeting all those ghouls and goblins lurking near ground level.

While this is a fairly simple electronics project suitable for intrepid novices, there are a few common sense safety considerations to keep in mind throughout:

- **Any battery-powered circuit&nbsp;is capable of&nbsp;burning your pet** , but you&nbsp;can mitigate the risk of injury (but never completely eliminate it).
- **Protect batteries** from a scratching paw with adhesive, fabric tape, or both. Mount batteries on the exterior components, never in direct contact with your pet's face. Do not allow lipoly batteries to be abused and remove/discontinue use immediately if your battery is damaged.
- **Adhesives can give off fumes** an should be completely dry (sometimes 24 hours or more) before&nbsp;going anywhere near your pet's face, especially its eyes.
- **Never leave your pet unattended** while wearing any costume. Observe for signs of discomfort.
- While positive reinforcement with treats can help some&nbsp;pets aclimate to any costume, other&nbsp; **pets may not tolerate wearing&nbsp;your&nbsp;project at all**.&nbsp;Be ready to accept this fact,&nbsp;and don't push the issue or abuse your pet!
- **Do not shine lasers directly into anyone's eyes**. The laser used in this project is relatively safe but could still cause eye damage if stared at for more than ~30 seconds.&nbsp;

"Pfft, of course, I've thought of all these things and have a few more safety pointers, Becky!"

"That all makes sense to me and I would never put my pet in danger by forgetting to follow proper&nbsp;safety measures!"

Ok then, I think you're ready to proceed.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/139/medium800thumb/trinket_laser-dog-goggles-materials.jpg?1448312848)

Info: 

Prerequisite guides:

- [Adafruit Guide To Excellent Soldering](../../../../adafruit-guide-excellent-soldering)
- [Introducing Trinket](../../../../introducing-trinket)
- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/overview)

![](https://cdn-learn.adafruit.com/assets/assets/000/020/360/medium800/trinket_olive-wearing-doggles.jpg?1413327391)

 **Tools & Supplies:**

- [Doggles ILS](https://www.amazon.com/Doggles-Goggles-Metallic-Black-Large/dp/B0002M7X3S)&nbsp;dog goggles (with [clear lenses](https://www.amazon.com/Doggles-Goggles-Skull-Crossbones-Smoke/dp/B0014CDTHY/ref=pd_lpo_vtph_199_tr_t_2?_encoding=UTF8&psc=1&refRID=A7WGTRM431DWP498C4RH)&nbsp;for night visibility)
- laser diode ([dot](https://www.adafruit.com/product/1057), [line](https://www.adafruit.com/products/1057), or [cross](https://www.adafruit.com/products/1058)&nbsp;will work great)
- [Trinket M0](https://www.adafruit.com/product/3500)&nbsp;(recommended) or&nbsp;[Trinket 3v microcontroller](https://www.adafruit.com/product/1500)&nbsp;
- [micro servo motor](https://www.adafruit.com/products/169)
- [150mAh lipoly battery](https://www.adafruit.com/product/1317)&nbsp;and&nbsp;[charger](https://www.adafruit.com/products/1304)
- [JST battery plug](https://www.adafruit.com/product/1769)
- [slide switch](https://www.adafruit.com/product/805)
- [JST extension](https://www.adafruit.com/product/1131)&nbsp;(optional)
- [heat shrink tubing](https://www.adafruit.com/product/1649)
- black gaffer tape
- hot melt glue
- E6000 adhesive
- [wire strippers](https://www.adafruit.com/product/527)
- [flush&nbsp;diagonal cutters](https://www.adafruit.com/product/152)
- [scissors](https://www.adafruit.com/product/1599)
- [soldering iron and solder](../../../../adafruit-guide-excellent-soldering)
- [USB cable](https://www.adafruit.com/product/260)
- [solderless breadboard](https://www.adafruit.com/products/65)&nbsp;for prototyping
- [header pins](https://www.adafruit.com/products/400)

![](https://cdn-learn.adafruit.com/assets/assets/000/020/114/medium800/trinket_olive-becky-stern-laser-dog-goggles.jpg?1412696073)

After building these, your dog can be Terminator, Robo Cop, or, in my case, Tank Girl's kangaroo boyfriend.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/136/medium800/trinket_becky-stern-olive-dog-goggles.jpg?1412705054)

Portaits by&nbsp;[Andrew Baker](http://airfieldfilms.com/)

# Laser Dog Goggles

## Circuit Diagram

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/020/144/medium800/trinket-usb.jpg?1412718444)

For testing:

Laser red wire and servo red wire to USB+ on Trinket

Laser black wire and servo brown wire to Gnd on Trinket

Servo orange wire to #0 on Trinket

![](https://cdn-learn.adafruit.com/assets/assets/000/020/143/medium800/trinket_circuit-diagram.jpg?1412713962)

For battery power:

Laser red wire and servo red wire to BAT+ on Trinket

Laser black wire and servo brown wire to Gnd on Trinket

Servo orange wire to #0 on Trinket

# Laser Dog Goggles

## Laser and Motor

![](https://cdn-learn.adafruit.com/assets/assets/000/020/131/medium800/trinket_laser-dog-goggles-00.jpg?1412703823)

It's a good idea to protype your circuit user&nbsp;a solderless breadboard before soldering it up. On Trinket, the positive red wires should go to USB+ for testing over USB power, then moved to BAT+ later for battery power.

Wire up your breadboard or soldered circuit according to the circuit diagram noting the above.

Use black gaffer tape to secure your laser to the flat paddle servo attachment and stick it on the servo gear. Do not screw it on yet, we'll adjust the position after testing the servo rotation.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/128/medium800/trinket_laser-dog-goggles-01.jpg?1412700519)

You may need to solder longer wires on your laser diode for testing purposes.

Prepare the side of your dog goggles by&nbsp;making sure they're clean and dry.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/130/medium800/trinket_laser-dog-goggles-02.jpg?1412703610)

Use hot glue to **temporarily** mount the servo to the goggles. This is a weak connection that we will use for testing/fitting purposes only, and is to be replaced with a more heavy duty adhesive in a later step.

# Laser Dog Goggles

## Arduino Code

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/020/127/medium800/trinket_laser-dog-goggles-03.jpg?1412700467)

You will need the [Adafruit\_SoftServo library](https://github.com/adafruit/Adafruit_SoftServo)&nbsp;to run this sketch.

Plug your Trinket into your computer's USB port, press the reset button and upload the following sketch:

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Laser_Dog_Goggles/Laser_Dog_Goggles.ino

![](https://cdn-learn.adafruit.com/assets/assets/000/020/140/medium800thumb/trinket_too-fast.jpg?1448312859)

When the variable&nbsp; **moveAmount** is increased, the motor moves faster and makes more noise. A squeaking motor next to your dog's ear is not nice, so keep it slow and quiet!

![](https://cdn-learn.adafruit.com/assets/assets/000/020/141/medium800thumb/trinket_just-right.jpg?1448312883)

Adjust the position of the flat paddle servo attachment on the servo's toothed shaft until you're happy with the alignment.

Without removing the flat paddle from the servo, untape the laser and use one of the included screws to secure the paddle to the servo. Retape the laser to the paddle.

# Laser Dog Goggles

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/064/383/medium800/trinket.jpg?1540496955)

 **Trinket M0&nbsp;** boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on Trinket M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the&nbsp;[**Adafruit** &nbsp;](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60)**[Trinket M0 guide](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60).**

Info: 

Below is CircuitPython code that works&nbsp;similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the Trinket M0 into USB…it should show up on your computer as a small&nbsp; **flash drive** …then edit the file “ **main.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If Trinket M0 doesn’t show up as a&nbsp;drive, follow the Trinket M0 guide link above to prepare the board for CircuitPython.**

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Laser_Dog_Goggles/code.py

This code requires an additional library be installed:

1. adafruit\_motor

If you’ve just reloaded the board with CircuitPython, create the “lib” directory and then download the[&nbsp;Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases). You can copy 'adafruit\_motor' folder into the lib directory.

```auto
$ mkdir /Volumes/CIRCUITPY/lib 
$ cp -pr adafruit_motor /Volumes/CIRCUITPY/lib
```

# Laser Dog Goggles

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/020/132/medium800/trinket_laser-dog-goggles-04.jpg?1412703847)

Solder up the wires to your trinket according to the circuit diagram, shortening them considerably.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/145/medium800thumb/trinket-battery-port.jpg?1448312896)

Solder a JST battery connector to the back of your Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/133/medium800/trinket_laser-dog-goggles-05.jpg?1412703963)

Now when you program the circuit over USB, you'll notice that the motor and laser don't power on. That's because they are wired to the battery power, so any changes in your code will only be visible after you disconnect USB and reconnect a battery.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/134/medium800/trinket_laser-dog-goggles-06.jpg?1412704035)

You can either solder the switch directly to your battery or use a JST extension cable to make a switch adapter to go between the battery and Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/146/medium800/trinket_3d_printing_power-switch-circuit.jpg?1412721925)

Stick the Trinket to the bottom side of the servo and gaff tape the battery to the outside flat side of the servo. Try your new laser dog goggles on and notice the angle of the assembly and how it affects where the laser points. Make any desired adjustments by removing the motor-laser assembly and re-hot-glueing it on at a different angle.

![](https://cdn-learn.adafruit.com/assets/assets/000/020/137/medium800thumb/trinket_e6000.jpg?1448312801)

After you've found your ideal laser angle, use E6000 adhesive to permanently attach the assembly to the side of the dog goggles, tape or prop up in place if necessary, and let dry for at least 24 hours. Remember adhesive give off fumes and shouldn't be placed near your pet's face until completely dry.

# Laser Dog Goggles

## Wear 'em!

![](https://cdn-learn.adafruit.com/assets/assets/000/020/138/medium800thumb/trinket_laser-doggles-bounce.jpg?1448312817)

![](https://cdn-learn.adafruit.com/assets/assets/000/020/142/medium800thumb/trinket_becky-stern-laser-dog-goggles-tank-girl.jpg?1448312891)


## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [Capacitive Touch Pulsing Heart](https://learn.adafruit.com/3d-printed-heart-capacitive-touch.md)
- [Bluetooth Remote Control for the Lego Droid Developer Kit](https://learn.adafruit.com/bluetooth-remote-for-lego-droid.md)
- [3D Printed Case for Raspberry Pi Pico](https://learn.adafruit.com/raspberry-pi-pico-case.md)
- [PyBadge Thermal Camera Case](https://learn.adafruit.com/pybadge-thermal-camera-case.md)
- [BLE Vibration Bracelet](https://learn.adafruit.com/ble-vibration-bracelet.md)
- [Automatic Cat Treat Dispenser](https://learn.adafruit.com/automatic-cat-treat-dispenser.md)
- [Wireless LED Maracas](https://learn.adafruit.com/wireless-led-maracas.md)
- [Desktop Dumpster Fire](https://learn.adafruit.com/desktop-dumpster-fire.md)
- [Watchmen's Sister Night NeoPixel Goggles](https://learn.adafruit.com/watchmen-sister-night-circuitpython-neopixel-goggles.md)
- [Talking Computer from Star Trek](https://learn.adafruit.com/talking-computer-from-star-trek.md)
- [ Faz-Wrench - Five Nights at Freddy's](https://learn.adafruit.com/faz-wrench.md)
- [Animatronic Glowing Medusa Headdress](https://learn.adafruit.com/animatronic-glowing-medusa-headdress.md)
- [Combo Dial Safe with Circuit Playground Express](https://learn.adafruit.com/combo-dial-safe-with-circuit-playground-express.md)
- [GEMMA M0 Case](https://learn.adafruit.com/gemma-m0-case.md)
- [Prop It Game](https://learn.adafruit.com/prop-it-game.md)
