Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.
There’s nothing too complicated about any of that. I used 2N2907A PNP transistors because I’m running out of those cute little ZVNL110A logic-level MOSFETs; remember that you can’t hitch the emitter to anything higher than +5 V, unless you want to toast the Arduino. Using a PNP switch means that the initial state of the Arduino pins won’t inadvertently turn the LED / laser / flash on.
The laser-photodiode detector:
Laser-photodiode detector – schematic
The 20 MΩ resistor sets the gain at 20 mV/nA, which is both absurdly high and seems to work. The IR LED serving as the photodiode doesn’t pass much photocurrent, particularly with the laser running just above threshold, but the fact that it’s totally unresponsive to room light helps a lot; there’s something to be said for a narrow spectral response, which a real photodiode doesn’t have. I do have some IR photodiodes in tinted packages and might be forced to do some rummaging.
I expected to need a comparator after the transconductance amplifier, but with that much gain the LM324 has a nice, steep edge when the object goes past. The laser beam is small enough that there’s not much error due to convolving the object’s edge with the beam; it’s basically binary.
With the LM324 quad op amp running from +5 V, its output can’t get above +4 V. That’s good enough for a logic-level trigger, although a real circuit should use something like the MAX4330 I hacked into a DIP footprint.
The white LED driver uses a 10 mm package with five white LED chips in parallel that runs at 100 mA:
White LED driver – schematic
I found an LED lashup that I’d built to light up a bird box, so the resistor (which is 12 Ω, not the 100 Ω due to a finger fumble) actually lives at the LED on the other end of the cable, inside a heatshrink strain relief.
The Xenon photoflash driver uses a small relay hacked into the trigger circuit, with a Schottky diode to recirculate the winding current when the transistor turns off:
Xenon flash relay driver – schematic
The diode increases the relay release time, which doesn’t matter here.
The delays from the laser beam break to the flashes should be variable, so there should be a knob with a pushbutton: turn to set the Xenon flash delay, push-and-turn to set the LED flash delay. I doubt that this calls for a digital display, as you can see whether the flash happens at the right time…
The CHDK firmware for Canon point-and-shoot cameras includes a USB remote trigger feature that depends on simply applying +5 V to the USB power leads, which is exactly what happens when you plug an ordinary USB cable into a PC.
Chopping up a spare cable, adding header pins, attaching a bench supply, and whacking the pins with clip leads showed that the camera takes quite a while to haul itself to its feet and click the shutter:
Canon SX230HS – USB trigger – flash
That’s with:
Manual mode: preset shutter & aperture
Manual focus
Focus assist off
Image stabilization off
AF guide light off
Red eye reduction off
Flash enabled, medium intensity, precharged
Turning the flash off slightly reduces the delay, at least judging from when I hear the shutter click while watching the trace trundle across the screen. I may have forgotten to turn something else off, but I doubt it’ll get an order of magnitude faster.
I’d hoped to synchronize an outboard flash with the shutter, but watching a few traces shows that the time from trigger to flash isn’t very consistent; maybe 100 ms jitter, more or less.
The CHDK motion-sensing script works and is “lightning fast”, but it turns out that lightning strokes actually glow for tens to hundreds of milliseconds, so my 1 ms xenon flash will be over and done with by the time the script reacts and opens the camera shutter.
Other ways to synchronize an outboard flash with the shutter:
Fire the outboard flash from the camera flash, with the camera flash inside a shield
Use an absurdly long shutter time with the camera & objects inside a very, very dark enclosure
Use the CHDK motion detection script, but blink an LED into the lens to trigger the shutter, then fire the xenon flash to expose the image
Choice 1 has positive synchronization to the camera shutter, but the shutter delay jitter means the flash won’t happen after a fixed delay from the triggering event. Maybe it’s not as bad as I think.
Choice 2 requires that the shutter stay open longer than the maximum delay jitter, so the flash will happen at known time after the triggering event. I like that, but not the dark enclosure part.
Choice 3 depends on the timing jitter of the script, which should be on the order of a few tens of milliseconds. A shutter speed of 1/25 s = 40 ms might be Good Enough.
This obviously requires a bit of Arduino fiddling…
I’m thinking of taking strobe pictures again, but the results of the LED strobe tach experiment showed that I need many more LEDs, much brighter LEDs, or entirely different technology. The Big Box o’ Xenon Tubes disgorged some surplus camera flash units that seemed amenable to hackage.
The canonical digital trigger uses an optocoupled triac, so I soldered a MOC3022, taken from a random assortment of various optocouplers, across the trigger leads:
Xenon flash – MOC3022 triac
Alas, that didn’t trigger the flash reliably. It may well be that the triac’s leakage current drains the small trigger capacitor below the voltage required to produce a suitable trigger pulse, but I was unwilling to poke around in the thing.
The clip leads go off to a DVM set to the 600 VDC range, which is, I think, the first time the range switch has ever lingered in that position. The 250 µF 330 V capacitor charges to about 300 V, depending on the mojo of the single AA cell powering it, and discharges to about 50 V after the arc quenches. The neon bulb lights when the capacitor goes above 280 V.
The reed relay assortment emitted an ancient Clare 1A05C relay with, as nearly as I could make out from the fragmentary datasheets available nowadays, barely adequate specs:
Xenon flash – PRME 1A05C relay
Unfortunately (and as I rather expected), the first shot welded the contacts together.
A somewhat larger Axicom (aka Tyco) V23079A1011B301 (I’m not making that up) relay had better specs: 220 VDC / 250 VAC / 2 A contacts. The DC rating isn’t relevant here, because the contacts will break only 50 V after the flash, and the AC rating says it’ll withstand well over 350 V.
As with the other gadgets, a blob of hot melt glue holds it in place:
Xenon flash – Axicom V23079 A1011-B301 relay
That worked wonderfully well:
Xenon 280 V 250 uF
The upper trace comes from a PIN-10AP photodiode in the LED measurement fixture, minus the black cap holding the LED. The photodiode connects directly to the oscilloscope input, so we’re seeing its photovoltaic response rather than the photocurrent, but that’s good enough for now. The pulse is about 1.5 ms long at the 50% level (that’s 1 EV down from the peak) and the tail is pretty much gone by 3 ms.
The 3 ms delay after applying voltage to the coil (lower trace, showing what happens when you use a clip lead as a switch) is well within the 4 ms spec in the datasheet. The release time isn’t relevant, as the capacitor has discharged to 50 V and nothing exciting happens when the contacts open.
Charging the stock 250 µF cap to 280 V stores 10 J = 10 W·s:
10 J = (1/2) (250×10-6) (2802)
Discharged to 50 V, the cap has only 0.3 J left, so most of the energy goes into the arc.
Swapping a 1 µF 600 V film capacitor for the electrolytic cap narrows the pulse:
Xenon 350 V 1 uF
A 1 µF cap should reduce the stored energy by a factor of 250 to 0.4 J, but the booster charged it to 350 V = 0.6 J:
0.6 J = (1/2) (1×10-6) (3502)
The test setup, a term that barely applies in this situation, isn’t stable enough to say anything about the relative light output, but it’s certainly not an order of magnitude worse than the 10 J shot (some data and curves from an OEM). The pulse width is maybe 100 µs, just about what I used with the LEDs, but whether the lamp produces enough illumination remains to be seen; it should be brighter than the LEDs.
The boost circuit requires about ten seconds to recharge the 250 µF cap and maybe 250 ms for the 1 µF cap. The Axicom relay can operate at 50 Hz at no load, which definitely won’t constrain the flash rate. The trigger energy at the contacts should be about the same for either flash capacitor, because it comes from a much smaller capacitor charged to the same voltage; buzzing away at a high rep rate will chew up the contacts fairly quickly.
This is not the Monthly Image I had scheduled for today…
A few weeks ago I reported to my doctor that I had a pressure-sensitive lump in my right breast. This happened the very next day:
Left-right Mammogram
It’s a composite of two mammogram images, of my left and right breasts, respectively, with the small white dots marking the obvious targets and the ring above the right dot surrounding a mole. You will be unsurprised to know that the radio-opaque markers came on cheery flowered stickers:
Given such small numbers, what you see up there on the right is almost certainly an unusually tender and mostly unilateral case of gynecomastia, which was the diagnosis relayed from the radiologist after the imaging. Because things are different for guys, there’s an appointment with an oncologist (yes, she specializes in breast cancer) and, perhaps, some biopsy samples in my immediate future.
They triage the appointment schedule based on radiographic evidence. Fortunately, I’m not on the hot list.
Some browsing with the obvious keywords shows that side effects of the blood pressure dope I was taking last year probably triggered my symptoms, with calcium channel blockers and spironolactone the most directly implicated drugs. It turns out that my blood pressure seems OK without drugs (now that they moved the goal posts for my age bracket, anyway), but we devoted half a year to discovering that nothing produced much of a direct effect and the side effects were completely unacceptable.
Protip: it’s probably not worth reducing a male’s androgen levels just to see if his blood pressure goes down. [sigh]
Back to the usual tech stuff …
Returning home with a CD of digital images in hand, I found that, unlike those older X-ray images, feeding these DICOM images (all sporting informative names like IN000001) into the current version of Imagemagick‘s convert triggers a segfault. Rummaging in the repositories produced a dedicated conversion program:
medcon -f IN* -c png
… which grinds away on the DICOM files and spits out PNG image files with the same names prefixed with an ascending sequence number of the form m000-. A burst of Perl regex line noise removes the prefixes:
rename 's/m[\d]{3}-//' *png
Figuring that out neatly diverted my mind from the Main Topic for a while…
The oncologist says I have a classic, textbook case of gynecomastia; if her med students weren’t on break, she’d use me as an example.
About 10% of males taking spironolactone for blood pressure control develop gynecomastia, typically in only one breast. Absent any other signs, there’s no need for biopsy samples or surgical intervention. The symptoms generally resolve within a year after discontinuing spironolactone.
Should the symptoms persist and become objectionable, treatments include surgery or tamoxifen… but I’m not down with that.]
Removing the camera’s front cover (stick the screws to a length of masking tape!) reveals the backup battery hasn’t magically healed itself:
Casio EX-Z850 backup battery – corrosion
The main battery applies 3.2 V with the top terminal negative; it’s marked to help me remember that fact.
I snipped both legs of the top contact bracket, which promptly fell off, and then pushed the battery off its bottom contact. The condition of those two pads suggests a pair of cold solder joints (clicky for more dots):
Casio EX-Z850 backup battery – contact pads
I wanted to replace it with a polyacene supercap, but there’s just not enough room in there. The biggest cap that fit was a 33 μF 16 V SMD electrolytic cap, so I soldered one in place:
I had to flip the camera around to get the soldering iron in between the cap and what looks to be an intrusion monitoring switch just to its left. No lie, that shiny metal thing seems to be a tab that presses against the front cover; it could be a static discharge / grounding point, but the base looks more complex than that.
Now, a capacitor isn’t a battery, but memory backup doesn’t require much of a battery, either. I guesstimated the memory (or whatever) would draw a few microamps, at most, giving me a few seconds, at least, to swap batteries. A quick measurement shows that I’ll have plenty of time:
Casio EX-X850 backup capacitor – voltage vs time
The camera started up fine after that adventure, so the memory stays valid with the backup voltage down around 1 V.
The cap measured 34 μF, so a voltage decline of 24 mV/s works out to:
IC = C (dV/dT) = 34 μF x 24 mV/s = 820 nA
So, at least at room temperature, the memory draws less than a microamp.
I love it when a plan comes together!
With any luck, that capacitor should outlast the rest of the camera. It’ll definitely outlast a lithium battery, even if I could find one to fit in that spot.
I did those measurements by sampling the capacitor, rather than holding the meter probes in place, because the300 nA of current drawn by a 10 MΩ input resistance would cause a pretty large measurement error…
Back in the day, the Hudson River would freeze solid enough to supply all the icehouses in the valley that stored a year’s worth of refrigeration. These days, it’s probably a good thing we don’t depend on river ice, because it’s not nearly frozen in mid-January:
The barge looks like it’s deadheading back to NYC after unloading, most likely at the Port of Albany, following the clear channel bulldozed by an earlier and much larger barge.