Ask HN: Programmable Lasers?

43 points by andoando 6 days ago

I am looking for lasers that I can program myself. I can't find much information on lasers which can be programmed, and even less on how to write software for it. I see theres a few software solutions already but I want to programmatically control the lights.

Anyone can shed some light on this?

sharphall 7 hours ago

Plugging my small project: https://github.com/sharph/nanometer

I wanted the same thing (to programmatically control a laser) so I took an existing library (oriented around drawing of frames) and hooked into it in a way that I could send an limitless stream of points to it.

Generally, the search term you want to search for is "ILDA". ILDA compatible lasers have a standard connector on the back to set the X/Y position of the laser as well as the intensity of the color components.

CoastalCoder 6 hours ago

> Anyone can shed some light on this?

You're looking for a coherent answer, I assume.

  • Gabriel_Martin 5 hours ago

    This is the kind of bright and focused clarifying question that will help OP get their answer, well done.

    • icambron 4 hours ago

      Helps keep everyone on the same frequency

      • mensetmanusman 4 hours ago

        Speaking of this, the government should build some crazy Rube Goldberg laser that lets a user dial in frequency bands of high fluency output as much as technically possible. Not sure what it could be for, but it would be fun to have (eg asml euv near one end, IR and far IR lasers at the other end).

al2o3cr 6 days ago

You can get inexpensive "programmable" lasers that are controlled by DMX, but that protocol isn't fast enough (250kb/s) to do anything besides pick preprogrammed patterns. If you're up for some hacking / reverse engineering, maybe you could replace the control electronics for one of these.

Another alternative is a laser projector that uses the ILDA standard - it supplies a bunch of analog channels over a DB-25 connector. With a projector and an ILDA DAC (typically connected via USB), you could write code to generate all the signals to drive the scanner + control the laser color. That'd mean generating 10 signals at audio-ish rates, so pick your language accordingly.

FWIW, there seem to be a handful of packages for the openFrameworks coding toolkit specifically for talking to ILDA ports, for instance:

https://github.com/memo/ofxIlda

  • vonnieda 7 hours ago

    Seconding ILDA. It's been the standard for decades and it is well documented and easy to interface with either at the software/library level, or even at the signal level. [1]

    You can get a cheap "RGB" laser projector on eBay for ~200 [2]. It will have red, green, and blue lasers, and the interface will be willing to combine them 7 ways. A more expensive laser will have "analog" mixing for closer to true RGB. It will also likely have no documentation, and might be weird. I have one of these.

    For something with better documentation, supported API, and lots of active development, check out Lasercube [3]. It has WiFi, a documented API, a Github repo with a client, and the base software is also really cool. This is my next planned upgrade.

    Be careful: Most of these lasers put out 500+ mW and will instantly destroy your eyes if you make a mistake and stop scanning. It's not an exaggeration. Find out what wavelengths your laser outputs and get certified glasses to wear when working on it.

    [1]: https://www.ilda.com/resources/StandardsDocs/ILDA_ISP99_rev0...

    [2]: https://www.ebay.com/sch/i.html?_from=R40&_nkw=ilda+rgb&_sac...

    [3]: https://www.laseros.com/

  • andoando 5 days ago

    Thanks. I have my eye set on this https://www.lighting-geek.com/product/hawk-1w-programmable-l...

    + a Helios DAC which comes with some nice software for interacting with IDLA.

    https://github.com/Grix/helios_dac

  • nottorp 4 hours ago

    > pick your language accordingly.

    Node in a docker on WSL?

tensor 5 hours ago

LaserCube[1] makes entry level lasers and has an open core [2]. There are also libraries that people have made that can interface directly with its wifi/ethernet protocol. However, programming lasers is not nearly as simple as doing 2d raster operations.

If all you want to do is make fancy custom laser shows then buy a laser and some control software.

[1] https://www.laseros.com

[2] https://github.com/Wickedlasers/libLaserdockCore

CephalopodMD 4 hours ago

I once took an led string with naked leads, cut off the leds, and soldered on red laser diodes in their place. Then I could control it with an Arduino. I used it to make a laser harp!

You can use laser diodes just like you would a regular LED in an Arduino/rPi setup. They're basically the same thing electrically. Be aware, using those standard laser diodes in public, especially for an event or show, is against the law because of the risk of blinding someone. If you want to do a laser light show or something, you need to use the sub 5 milliwatt kind they have at concerts and such, and you need a permit.

solardev 4 days ago

Have you seen https://laserboy.org/?

There are also a lot of commercial offerings, like Quickshow and others: https://photonlexicon.com/forums/showthread.php/19036-WHAT-i...

Seems like that's a forum all about lasers and lights.

  • andoando 4 days ago

    Yeah I found thet through one of the links someone else posted.

    I am interested in writing my own software for creating visual patterns so not interested in Quickshow, Pengolier, etc so something like laserboy that lets you write ilda frames directly is what I was looking for.

    • solardev 4 days ago

      Gotcha. Sounds like a fun project! I hope you'll do a writeup about it.

      • andoando 3 days ago

        Thanks :] Will do, once (if) I get there.

smcameron 3 hours ago

There's openlase https://github.com/marcan/openlase with which you can use the audio output through amplifiers to control galvos of a laser projector.

About 10 years ago a buddy of mine built a home-made RGB laser projector, using a red, green and blue lasers, and dichroic mirrors, and managed to drive it with MAME to run battlezone and some other vector games. The laser projector itself is quite dangerous, and we're probably lucky we didn't end up blind, so I wouldn't really advise doing this.

Battlezone: https://www.youtube.com/watch?v=S2JKr-Vkz8A

SEGA Star Trek: https://www.youtube.com/watch?v=VBALyh1hw5Y

Short clip of the home-made laser projector: https://www.youtube.com/watch?v=-aV0RRmO4gI

Simple rotating cubes demo: https://www.youtube.com/watch?v=OHbsrLW-iag

Running Word War vi via the laser projector: https://www.youtube.com/watch?v=cek1QaNc0Kk

If you look in the Word War vi source, here: https://github.com/smcameron/wordwarvi/blob/master/wordwarvi... and search for "openlase", you can see how it uses the open lase library.

Here's a fork of MAME hacked up to use the laser projector:https://github.com/jv4779/openlase-mame

viraptor 6 days ago

I'm assuming you're talking about very basic, low power, pointer style lasers. If that's the case, it's time to go into very basic electronics. You're basically replacing the switch in that with some lines connected to your i2c/gpio/whatever. It's not going to be different from turning on an LED. Laser you can program == cheap laser pointer, taken apart, switch replaced.

If you're talking about some bigger devices, then you probably want more interesting electronics and a lot of info about laser safety...

  • andoando 6 days ago

    Sorry I should have clarified. I am thinking of lasers for light shows. Doesn't have to be industrial level, small low powered ones would be fine.

    I am lot more interested in the software side of this, so Im hoping I don't have to rig together a bunch of individual lasers together.

    • k310 6 days ago

      You may be thinking of beam directors, rather than the lasers themselves, aside from turning them on and off as desired. Solid state lasers are good, if they have the power you need (and yes, understand and practice laser safety)

      The rest would be beam steering. Geometric optics and servos. I remember reading some on scanner optics, which would help you. Just think angles instead of UPC codes.

      Programming the servo's would please you, but you first need the beam steering gear, and also the on/off, and interfaces for both aspects.

      I don't know of any OTC/KISS stuff.

      • andoando 6 days ago

        I am thinking of stuff this

        https://www.lighting-geek.com/product/cartoon-animation-lase...

        https://www.ktvlights.com/products/8-eyes-red-laser-light-dm...

        or

        https://www.wayfair.com/YXSUN--9-Eyes-RGB-Moving-Spider-Beam...

        I can't find any specifications at all. I was hoping for an interface like "move laser 1, +50 x", "turn laser 2 off". They come with DMX interface, but all the commands that I see are just setting preprogrammed effects.

        There is sophisticated software for projecting any animation, so I assume there is some software like this somehwere.

        • ruste 6 hours ago

          I actually did this at one point in time. The hardware you're looking for is a "laser galvo" setup. It typically takes a +/-12v range analog signal as input. I ended up building my own hardware to drive this. You can use a D to A converter and an op-amp to take a digital output from a raspberry pi or arduino and get the correct signal level. I ran mine on an arduino and it was plenty fast for simple things. Complex animations that require more compute on the device might be a bit much. Enabling and disabling the laser is as simple as a transistor.

        • GianFabien 6 days ago

          If you want animation, then DMX-512 is inadequate. You are looking at frame-buffer to beam director(s) conversion. That would be specific to the hardware you have. The systems that I have come across are proprietary and designed to be rented-out out to event organizers.

          From the software point of view, perhaps laser projection TV technology might be better suited to what you want to achieve.

          • toast0 2 days ago

            > From the software point of view, perhaps laser projection TV technology might be better suited to what you want to achieve.

            Laser projection TV is boring. I've got one, and it's more or less the same as any other tv. Hook up an HDMI and go. It doesn't give you a laser light show, even if it is technically laser, light, and a show. Technically they're pretty boring too, they're lcd or dlp projector with a laser instead of an incandescent light source.

            The OP clearly wants an x-y servo mirror / galvonometer setup plus some way to modulate the laser. Some people experiment with scanning mirrors in one dimension, but then you end up with a rasterized display and not the smooth curves or a true laser show.

    • TylerE 5 hours ago

      No one actually uses lasers for light shows any more. Far too dangerous. They're just LEDs and some theatre fog.

GianFabien 6 days ago

Try searching for DMX-512, the industry standard protocol for controlling all manner of lighting devices. Since you are more interested in the software side, you could look at a product such as: https://djcity.com.au/product/laserworld-el-400rgb-laser which you can then control using a USB-to-DMX512 dongle.

Building your own unit is possible, but you'll need electronics and mechanical engineering skills. Even micro-mirror devices require lots of electronics.

4d4m 6 hours ago

ILDA is the standard you'll want to use - check out Pangolin

blitzar 4 hours ago

sharks with laser beams attached to their heads or a giant laser beam on the moon? Is this for The Alan Parsons Project?

brudgers 5 days ago

[Random advice from the internet on starting your project]

+ If you just want to play around with software, TouchDesigner has a free tier and is very powerful.

+ Buy the cheapest "DJ laser projector" and play around programming it using DMX/MIDI.

+ Then you will have a better understanding of your actual interest in programming laser light shows versus your interest in the-idea-of-programming-laser-light-shows.

+ A habit of working on a new adult interest develops over months and years. Having low investment hardware on hand will let your project advance at a natural pace.

Good luck.

  • andoando 5 days ago

    Thanks. Ive been thinking about the programming interface for this for years now, but up until now I just worked with controlling pixels on a monitor. Im more interested in writing an interface for this than making cool light shows.

    Programming using preprogrammed effects via DMX is not a bad idea though as a start.

  • doctorhandshake 8 hours ago

    I second the TouchDesigner advice. Not only is it powerful, it has a large and growing community that is second to none in my experience when it comes to helping out with any question or issue.

Joel_Mckay 7 hours ago

In general, it depends on the type and power class level of your project.

For semiconductor lasers under 5W, the control systems are fairly trivial given the fiber-optic network card industry makes fully integrated current controlled high-speed drivers.

Every student should read this at least once:

"Sam's Laser FAQ" ( http://www.lasersam.org/sam/lasersam.htm )

As there is a lot of hard to find information regarding how these devices are made, and safe handling to prevent cooking your eyes/internal-flesh.

Note when handling IR, be aware many of these optics are poisonous to handle with your bare hands given they have slight solubility in moisture.

There are also pre-made true RGB/White laser modules with PWM control (under $150), but are limited to under 5mW due to US import rules. i.e. unless you are a legitimate company/lab/university importing parts, than you have customs issues building your project.

Have fun, and take the lab safety advice seriously... A pirate eye-patch only looks cool to other people, but makes the world two dimensional. =3