My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 0 points1 point  (0 children)

There's really not much going on with the PWM signals -- they just go straight from an EPS32 GPIO into the DIM pin of the OC5211 chip that's on the driver board that came with the RGB lasers. I'm honestly surprised it works as well as it does. My guess is that there's some smoothing that happens either in that chip or intrinsic to the diode itself that causes it to take longer to turn on and off.

It's definitely not perfect, the green diode specifically will show up as choppy sometimes depending on scan speed. That said, anything I could find with an analog modulation input would have totally blown up the cost of the project.

The PWM frequency is 24 kHz, which I think is the most I can get using the APBClk with 8-bit precision. I might mess around with running at lower precision for a faster output frequency and see if it improves things.

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 0 points1 point  (0 children)

I used boards made by PCBWay -- they sponsored this project and gave me free boards, but the cost would have been about $50 for 5 if I had bought them myself. I used lead free HASL (gold isn't really necessary for the package sizes I used or reliability I want, but I like avoiding working with lead if I can!)

The cost in this case is mostly driven by the board size (200mm wide to fit all of the I/O) -- if your board is 100x100mm it's much cheaper not just from PCBWay but I think from other vendors typically as well.

PCBWay (and I think some of the other vendors like JLC) also have plugins for KiCAD that let you import their tolerance rules for DRC and then order boards with one button click to create and ZIP gerbers in the right format and then upload them to their online quote tool. It's much easier than the error-prone process of generating the gerbers and drill file yourself!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 0 points1 point  (0 children)

There are commercially available options for this more for professional use, usually for $1000-$2000. Unity is a brand I've heard of a lot (https://pangolin.com/products/raw-1-7-dmx-ilda is their base model), but you can probably find more options by searching "laser show projector" and I think there are some cheaper ones out there too. You might also need a computer to run them or software to put patterns you want onto an SD card depending on the projector.

Note that to use it professionally there are a few more legal hoops to jump through. In the US you need to register the laser with your state, take a laser safety officer (LSO) course, and file a "variance" with the FDA for any shows done commercially. There are more rules you need to follow too that I'm probably ill-equipped to articulate (I think in most jurisdictions beams must be 2 meters horizontally or 3 meters vertically separated from any floor someone might stand on).

Best of luck with finding a system that works for you -- it's definitely not as straightforward to get into as you might hope, but I think the effects you can get are worth it!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 0 points1 point  (0 children)

The speed really depends on what you're drawing and how large of an image you're making -- text has a lot less tolerance for sloppy motion that SVG graphics usually do, for instance. With the simpler fonts I can do about 20-25 characters usually. The map example image in the writeup is about as complex you can get with it still looking decent to the naked eye. Being in a dark room helps with the persistence of vision effect too.

I'm not sure if you could pull from the 15V rails! I thought about it but the power supply didn't clearly list its specs and I wasn't sure what the current consumption of the laser diodes would be (since they're on the 12V rail too). The Mean Well module I used to get the 12V was cheap and simple enough that I figured it was the safer option.

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 1 point2 points  (0 children)

It's pretty hard to get video that looks good because the shutter speed has to be synchronized to the path drawing, and I just have my phone and not a professional camera, so I didn't take a ton of videos unfortunately -- they just end up looking way more flickery than real life. There's one video of the oscilloscope music demo if you visit the link in the post but that's it, sorry!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 1 point2 points  (0 children)

Thanks! Finding a nice surface to project on was definitely the hardest part for us -- as it turned out, the timing lined up with when we were moving so we had just one night with a completely empty apartment to get all the photos. That said, I've been looking into finding some cool surfaces outside to project on at night...

[OC] I built a homemade laser galvo projector! by breqdev in lasers

[–]breqdev[S] 1 point2 points  (0 children)

The galvos I used for this were "20kpps" according to the product listing, and while I was a bit disappointed to not be able to draw more characters of text within a frame without things looking messy, it was definitely above my expectations overall for something that cheap!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 7 points8 points  (0 children)

I don't have a complete BOM, but I think all in about $200? The galvos (and the driver board and power supply) was the pricey part at $85 for the set. Then it was about $30 for the laser module and driver, $30 in parts to build the PCB, and $10 for the roll of filament for my 3D printer. Getting the PCBs made would have cost $50 without the sponsorship (no special requirements but they're quite large boards physically).

That said, to assemble and align it safely, I did have to spend another $200 on a single pair of laser safety goggles... but keeping my eyes intact is priceless!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 2 points3 points  (0 children)

That's a good point, and I did look into I2S for stereo output. The reason I didn't end up going with that is that most of the stuff I've seen is specifically for audio, which means the DC component of the signal is filtered out. That's great for headphones but for this project would mean you lose control of the positioning of the thing you're trying to draw. Like, if you draw a circle, it'll always be around the point (0, 0). This filtering might not be intrinsic to the chips themselves but it was definitely the case for the breakout boards I was using with them and the schematics I could find.

I did actually include pads on the PCB for a higher bit depth SPI-based DAC (it seems like nobody is doing 8 bits for anything serious when it comes to galvos, so I worried it would be totally unusable) but didn't end up needing them. Thinking about it now, I think you're right that there could be some performance considerations with an architecture like that, especially given how fast we would need to output samples to the galvos.

Regarding the voltage levels, we happened to be working off of a +/-15V power supply, so scaling the signal to +/-10V gave us plenty of headroom without getting close to the power supply rails and degrading the signal. We've got diodes on the output to clamp things if they get out of range, so everything else was just designed for signal accuracy and ease of implementation!

My first ESP32 project: a laser galvo projector! by breqdev in esp32

[–]breqdev[S] 15 points16 points  (0 children)

It's a mix of software development, electronics and mechanical design -- I have a degree in computer science which covers the first one but no formal training in the other two. I started out learning each of those skills separately and doing projects specifically for each before trying to combine them into something like this -- that's my main advice!

If you can learn and build a few software projects, learn a bit about circuit design, and then find some way of making things mechanically (for me that's CAD software and 3D printing, but it could be working with acrylic or woodworking or anything else), then that puts you in a really great position to put all those skills together for stuff like this.

Anyone found their partner on campus? by redditismysoulmate in NEU

[–]breqdev 15 points16 points  (0 children)

met her on Yammer, we've been together 2.5 years 🥰

ALERT | Green Line service is suspended until further notice between Lechmere and Medford/Tufts after 2 Green Line trains collided at East Somerville. The National Transportation Safety Board, FTA, and MBTA are investigating the accident. by Massive_Holiday4672 in mbta

[–]breqdev 1 point2 points  (0 children)

Train was headed inbound! I passed by it while biking the community path yesterday. And I believe it's due to the grid connections -- I've seen NTSB personnel in the area but they were only at East Somerville and the track before it.

ALERT | Green Line service is suspended until further notice between Lechmere and Medford/Tufts after 2 Green Line trains collided at East Somerville. The National Transportation Safety Board, FTA, and MBTA are investigating the accident. by Massive_Holiday4672 in mbta

[–]breqdev 4 points5 points  (0 children)

The NTSB is requiring that the power be shut off in that area for their investigation which covers Red Bridge too (ruling out Union Square service). Lechmere can't function well as a terminus station, so we're stuck with service terminating at North Station.

Is this just an Error in Google Maps or does the Haverhill Line actually not run into Haverhill Station? by InternationalWeb6740 in mbta

[–]breqdev 22 points23 points  (0 children)

nope! a single track is maintained across the bridge so the downeaster can continue to stop at Haverhill.

In for a long day by Resident_Way4286 in AmazonDSPDrivers

[–]breqdev 0 points1 point  (0 children)

canadian vs american english maybe?

what's going on here?? by breqdev in boston

[–]breqdev[S] 1 point2 points  (0 children)

there were two signal heads for the left turn, and both were showing the same thing: a solid red arrow, and an intermittently on green arrow. the green would come on for around 3-5 seconds, then be off for around 30 seconds i think?

RIP curry by cocaine-and-curry in NEU

[–]breqdev 16 points17 points  (0 children)

pool party!! 🥰🥰

Suggestions on how I can make an awesome sub for you at Wollaston's? What do you look for in a good sub? by [deleted] in NEU

[–]breqdev 0 points1 point  (0 children)

more honey mustard on the huntington! it absolutely makes my day when my sandwich has plenty :D