Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.
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.
The discharge tests run at 250 mA, which is probably a bit low, as the HDR-AS30V camera can capture video for about two hours on a single battery. Given the Sony’s nominal 1.24 A·h (love that precision!) capacity and derating the Wasabi’s ambitious 1.6 A·h, two hours suggests a current around 500 mA would be more appropriate, but we’ll go with a lower current for now.
Oddly, the two Wasabi batteries (green & blue traces) outperform the Sony OEM battery (red and purple) in terms of voltage:
Sony NP-BX1 – OEM Wasabi – 2014-01-28
I can’t explain the small kink just before the big dropoff for both Wasabi batteries. Perhaps the protection circuitry behind the battery terminals has a slight peculiarity?
Looking at the total energy delivered, however:
Sony NP-BX1 – OEM Wasabi – Wh – 2014-01-28
The Sony battery says it’ll deliver 4.5 W·h and actually produces 4.8 W·h. The Wasabi batteries claim 5.7 W·h and don’t even come close at 4.25 W·h.
I cross-checked those results by importing the CSV data into a spreadsheet, computing the point-by-point power, finding the average, and then multiplying by the total test time in hours. Doing it a couple different ways says you can eyeball a reasonable value by multiplying the median voltage by the test current to get average wattage, then multiplying by the total test time to get W·h. That’s within a few percent, which is good enough for me.
The camera’s power supply undoubtedly has a low-voltage cutoff, but it’s a single-cell battery and they might just run it down around 2.8 V; in that case, the Sony batteries will last longer. If the voltage cutout is 3.5 V, similar to the Canon camera, then the Wasabi batteries win.
I don’t have enough experience with the camera or the batteries to predict anything based on actual use.
The avconv (formerly ffmpeg) image-to-video programs expect sequentially numbered files, with the numbers in a fixed-width part of the file name, thusly: dsc00001.jpg.
ll | head
total 286576
-rwxr-xr-x 1 ed ed 595708 Jan 23 19:14 dsc00940.jpg
-rwxr-xr-x 1 ed ed 515561 Jan 23 19:14 dsc00941.jpg
-rwxr-xr-x 1 ed ed 580190 Jan 23 19:14 dsc00942.jpg
-rwxr-xr-x 1 ed ed 571387 Jan 23 19:14 dsc00943.jpg
-rwxr-xr-x 1 ed ed 573207 Jan 23 19:14 dsc00944.jpg
-rwxr-xr-x 1 ed ed 571086 Jan 23 19:14 dsc00945.jpg
-rwxr-xr-x 1 ed ed 571600 Jan 23 19:14 dsc00946.jpg
-rwxr-xr-x 1 ed ed 571547 Jan 23 19:14 dsc00947.jpg
-rwxr-xr-x 1 ed ed 565706 Jan 23 19:15 dsc00948.jpg
A Bash one-liner loop does the renumbering:
sn=1 ; for f in *jpg ; do printf -v dn 'dsc%05d.jpg' "$(( sn++ ))" ; mv $f $dn ; done
The results look pretty much like you’d expect:
ll | head
total 286556
-rwxr-xr-x 1 ed ed 595708 Jan 23 19:14 dsc00001.jpg
-rwxr-xr-x 1 ed ed 515561 Jan 23 19:14 dsc00002.jpg
-rwxr-xr-x 1 ed ed 580190 Jan 23 19:14 dsc00003.jpg
-rwxr-xr-x 1 ed ed 571387 Jan 23 19:14 dsc00004.jpg
-rwxr-xr-x 1 ed ed 573207 Jan 23 19:14 dsc00005.jpg
-rwxr-xr-x 1 ed ed 571086 Jan 23 19:14 dsc00006.jpg
-rwxr-xr-x 1 ed ed 571600 Jan 23 19:14 dsc00007.jpg
-rwxr-xr-x 1 ed ed 571547 Jan 23 19:14 dsc00008.jpg
-rwxr-xr-x 1 ed ed 565706 Jan 23 19:15 dsc00009.jpg
Because you’re renaming the files anyway, don’t bother to normalize ’em:
sn=1 ; for f in *JPG ; do printf -v dn 'dsc%05d.jpg' "$(( sn++ ))" ; mv $f $dn ; done
And, of course, you can fetch ’em from the camera while doing that:
sn=1 ; for f in /mnt/part/DCIM/100MSDCF/*JPG ; do printf -v dn 'dsc%05d.jpg' "$(( sn++ ))" ; cp -a $f $dn ; done
That leaves the DSC*JPG original files on the camera, where you can delete all of them in one operation when you’re happy with the results.
If you don’t need the full resolution, reserialize and resize each picture on the fly:
sn=1 ; for f in /mnt/part/DCIM/100MSDCF/*JPG ; do printf -v dn 'dsc%05d.jpg' "$(( sn++ ))" ; convert $f -resize 50% $dn ; done
That’s based on combining several hints turned up by the usual Google search.
To assemble a quick-and-simple movie from the images:
avconv -r 30 -i dsc%05d.jpg -q 5 movie.mp4
The image quality certainly isn’t up to what you (well, I) would expect from a 1920×1080 “HD” file, but the Sony HDR-AS30V Zeiss camera lens seems to be a fisheye pinhole (170° view angle, 2.5 mm f/2.8) backed with relentless image compression:
Sony HDR-AS30V Action Camera
Memo to Self: It’s not worth creating and remembering Yet Another Script.
While converting a stop-action series of images from the HDR-AS30V into a movie, I wanted change all the image files on a USB Flash drive from DSC00008.JPG to dsc00008.jpg, so as to simplify typing their names.
Alas, because the camera’s exFAT filesystem cares not one whit about case, the obvious command doesn’t work:
rename 's/JPG/jpg/' /mnt/part/*
/mnt/part/DSC00008.JPG not renamed: /mnt/part/DSC00008.jpg already exists
The Sony HDR-AS30V “action camera” uses NP-BX1 lithium batteries (3.7 V @ 1.24 A·h = 4.6 W·h) that are, of course, a completely different size and shape than any other lithium battery on the planet.
So.
Tweaking a few dimensions in the Canon NB-6L source code, tinkering with the layout of the contact pins, and shazam Yet Another 3D Printed Battery Test Fixture:
NP-BX1 Holder – show layout
It builds nicely, although the contact pin tunnels are a bit too close to the top of the case:
Sony NP-BX1 Holder – on platform
After reaming out the contact pin holes to the proper diameters & depths, then gluing the plugs in place, it works just as you’d expect:
Sony NP-BX1 battery holder
It’s worth noting that the Wasabi charger accepts the batteries upside-down, with the conspicuous chevron against the charger body. It’s definitely not the way all the other chargers work. The keying recesses on the battery (corresponding to the blocks in the solid model) lie along the bottom edge of the contact surface, so flipping the battery over means they’ll hold it in place, but … oh, well.
That grotty Powerpole connector last saw use in some random benchtop lashup. At some point I’ll be forced to start making more of those.