maserFire.py – Fire lasers with transistors and python on a Raspberry Pi 3

4918 0

This is the second part of a five part article. The first part is HERE, although if you are going to use only the laser parts of the code you can start here.  NOTE : PLEASE USE APPROPRIATE GOGGLES. USE LASER SAFETY GOGGLES RATED TO WHICH EVER COLOR AND POWER LEVEL YOU PURCHASE!!!

Take a look at the pictures and diagrams, I have added three lasers to the servo project. I have also included servo #1 – the tilt (up and down) servo to go along with the pan (side to side) servo in the last article.

The lasers are controlled by a really common transistor called the 2n2222. When you turn power on to the “base” pin, it allows power to flow from the “collector” pin to the “emitter” pin.  In short, it is an on and off switch. It’s a lot like the “alternator” in my old christmas lights mashup, but it’s a lot smaller and is controlled by the GPIO port on the raspberry pi that allows power to go from my battery to the laser. This causes the laser (maser?) to “fire”.  It also gives the python code below control of firing that laser.

 

 

Just like in the last article, the pictures have a Micro Center battery, but the diagram has an Adafruit battery. This is because the diagraming software Fritzing has Adafruit models available. I ordered the lasers from well rated sellers on eBay. We used 200mW lasers for all three colors.  They are really available, and there are a lot of sellers. Our shipper had a little problem in customs with the blue laser, Have fun, getting good lasers might be as difficult as all the wiring combined. 

You might notice that there is also a lego post with a pi camera on it.  This is a standard raspberry pi camera, 2mp from an old project.  I was firing lasers, and did not want to risk destroying the few 8mp cameras I have. This camera is not in the wiring diagram above.

At this point I want to remind anyone reading : USE GOGGLES. READ GOGGLES NOTE AT TOP OF ARTICLE.

The code below could use a lot of improvements, try to remember it was made for a science project that changed many many times as we went along. If you improve on it, please let me know in the comments box below! 

PLEASE REMEMBER TO WEAR SAFETY GOGGLES AT ALL TIMES WHEN LASERS ARE IN USE. READ ABOVE. PLEASE.

Video : First Green Laser Test

 

Test firing lasers to see what we can cut :

 

Facebooktwitterredditpinterestlinkedinmail

Related Post

Serial Commands used by our Satellite transciever.

Posted by - October 17, 2015 0
We will need the crc16 python code library : http://code.google.com/p/pycrc16/downloads [crayon-6766c8a5e2db8618450614/] [crayon-6766c8a5e2dc2845690075/]   [crayon-6766c8a5e2dc5393370474/] Keep Reading : Serial Communication with…

Identify USB device and discover its name and port

Posted by - October 17, 2015 0
Download latest PyUSB from : http://sourceforge.net/projects/pyusb/files/PyUSB%201.0/1.0.0-beta-2/pyusb-1.0.0b2.tar.gz/download Place file “pyusb-1.0.0b2.tar.gz” on your desktop gunzip <pyusb-1.0.0b2.tar.gz |tar xvfp - cd pyusb-1.0.0b2 sudo ./setup.py…

Mesopotamia

Posted by - February 28, 2017 0
For Mesopotamia : This page is a great resource, THE WESTERN TRADITION – Episodes #3 Mesopotamia and #4 From Bronze…

There are 0 comments

  1. Pingback: Tales of a 6th Grade Maker: Tribulations of a Laser Cutting Science Fair Project | Make:

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.